/** * Explicit server startup readiness. * * Protocol handlers ensure storage lazily for embeddability, but a production * host must prove schema compatibility before it binds an HTTP/WebSocket port. * This helper accepts the generated ServerSchema, compiles it once, and exposes * a structured failure that cannot be confused with request authentication. */ import type { SyncServerConfig } from './context.js'; export declare const SYNC_SERVER_READINESS_ERROR_CODE: "sync.schema_not_ready"; export type SyncServerReadinessPhase = 'schema_compile' | 'storage_migration'; export declare class SyncServerReadinessError extends Error { readonly name = "SyncServerReadinessError"; readonly code: "sync.schema_not_ready"; readonly phase: SyncServerReadinessPhase; readonly schemaVersion: number; constructor(options: { readonly phase: SyncServerReadinessPhase; readonly schemaVersion: number; readonly cause: unknown; }); } /** * Compile and migrate the configured server storage before listening. * * Pass the same canonical config used by HTTP and realtime. The thrown error * exposes only a stable code, phase, and schema version; operators can inspect * `cause` locally for the table/column or storage diagnostic. */ export declare function ensureSyncServerReady(config: Pick): Promise;