/** * Install (or replace) the heartbeat config. Pass `null` to stop * the heartbeat loop. Safe to call multiple times — the previous * timer is cleared before the new one starts. */ export declare function setHeartbeatConfig(cfg: HeartbeatConfig | null): void; /** Read the current config — useful for tests. */ export declare function getHeartbeatConfig(): Readonly | null; /** * Manually fire a single heartbeat tick. Exposed for tests; in * production it's invoked by the internal interval. */ export declare function runOneTick(): void; /** * Called from the server's pong handler (or message handler when * fallback `__stacks_ping__` text frames are in use). Resets the * missed-pong counter for the given socket so it doesn't get * declared dead. */ export declare function markPong(socket: object): void; export declare interface HeartbeatConfig { intervalMs?: number maxMissedPongs?: number onDead?: (socket: unknown) => void } declare interface HeartbeatState { intervalMs: number maxMissedPongs: number onDead: (socket: unknown) => void missed: WeakMap timer: ReturnType | null }