import * as WebSocket from 'ws';
import { LoggedInUserModel } from '../models/logged-in-users.model';
import { ActiveSubscriptionModel, SubscriptionModel, SubscriptionPubModel } from '../models/subscription.model';
import { DependencyContextSnapshot } from '../util/subscription-dependency-context';
import { MonitorManagerFunction } from './monitor.manager';
export declare class SubscriptionManager {
    private _websocketManager;
    private _publications;
    private _subscriptions;
    private _wss;
    private _loggedInUsers;
    private _lastRouteBySocket;
    private _mongoQueue;
    private _mongoQueueId;
    private _oplog$;
    private _oplogMode;
    private _useLocalOplog;
    private _localOplogResyncIntervalMs;
    private _localOplogResyncTimer;
    private _nodeCache;
    private _cacheId;
    private _heapSize;
    private _heapLimit;
    private serverConfig;
    private _monitorManagerFunction;
    private _enableDebug;
    private _enableDependencyDebug;
    private _connectDebug;
    private _debugOplogCollections;
    private _debugOplogHits;
    private _debugSubCollections;
    private _debugSubHits;
    private _debugUnSubHits;
    private _debugUnSubAllHits;
    private _debugMongoQueueHits;
    private _debugMongoQueueCollections;
    private _debugSendQueueHits;
    private _debugRemoveCacheHits;
    private _subSendDebug;
    private _subSendLogEnabled;
    private _subSendLogThresholdMs;
    private _subSendLogBytes;
    private _subSendLogSampleRate;
    private _aiWorkerDebug;
    private _aiSubscriptionDebug;
    private _aiSubLastAt;
    private _oplogRetryCount;
    private _lastResumeToken;
    private _lastResumeTokenSaveMs;
    private _resumeTokenSavePromise;
    private _resumeTokenSaveForcePending;
    private _fullResyncPromise;
    private readonly RESUME_TOKEN_COLLECTION;
    private readonly RESUME_TOKEN_SAVE_INTERVAL_MS;
    private readonly RESUME_TOKEN_AUTO_HEAL_RETRY_THRESHOLD;
    private latencyBuffer;
    private _latencyFlushInProgress;
    private _latencyFlushPending;
    private readonly LATENCY_UPDATE_INTERVAL;
    private readonly LATENCY_UPDATE_THRESHOLD_MS;
    private readonly LATENCY_DEBUG_THRESHOLD_MS;
    private readonly PUBLICATION_DEBUG_THRESHOLD_MS;
    private _invalidationDebounceTimers;
    private _invalidationPendingTimestamps;
    private _pendingInvalidations;
    private readonly DEBOUNCE_DELAY;
    private readonly MAX_WAIT_TIME;
    private _publicationWorkerQueueLimit;
    constructor();
    static createPublicationRegistry(serverConfig?: any): SubscriptionManager;
    static create(wss: WebSocket.Server, serverConfig: any, monitorManagerFunction: MonitorManagerFunction): SubscriptionManager;
    private initializePublicationRegistry;
    private initialize;
    private registerCorePublications;
    private setCacheLimit;
    private configurePublicationWorkers;
    private parseBoolean;
    private clampNumber;
    invalidatePubsCache(collection: string, type: string, documentId?: any, document?: any): Promise<void>;
    private _executeInvalidation;
    private subscriptionReferencesCollection;
    private delay;
    private getMessageDateMs;
    private isStaleRouteMessage;
    private getPublicationWorkerDispatcher;
    private shouldUsePublicationWorkers;
    private runPublicationViaWorker;
    private runPublicationLocally;
    private runPublicationExecution;
    private sendDataToAllWithRetry;
    private sendDataToOneWithRetry;
    publications(method: SubscriptionModel): void;
    getPublication(publication: string): SubscriptionPubModel | undefined;
    getPublications(): SubscriptionModel;
    loggedInLatency(ws: WebSocket): void;
    private flushThrottledLatencyUpdates;
    subscribe(messageRoute: string, messageDate: Date, ws: WebSocket, messageId: number, publication: string, subscriptionData: any[]): Promise<void>;
    createLoggedInUser(id_ws: string): Promise<LoggedInUserModel>;
    unsubscribe(messageRoute: string, messageDate: Date, ws: WebSocket, messageId: number, publication: string, subscriptionData: any[]): void;
    unsubscribeAll(ws: WebSocket): Promise<void>;
    getActiveSubscriptions(): ActiveSubscriptionModel[];
    private getPublicationCollections;
    private getWatchedDatabases;
    private resolveOplogMode;
    private resolveLocalOplogResyncIntervalMs;
    private resolveResumeTokenMaxAgeMs;
    private resolveConnectDebug;
    private resolveSubSendDebug;
    private resolveSubSendLogEnabled;
    private resolveSubSendLogThresholdMs;
    private resolveSubSendLogBytes;
    private resolveSubSendLogSampleRate;
    private resolveAiSubscriptionDebug;
    private parseDebugFlag;
    private parsePositiveNumber;
    private parseSampleRate;
    private shouldLogSubSend;
    private logSubSend;
    private isAiPublication;
    private logAiSubSend;
    private logAiSubscriptionEvent;
    private connectDebug;
    private parsePositiveFloat;
    private isChangeStreamUnsupported;
    private isResumeTokenInvalid;
    private isChangeStreamDocumentTooLarge;
    private enableLocalOplogFallback;
    getUseLocalOplog(): boolean;
    handleMongoReconnect(reason: string): Promise<void>;
    notifyLocalOplog(collection: string, type?: string): void;
    private getResumeTokenDocId;
    private loadResumeToken;
    private saveResumeToken;
    private clearResumeToken;
    private queueResumeTokenSave;
    private queueFullResync;
    private fullResyncSubscriptions;
    private tailOpLog;
    private packCachePayload;
    private decodeCachePayload;
    private getCacheBuffer;
    private shouldCachePayload;
    private buffersEqual;
    private processSubscription;
    private sendDataToOne;
    private sendDataToAll;
    private ensureDependencyContainers;
    private updateSubscriptionDependencies;
    private normalizeDocumentId;
    private getDocumentIdQueryCandidates;
    private isFilterSafeForInMemory;
    private documentIdMatchesEvent;
    private resolveFilterMatch;
    private documentMatchesFilter;
    private shouldInvalidateSubscription;
    private shouldInvalidateSubscriptionForEvents;
    private getPaginationMeta;
    private sendWS;
    getEnableDebug(): boolean;
    private dependencyDebug;
    private summarizeEvents;
    private logDependencySnapshot;
    runPublicationOnce(publication: string, subscriptionData?: any[], options?: {
        userId?: string;
    }): Promise<{
        result: unknown;
        snapshot: DependencyContextSnapshot;
    }>;
}
