import { PGlite } from '@electric-sql/pglite'; import { c as ServerState } from './state-DTMxyzXf.js'; import 'valibot'; interface WalEvent { oldRecord: Record | null; record: Record | null; schema: string; table: string; txid: string; type: "delete" | "insert" | "update"; } interface WalEventBridge { close(): Promise; poll(): Promise; subscribe(callback: WalEventSubscriber): () => void; } interface WalEventBridgeOptions { database?: string; host?: string; password?: string; port?: number; username?: string; } type WalEventSubscriber = (events: WalEvent[]) => void; type PolledMessage = { name: string; text?: string; }; declare function attachWalEventBridge(db: PGlite, _options?: WalEventBridgeOptions): Promise; declare function shouldPollWalAfterMessages(messages: PolledMessage[]): boolean; declare function shouldPollWalAfterResponse(response: Uint8Array): boolean; interface DBServer { attachWalEventBridge(): Promise; close(): Promise; readonly connectionLimit: number; readonly connectionString: string; readonly connectTimeout: number; readonly database: string; dump(destinationPath: string): Promise; readonly maxIdleConnectionLifetime: number; readonly password: string; readonly poolTimeout: number; readonly port: number; readonly prismaORMConnectionString: string; getPrimaryKeyColumns(schema: string, table: string): Promise; readonly socketTimeout: number; readonly sslMode: string; readonly terminalCommand: string; readonly username: string; } interface DBDump { dumpPath: string; } type DBServerPurpose = "database" | "shadow_database"; declare function startDBServer(purpose: DBServerPurpose, serverState: ServerState): Promise; type DumpDBOptions = { dataDir: string; db?: never; debug?: boolean; destinationPath?: D; } | { dataDir?: never; db: PGlite; debug?: boolean; destinationPath?: D; }; declare function dumpDB(options: DumpDBOptions): Promise<[D] extends [never] ? string : void>; export { type DBDump, type DBServer, type DBServerPurpose, type DumpDBOptions, type WalEvent, type WalEventBridge, attachWalEventBridge, dumpDB, shouldPollWalAfterMessages, shouldPollWalAfterResponse, startDBServer };