import { Pool, PoolConfig } from "pg"; import { SessionStore } from "./types"; interface NewPoolOpts { host?: string | undefined; port?: number | undefined; database?: string | undefined; user?: string | undefined; password?: string | (() => string | Promise) | undefined; /** * Postgres Pool config. * * Remember to install the db driver `'pg'`. * * @see {@link https://node-postgres.com/apis/pool node-postgres | Pool Options} * */ config?: Omit; /** Table name to use for sessions. Defaults to "telegraf-sessions". */ table?: string; /** Called on fatal connection or setup errors */ onInitError?: (err: unknown) => void; } interface ExistingPoolOpts { /** If passed, we'll reuse this instance of pg Pool instead of creating our own. */ pool: Pool; /** Table name to use for sessions. Defaults to "telegraf-sessions". */ table?: string; /** Called on fatal connection or setup errors */ onInitError?: (err: unknown) => void; } /** @unstable */ export declare function Postgres(opts: NewPoolOpts): SessionStore; export declare function Postgres(opts: ExistingPoolOpts): SessionStore; export {};