import { Schema, Mongoose, Connection } from 'mongoose'; import { IMongoConfig, ILogger, ISystemNotify } from './definitions'; import { MemCacheConnections } from './cacheConnections'; export { Schema, FilterQuery, UpdateQuery, Document } from 'mongoose'; export declare const Mixed: typeof Schema.Types.Mixed; export declare class MongoDB extends MemCacheConnections { logger: ILogger; config: IMongoConfig; systemNotify: ISystemNotify; reconnectAttempt: number; constructor({ connectionString, options, reconnectAttempt }: IMongoConfig, logger?: ILogger, systemNotify?: ISystemNotify); connect(): Promise; createConnection(domain: string, currentAttempt?: number): Promise; /** * Wait for connection to reach readyState === 1 (connected) */ private waitForConnectionReady; /** * Clean up failed connection */ private cleanupFailedConnection; /** * Determine if connection error should be retried */ private shouldRetryConnection; /** * Calculate retry delay with exponential backoff * Returns: 2s, 4s, 6s, 8s, 10s */ private calculateRetryDelay; private listen; private sendErrorToTelegram; close(): Promise; }