/* Declarations for shared/sync-protocol.mjs — protocol 2. */ export interface SyncTableSpec { pk: string[]; cols: string[]; } export const PROTOCOL: 2; export const PROTOCOL_HEADER: string; export const PAGE_SIZE: number; export const SYNC_TABLES: Record; export const SYNC_TABLE_NAMES: string[]; export function pkFor(tbl: string): string[] | null; /** A row's primary-key values as a JSON array — the key on the wire. */ export function encodePk(tbl: string, row: Record): string; export function decodePk(pk: string): (string | number)[]; export function isSyncableMetaKey(key: string): boolean; export type ResetScope = "chat" | "roadmap" | "everything"; export const RESET_SCOPES: Record; export function resetCovers(scope: string, tbl: string, row: Record): boolean; /** A row on the wire. `base` is the change_seq the sender last agreed with. */ export interface WireRow { tbl: string; pk: string; base: number; deleted?: boolean; data?: Record | null; updated_at?: number; } /** A row as the server holds it: `seq` is its current change_seq. */ export interface ServerRow { tbl: string; pk: string; seq: number; deleted: boolean; data: Record | null; updated_at?: number; } export interface PullResponse { epoch: string; rows: ServerRow[]; cursor: number; more: boolean; } export interface PushResponse { epoch: string; applied: { tbl: string; pk: string; seq: number }[]; /** Rows the push could not overwrite: the server's current version. A row absent on the server comes back with seq 0 and deleted. */ conflicts: ServerRow[]; }