import { MongoClient } from 'mongodb'; /** Manages a shared pool of MongoClient instances, reusing connections by URI and pool options. */ export declare class MongoClientWrapper { /** Global cache of wrapper instances keyed by URI and pool options. */ static readonly clients: Map; private readonly cacheKey; private readonly client; private connected; private operationChain; private refCount; constructor(uri: string, maxPoolSize?: number, closeDelay?: number, cacheKey?: string); /** * Builds a cache key from connection URI and pool options. * @param uri - The MongoDB connection URI * @param poolSize - Maximum connection pool size * @param closeDelay - Delay in milliseconds before closing idle connections */ static cacheKey(uri: string, poolSize?: number, closeDelay?: number): string; /** * Gets or creates a cached MongoClientWrapper for the given URI and pool options. * @param uri - The MongoDB connection URI * @param poolSize - Maximum connection pool size * @param closeDelay - Delay in milliseconds before closing idle connections * @returns A cached or newly created wrapper instance */ static get(uri: string, poolSize?: number, closeDelay?: number): MongoClientWrapper; /** Connects to MongoDB and returns the underlying MongoClient. */ connect(): Promise; /** Releases a connection reference and closes the client when the last reference is released. */ disconnect(): Promise; /** Initiates a graceful close of the connection, regardless of outstanding references. */ initiateClose(): Promise; private enqueue; private removeFromCache; } //# sourceMappingURL=Wrapper.d.ts.map