diff --git a/src/index.ts b/src/index.ts index 1dff039f..9fb4cb78 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,8 @@ export { default as PostgrestTransformBuilder } from './PostgrestTransformBuilde export { default as PostgrestBuilder } from './PostgrestBuilder' export { PostgrestResponse, + PostgrestResponseFailure, + PostgrestResponseSuccess, PostgrestSingleResponse, PostgrestMaybeSingleResponse, PostgrestError, diff --git a/src/types.ts b/src/types.ts index 233988a2..f9bbf662 100644 --- a/src/types.ts +++ b/src/types.ts @@ -21,12 +21,12 @@ interface PostgrestResponseBase { status: number statusText: string } -interface PostgrestSingleResponseSuccess extends PostgrestResponseBase { +export interface PostgrestResponseSuccess extends PostgrestResponseBase { error: null data: T count: number | null } -interface PostgrestResponseFailure extends PostgrestResponseBase { +export interface PostgrestResponseFailure extends PostgrestResponseBase { error: PostgrestError data: null count: null @@ -36,7 +36,7 @@ interface PostgrestResponseFailure extends PostgrestResponseBase { // - remove PostgrestResponse and PostgrestMaybeSingleResponse // - rename PostgrestSingleResponse to PostgrestResponse export type PostgrestSingleResponse = - | PostgrestSingleResponseSuccess + | PostgrestResponseSuccess | PostgrestResponseFailure export type PostgrestMaybeSingleResponse = PostgrestSingleResponse export type PostgrestResponse = PostgrestSingleResponse