Skip to content

Commit 8ce5da4

Browse files
authored
feat(types): export PostgrestResponseSuccess and PostgrestResponseFailure (#396)
1 parent 860387e commit 8ce5da4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export { default as PostgrestTransformBuilder } from './PostgrestTransformBuilde
55
export { default as PostgrestBuilder } from './PostgrestBuilder'
66
export {
77
PostgrestResponse,
8+
PostgrestResponseFailure,
9+
PostgrestResponseSuccess,
810
PostgrestSingleResponse,
911
PostgrestMaybeSingleResponse,
1012
PostgrestError,

src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ interface PostgrestResponseBase {
2121
status: number
2222
statusText: string
2323
}
24-
interface PostgrestSingleResponseSuccess<T> extends PostgrestResponseBase {
24+
export interface PostgrestResponseSuccess<T> extends PostgrestResponseBase {
2525
error: null
2626
data: T
2727
count: number | null
2828
}
29-
interface PostgrestResponseFailure extends PostgrestResponseBase {
29+
export interface PostgrestResponseFailure extends PostgrestResponseBase {
3030
error: PostgrestError
3131
data: null
3232
count: null
@@ -36,7 +36,7 @@ interface PostgrestResponseFailure extends PostgrestResponseBase {
3636
// - remove PostgrestResponse and PostgrestMaybeSingleResponse
3737
// - rename PostgrestSingleResponse to PostgrestResponse
3838
export type PostgrestSingleResponse<T> =
39-
| PostgrestSingleResponseSuccess<T>
39+
| PostgrestResponseSuccess<T>
4040
| PostgrestResponseFailure
4141
export type PostgrestMaybeSingleResponse<T> = PostgrestSingleResponse<T | null>
4242
export type PostgrestResponse<T> = PostgrestSingleResponse<T[]>

0 commit comments

Comments
 (0)