@nichoth/replicache-supabase
Version:
Use replicache with supabase
30 lines • 1.92 kB
TypeScript
import type { JSONValue } from 'replicache';
import type { Executor } from './db.js';
export type ClientGroup = {
id: string;
userID: string;
};
export type Client = {
id: string;
clientGroupID: string;
lastMutationID: number;
lastModifiedVersion: number;
};
export declare function getClientGroup(executor: Executor, id: string): Promise<ClientGroup | null>;
export declare function createClientGroup(executor: Executor, id: string, userID: string): Promise<{
id: string;
userID: string;
}>;
export declare function getClient(executor: Executor, id: string): Promise<Client | null>;
export declare function createClient(executor: Executor, id: string, clientGroupID: string, version: number): Promise<Client>;
export declare function updateClient(executor: Executor, client: Client): Promise<void>;
export declare function getEntry(executor: Executor, key: string): Promise<JSONValue | undefined>;
export declare function putEntry(executor: Executor, key: string, value: JSONValue, version: number): Promise<void>;
export declare function delEntry(executor: Executor, key: string, version: number): Promise<void>;
export declare function getEntries(executor: Executor, fromKey: string): AsyncIterable<readonly [string, JSONValue]>;
export declare function getChangedEntries(executor: Executor, prevVersion: number): Promise<[key: string, value: JSONValue, deleted: boolean][]>;
export declare function getGlobalVersion(executor: Executor): Promise<number>;
export declare function setGlobalVersion(executor: Executor, version: number): Promise<void>;
export declare function getChangedLastMutationIDs(executor: Executor, clientGroupID: string, sinceVersion: number): Promise<Record<string, number>>;
export declare function setLastMutationID(executor: Executor, clientID: string, lastMutationID: number, lastModifiedVersion: number): Promise<void>;
//# sourceMappingURL=util.d.ts.map