///
import { RealtimePostgresChangesPayload, SupabaseClient } from "@supabase/supabase-js";
import { RequestInfo, RequestInit } from "node-fetch";
type RequestCheck = (input: URL | RequestInfo, options?: RequestInit | undefined) => void;
/**
* Runs a real SuperbaseClient against a mock backend by using a custom fetch implementation.
* Any calls to the RealtimeClient will be mocked as well.
*/
export declare class SupabaseBackendMock {
readonly url = "http://example.com/";
readonly key = "ABCDEF";
readonly client: SupabaseClient;
private expectedFetches;
private realtimeClientMock;
constructor(options?: any);
expectFetch(name: string, requestCheck: RequestCheck): {
thenReturn: (body?: any, headers?: Record) => void;
thenReturnError: (errorCode: string, httpCode?: number, message?: string) => void;
thenFail: (error?: any) => void;
};
expectQuery(name: string, expected: {
table: string;
params?: string;
method?: string;
body?: string;
}): {
thenReturn: (body?: any, headers?: Record) => void;
thenReturnError: (errorCode: string, httpCode?: number, message?: string) => void;
thenFail: (error?: any) => void;
};
expectInsert(table: string, body: string): {
thenReturn: (body?: any, headers?: Record) => void;
thenReturnError: (errorCode: string, httpCode?: number, message?: string) => void;
thenFail: (error?: any) => void;
};
verifyNoMoreQueriesExpected(): void;
private fetch;
expectRealtimeSubscription>(table: string, topic: string, event?: string, schema?: string): {
next: (event: Partial>) => void;
verifyUnsubscribed: import("ts-mockito/lib/MethodStubVerificator.js").MethodStubVerificator>;
};
}
export {};