import { EventEmitter } from 'node:events'; import { MongoConnectionManager } from './connection_manager.js'; import type { MongoConnectionContract, MongoDatabaseContract, MongoQueryEventNode } from '../types/database.js'; import type { MongoDBConfig } from '../define_config.js'; /** * Database class exposes the API to manage multiple connections and execute * queries against one or more connections. */ export declare class MongoDatabase implements MongoDatabaseContract { config: MongoDBConfig & { prettyPrintDebugQueries?: boolean; }; logger: any; emitter: EventEmitter; /** * Connection manager to manage multiple named connections */ manager: MongoConnectionManager; /** * Default connection name */ private defaultConnectionName; constructor(config: MongoDBConfig & { prettyPrintDebugQueries?: boolean; }, logger: any, emitter: EventEmitter); /** * Returns connection for a specific name or the default connection. * * The returned connection may not be immediately ready — the connect call * is kicked off here but not awaited, so callers must either `await * connection.connect()` explicitly (idempotent) or use the async-proxy * accessors that await on first use. */ connection(name?: string): MongoConnectionContract; /** * Pretty print query */ prettyPrint(query: MongoQueryEventNode): void; }