import type { CompiledTable } from './schema.js'; import type { SqliteDatabase } from './sqlite-driver.js'; import type { StoredRow } from './storage.js'; /** The §5.6 version column as it appears inside a sqlite image (§5.3). */ export declare const IMAGE_VERSION_COLUMN = "_syncular_version"; /** The §5.3 metadata table name. */ export declare const IMAGE_METADATA_TABLE = "_syncular_segment"; export interface SqliteImageInput { readonly table: CompiledTable; readonly schemaVersion: number; readonly asOfCommitSeq: number; readonly scopeDigest: string; readonly rows: readonly StoredRow[]; } /** * The §5.3 image-builder capability, injected through * `SyncServerConfig.sqliteImageBuilder`. Building an image needs * a real SQLite engine, which is not available on every runtime. The core * takes the builder as an optional capability rather than importing a driver * on the pull path. A Bun or Node host passes `buildSqliteImage`; a Workers * host omits it and serves the rows lane. */ export type SqliteImageBuilder = (input: SqliteImageInput) => Uint8Array; /** Populate a §5.3 image database for a whole-table snapshot. */ export declare function writeSqliteImage(db: SqliteDatabase, input: SqliteImageInput): void;