import { type ReplayStore } from "@decionis/agent-safe-pipeline"; /** The part of a `pg` `Pool` this host uses. */ export interface PgPool { query(text: string, values: unknown[]): Promise<{ rowCount: number | null; }>; on(event: "error", listener: (error: Error) => void): unknown; end(): Promise; } export type LoadPg = () => Promise<{ Pool: new (options: { connectionString: string; max: number; }) => PgPool; }>; /** * Loads `pg` only when the Postgres store is configured. The specifier is * not a literal, so a bundler leaves it alone and a deployment that never * names the store never loads a database driver; `pg` is an optional * dependency of the package and is present in the image. */ export declare const loadPg: LoadPg; /** The replay store the edge runtime claims intents in, with its lifecycle. */ export interface EdgeReplay { readonly kind: "memory" | "postgres"; readonly store: ReplayStore; /** Throws unless the store can be used: for Postgres, the table is reachable. */ ready(): Promise; /** Removes lapsed claims; nothing to do in memory. */ cleanup(): Promise; close(): Promise; } export declare function memoryReplay(): EdgeReplay; /** * The shared store: one pool, opened on first use. The connection string is * a secret, read when the pool is opened. */ export declare function postgresReplay(options: { readonly databaseUrl: () => string; readonly namespace: string; readonly table: string; readonly load?: LoadPg; readonly clock?: () => number; }): EdgeReplay; //# sourceMappingURL=EdgeReplay.d.ts.map