import { ClientSession, Db, MongoClient } from "mongodb"; import { MongoBaseRepository } from "./MongoBaseRepository"; interface MongoBackendConfig { mongo: MongoClient; app: string; session?: ClientSession; } export declare class MongoBackend { private _client; private _app; private _dbName; protected _session: ClientSession | undefined; constructor(config: MongoBackendConfig); getRepo>(RepoClass: new (db: Db, session?: ClientSession) => T): T; get db(): Db; get client(): MongoClient; /** * Closes the connection only if a client exists. */ close(): Promise; /** * Connects the client to the server. * In newer MongoDB drivers, this is often optional as it connects on demand, * but explicit calling is better for verifying connectivity during init. */ connect(): Promise; /** * Checks if the client is currently connected to the server. */ isConnected(): Promise; /** * Creates a collection in the database. */ createCollection(name: string): Promise; /** * Properly checks if a collection exists by name. */ collectionExists(name: string): Promise; /** * Simple insert of one item * */ insert(collectionName: string, data: any): Promise; } export {}; //# sourceMappingURL=MongoBackend.d.ts.map