callApi
callApi: (call: { input?: unknown; path: string }) => unknown
changes
changes: (
query: { collections: Record<string, number>; limit?: number },
) =>
| {
cursors?: Record<string, number>;
hasMore: boolean;
type: "changes";
updates: {
clientId?: string;
collection: string;
createdAt: number;
id: string;
key: string | number;
path?: string;
previousValue?: unknown;
sequence: number;
serverCreatedAt: string;
type: "insert" | "update" | "delete";
value?: unknown;
}[];
watermark: number;
}
| { collections: string[]; type: "resyncRequired"; watermark: number }
mutate
mutate: (
batch: {
updates: {
clientId?: string;
collection: string;
createdAt: number;
id: string;
key: string | number;
path?: string;
previousValue?: unknown;
type: "insert" | "update" | "delete";
value?: unknown;
}[];
},
) => { accepted: number; watermark: number }
persist
persist: ( batch: { updates: { clientId?: string; collection: string; createdAt: number; id: string; key: string | number; path?: string; previousValue?: unknown; type: "insert" | "update" | "delete"; value?: unknown; }[]; },) => SequencedBatch
subscribe
subscribe: (
input: { collection: string },
) => { collection: string; subscriptions: string[] }
unsubscribe
unsubscribe: (
input: { collection: string },
) => { collection: string; subscriptions: string[] }
validate
validate: (
batch: {
updates: {
clientId?: string;
collection: string;
createdAt: number;
id: string;
key: string | number;
path?: string;
previousValue?: unknown;
type: "insert" | "update" | "delete";
value?: unknown;
}[];
},
) => void