import type { CallOptions } from './rpc-client.js'; export type LiveViewFrame = { type: 'snapshot'; items: T[]; operationId?: string; } | { type: 'upsert'; record: T; afterId?: string | null; operationId?: string; } | { type: 'remove'; id: string; operationId?: string; } | { type: 'heartbeat'; intervalMs?: number; }; export type LiveViewStatus = 'connecting' | 'ready' | 'reconnecting' | 'error' | 'closed'; export type LiveViewSnapshot = { readonly items: readonly T[]; readonly status: LiveViewStatus; readonly error: unknown; }; export type LiveViewOptions = { subscribe: (options: { signal: AbortSignal; }) => AsyncIterable> | Promise>>; getKey?: (record: T) => string; createOperationId?: () => string; retryMs?: number; /** Reconnect after this multiple of the server heartbeat interval is silent. */ livenessFactor?: number; /** Maximum wait after HTTP success for the matching live frame. */ ackTimeoutMs?: number; }; export type MutationMethod = (args: TArgs, options: CallOptions & { operationId: string; }) => Promise; export type LiveView = { getSnapshot(): LiveViewSnapshot; subscribe(listener: () => void): () => void; mutate(method: MutationMethod, args: TArgs, options?: Omit): Promise; resync(): void; close(): void; readonly done: Promise; }; export declare function createLiveView(options: LiveViewOptions): LiveView; //# sourceMappingURL=live-view.d.ts.map