/** * SQL storage for Yjs collaborative document state. * * Uses a framework-level `_collab_docs` table (TEXT columns with base64 * encoding for binary Yjs state) that works across SQLite and Postgres. */ export interface YDocStateRecord { state: Uint8Array; version: number; } /** Load Yjs state plus optimistic concurrency version. */ export declare function loadYDocRecord(docId: string): Promise; /** Load Yjs state as Uint8Array, or null if not found. */ export declare function loadYDocState(docId: string): Promise; /** Save only if the stored row still has the version the caller merged from. */ export declare function trySaveYDocState(docId: string, state: Uint8Array, textSnapshot: string, expectedVersion: number | null): Promise; /** Save Yjs state (Uint8Array) and a plain-text snapshot. */ export declare function saveYDocState(docId: string, state: Uint8Array, textSnapshot: string): Promise; /** Check if a document has collaborative state. */ export declare function hasCollabState(docId: string): Promise; /** Delete collaborative state for a document. */ export declare function deleteCollabState(docId: string): Promise; declare function uint8ArrayToBase64(arr: Uint8Array): string; declare function base64ToUint8Array(b64: string): Uint8Array; export { uint8ArrayToBase64, base64ToUint8Array }; //# sourceMappingURL=storage.d.ts.map