import type { BlobEnvelope, V2Table } from './envelope.js'; export interface AckRecord { table: V2Table; key: string; lww: string | null; deleted: boolean; } export interface V2Staging { file_id: string; cursor: string | null; acked: Record; } export declare function loadStaging(path: string, fileId: string): V2Staging; export declare function saveStaging(path: string, s: V2Staging): void; /** True iff this local version is newer than what the server is known to have. * Strict `>` on the LWW value: exact-timestamp ties with divergent content are a * known pre-existing caveat (same class as the server cursor edge), out of scope here. * Pull-side reconciliation still uses the full pickWinner total order; this push gate * only needs "is my local copy strictly ahead of the version the server already has?". */ export declare function shouldPush(s: V2Staging, e: BlobEnvelope): boolean; export declare function markAcked(s: V2Staging, e: BlobEnvelope): void; export declare function setCursor(s: V2Staging, cursor: string): void; /** Prune ack records that are tombstoned AND no longer present in the live store key set * (i.e. hard-deleted, not merely soft-deleted). Events (write-once union) are never pruned. * `liveKeys` = `${table}:${key}` for every row currently in the store. The v2 ledger is already * bounded (one record per entity); this only reclaims records for entities that physically vanished. */ export declare function gcStaging(s: V2Staging, liveKeys: Set): void;