/** * Reconnection manager with exponential backoff and jitter. * Handles scheduling reconnection attempts with configurable delays. */ export declare class ReconnectManager { private readonly reconnectTimer; private reconnectAttempts; private shouldReconnect; private authFailureMode; private readonly onReconnect; private readonly isShuttingDown; constructor(options: { onReconnect: () => void; isShuttingDown: () => boolean; }); /** * Calculate reconnection delay with exponential backoff and jitter. * In auth-failure mode the cap is MAX_AUTH_RECONNECT_DELAY (5 minutes) * instead of MAX_RECONNECT_DELAY: hammering a server that is rejecting * our credentials only refreshes IP quarantines (INC-2026-06-12-01). */ getReconnectDelay(): number; /** * Schedule a reconnection attempt. * * @param options.authFailure - The previous connection was closed by the * server with an auth-rejection code (4000-4099). Counts as a failed * attempt and raises the backoff cap to MAX_AUTH_RECONNECT_DELAY. */ schedule(options?: { authFailure?: boolean; }): void; /** * Reset reconnection attempts and leave auth-failure mode. * * Must only be called once a connection has proven itself healthy * (server ack received AND open beyond HEALTHY_CONNECTION_THRESHOLD) * or after an authenticated API call succeeded with fresh credentials. * Never call this merely because a socket emitted 'open' - the server * can still reject it with 4001 right after the handshake. */ resetAttempts(): void; /** * Force an immediate reconnection. * Resets attempts for faster retry. */ forceReconnect(): void; /** * Get current attempt count. */ getAttemptCount(): number; /** * Enable reconnection. */ enable(): void; /** * Disable reconnection and cancel any pending timer. */ disable(): void; /** * Check if reconnection is enabled. */ isEnabled(): boolean; /** * Cancel any pending reconnection timer. */ cancel(): void; /** * Clean up all resources. */ cleanup(): void; /** * Whether the manager is currently applying the auth-failure backoff cap. */ isInAuthFailureMode(): boolean; } //# sourceMappingURL=reconnect.d.ts.map