sveltekit-sync
Version:
Local-first sync engine for SvelteKit
14 lines (13 loc) • 446 B
TypeScript
import type { RealtimeServerConfig } from '../realtime/types.js';
export interface SyncTableConfig<T = any> {
table: string;
columns?: string[];
where?: (userId: string) => any;
transform?: (row: T) => Partial<T>;
conflictResolution?: 'client-wins' | 'server-wins' | 'last-write-wins';
}
export interface SyncConfig {
tables: Record<string, SyncTableConfig>;
realtime?: RealtimeServerConfig;
batchSize?: number;
}