import { type LWWDocument } from './crdt.js'; export interface LocalRecord { id: string; collection: string; data: Record; _localVersion: number; _serverVersion: number; _syncStatus: 'synced' | 'pending' | 'conflict'; _updatedAt: number; _deletedAt?: number; _conflictData?: Record; _crdtDoc?: LWWDocument; } export interface SyncQueueItem { id: string; collection: string; recordId: string; operation: 'create' | 'update' | 'delete'; payload: Record; attempts: number; createdAt: number; lastAttemptAt?: number; error?: string; } export interface OfflineBlob { id: string; blob: Blob; collection: string; recordId: string; field: string; createdAt: number; } export declare class LocalStore { private db; private clock; open(): Promise; private persistLamport; /** Write a local record and add to sync queue */ put(collection: string, id: string, data: Record): Promise; /** Read a local record (instant, no network) */ get(collection: string, id: string): Promise; /** List records from a collection (local) */ list(collection: string): Promise; /** Soft delete local and add to sync queue */ delete(collection: string, id: string): Promise; /** Returns all pending operations from sync queue */ getPendingOps(): Promise; /** Mark an operation as completed (remove from queue, update record status) */ markSynced(queueItemId: string, collection: string, recordId: string, serverVersion: number): Promise; /** Mark an operation as failed (increment attempts, save error) */ markFailed(queueItemId: string, error: string): Promise; /** Apply data from server (via WebSocket or pull) */ applyServerUpdate(collection: string, id: string, data: Record, serverVersion: number): Promise; /** Get records with conflicts for UI resolution */ getConflicts(collection?: string): Promise; /** Resolve a conflict (user decides which version wins) */ resolveConflict(collection: string, id: string, resolvedData: Record): Promise; /** Save an offline blob — returns a temporary ID 'local_blob_' */ saveBlob(blob: Blob, collection: string, recordId: string, field: string): Promise; /** Returns all pending offline blobs */ getPendingBlobs(): Promise; /** Delete an offline blob after successful upload */ deleteBlob(id: string): Promise; /** Clear all local data */ clear(): Promise; close(): Promise; } //# sourceMappingURL=local-store.d.ts.map