import { ConnectionState, ConnectionGap, ConnectionMetadata, ReconnectionConfig, ContextHealth } from "./types.js"; export declare const DEFAULT_RECONNECTION_CONFIG: ReconnectionConfig; export declare const MIN_STABLE_CONNECTION_MS = 5000; export declare function initConnectionState(appKey: string): ConnectionState; export declare function updateConnectionState(appKey: string, updates: Partial): void; export declare function getConnectionState(appKey: string): ConnectionState | null; export declare function getAllConnectionStates(): Map; export declare function recordConnectionGap(appKey: string, reason: string): void; export declare function closeConnectionGap(appKey: string): void; export declare function getRecentGaps(maxAgeMs: number): ConnectionGap[]; export declare function hasRecentDisconnect(appKey: string, withinMs: number): boolean; export declare function saveConnectionMetadata(appKey: string, metadata: ConnectionMetadata): void; export declare function getConnectionMetadata(appKey: string): ConnectionMetadata | null; export declare function clearConnectionMetadata(appKey: string): void; export declare function getAllConnectionMetadata(): Map; export declare function saveReconnectionTimer(appKey: string, timer: NodeJS.Timeout): void; export declare function getAndClearReconnectionTimer(appKey: string): NodeJS.Timeout | null; export declare function shouldTerminateForMissedPong(args: { pongReceived: boolean; lastCdpMessageAt: Date | null; now: number; quietWindowMs: number; }): boolean; export declare function pendingReconnectionKeys(): string[]; export declare function cancelReconnectionTimer(appKey: string): void; export declare function cancelAllReconnectionTimers(): void; export declare function clearAllConnectionState(): void; export declare function calculateBackoffDelay(attempt: number, config?: ReconnectionConfig): number; export declare function formatDuration(ms: number): string; export declare function initContextHealth(appKey: string): ContextHealth; export declare function getContextHealth(appKey: string): ContextHealth | null; export declare function updateContextHealth(appKey: string, updates: Partial): void; export declare function markContextStale(appKey: string): void; export declare function markContextHealthy(appKey: string, contextId: number): void; export declare function clearContextHealth(appKey: string): void; export declare function getAllContextHealth(): Map; export type ConnectionEventType = "connect-start" | "connect-success" | "connect-rejected" | "stale-target" | "liveness-failed" | "closed" | "reconnect-scheduled" | "reconnect-attempt" | "reconnect-success" | "reconnect-failed" | "max-attempts-reached" | "reconnect-suppressed" | "metro-down"; export interface ConnectionEvent { timestamp: Date; appKey: string; deviceTitle?: string; type: ConnectionEventType; detail?: string; } export declare function recordConnectionEvent(type: ConnectionEventType, appKey: string, deviceTitle?: string, detail?: string): void; export declare function getConnectionEvents(filter?: { appKey?: string; last?: number; }): ConnectionEvent[]; export declare function clearConnectionEvents(): number; //# sourceMappingURL=connectionState.d.ts.map