import { EventEmitter } from 'events'; import { a as PGlite, s as PGliteOptions } from '../interface-ymvJB3xs.cjs'; interface Config { pglite: PGlite; } /** * Create a new PGlitePgConfig instance. * This object can then be used with node-postgres clients such as Pool, * e.g.: * const pgConfig = createPgConfig() * const pool = new Pool(pgConfig) * const client = await pool.connect() * * @param pglite An existing PGlite instance to use instead of creating a new * one. It is owned by the caller and is not closed by node-postgres. * @param dataDir The directory to store the database files * Use memory:// to use in-memory filesystem * @param options PGlite options * @returns The PGlitePgConfig instance. node-postgres waits for PGlite to be * ready when connecting. */ declare function createPgConfig(pglite: PGlite): PGlitePgConfig; declare function createPgConfig(options?: O): PGlitePgConfig; declare function createPgConfig(dataDir?: string, options?: O): PGlitePgConfig; declare class PGlitePgConfig { constructor(config: Config); readonly connection: PglitePgConnection; readonly poolSize = 1; readonly password = "dummy"; readonly user = "postgres"; readonly database = "postgres"; readonly port = 5432; readonly host = "localhost"; } declare class PglitePgConnection extends EventEmitter { #private; _connecting: boolean; readonly stream: { destroy: () => void; }; parsedStatements: {}; submittedNamedStatements: {}; constructor(config: Config); connect(_port: number, _host: string): Promise; requestSsl(): void; startup(_config: any): void; cancel(_processID: any, _secretKey: any): void; password(_password: string): void; sendSASLInitialResponseMessage(mechanism: any, initialResponse: any): void; sendSCRAMClientFinalMessage(additionalData: any): void; query(text: string): void; parse(query: any): void; bind(config: any): void; execute(config: any): void; flush(): void; sync(): void; end(): void; close(msg: any): void; describe(msg: any): void; sendCopyFromChunk(chunk: any): void; endCopyFrom(): void; sendCopyFail(msg: any): void; ref(): void; unref(): void; } export { type Config, PGlitePgConfig, PglitePgConnection, createPgConfig };