import { Pool, PoolOptions } from "mysql2"; import { SessionStore } from "./types"; interface NewPoolOpts { host?: string | undefined; port?: number | undefined; database?: string | undefined; user?: string | undefined; password?: string; /** * MySQL2 Pool options. * * Remember to install the db driver `'mysql2'`. * * @see {@link https://github.com/sidorares/node-mysql2#using-connection-pools Node MySQL 2 | Using connection pools} * */ 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 MySQL2 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 MySQL(opts: NewPoolOpts): SessionStore; export declare function MySQL(opts: ExistingPoolOpts): SessionStore; export {};