import { MongoClient, MongoClientOptions } from "mongodb"; import { SessionStore } from "./types"; interface NewClientOpts { /** MongoDB connection URL; required. */ url: string; /** * MongoDB MongoClientOptions. * * Remember to install the db driver `'mongodb'`. * * @see {@link https://www.mongodb.com/docs/drivers/node/current/fundamentals/connection/connection-options MongoDB | Connection Options} * */ config?: MongoClientOptions; /** The name of the database we want to use. If not provided, database name will be taken from connection string. */ database?: string; /** MongoDB collection name to use for sessions. Defaults to "telegraf-sessions". */ collection?: string; /** Called on fatal connection or setup errors */ onInitError?: (err: unknown) => void; } interface ExistingClientOpts { /** If passed, we'll reuse this client instead of creating our own. */ client: MongoClient; /** The name of the database we want to use. If not provided, database name will be taken from connection string. */ database?: string; /** MongoDB collection name to use for sessions. Defaults to "telegraf-sessions". */ collection?: string; /** Called on fatal connection or setup errors */ onInitError?: (err: unknown) => void; } /** @unstable */ export declare function Mongo(opts: NewClientOpts): SessionStore; export declare function Mongo(opts: ExistingClientOpts): SessionStore; export {};