UNPKG

@nichoth/replicache-supabase

Version:
59 lines 1.62 kB
import type { MutatorDefs } from 'replicache'; import { z } from 'zod'; import { Executor } from './db.js'; import { Client } from './data.js'; export declare const MutationSchema: z.ZodObject<{ id: z.ZodNumber; clientID: z.ZodString; name: z.ZodString; args: z.ZodAny; }, "strip", z.ZodTypeAny, { id: number; clientID: string; name: string; args?: any; }, { id: number; clientID: string; name: string; args?: any; }>; export declare const PushRequestSchema: z.ZodObject<{ clientGroupID: z.ZodString; mutations: z.ZodArray<z.ZodObject<{ id: z.ZodNumber; clientID: z.ZodString; name: z.ZodString; args: z.ZodAny; }, "strip", z.ZodTypeAny, { id: number; clientID: string; name: string; args?: any; }, { id: number; clientID: string; name: string; args?: any; }>, "many">; }, "strip", z.ZodTypeAny, { clientGroupID: string; mutations: { id: number; clientID: string; name: string; args?: any; }[]; }, { clientGroupID: string; mutations: { id: number; clientID: string; name: string; args?: any; }[]; }>; export type PushRequest = z.infer<typeof PushRequestSchema>; export declare function processPush(push: PushRequest, userID: string, mutators: MutatorDefs): Promise<void>; export declare function ensureClient(executor: Executor, id: string, clientGroupID: string, lastModifiedVersion: number, mutationID: number): Promise<Client>; //# sourceMappingURL=push.d.ts.map