export interface KeepAliveOptions { every: number; pongDeadline: number; } export declare const DEFAULT_KEEP_ALIVE: KeepAliveOptions; /** Minimal peer surface the watchdog needs (both satisfied by ws.WebSocket). */ export interface KeepAlivePeer { ping(): void; terminate(): void; on(event: 'pong', listener: () => void): unknown; } export interface KaTimers { setInterval(fn: () => void, ms: number): unknown; clearInterval(handle: unknown): void; setTimeout(fn: () => void, ms: number): unknown; clearTimeout(handle: unknown): void; } export declare class KeepAliveWatchdog { private readonly opts; private readonly timers; pingsSent: number; terminated: boolean; private interval; private deadline; private awaitingPong; constructor(opts: KeepAliveOptions, timers?: KaTimers); start(peer: KeepAlivePeer): void; stop(): void; private tick; }