/** * Sends periodic keepalive heartbeats from a remote worker to the server to * extend the task visibility timeout while activity execution is in progress. * * Construct with a `sendHeartbeat` callback (typically the worker's WebSocket * send function) and an optional interval in milliseconds (default: 10 000). * Call `start()` when a task is acquired and `stop()` when it completes. * * @example * ```ts * import { HeartbeatManager } from '@lostgradient/weft'; * * let heartbeatFn = (details?: unknown) => { * console.log('heartbeat', details); * }; * * const manager = new HeartbeatManager(heartbeatFn, 5_000); * manager.start(); * // ... execute long-running activity ... * manager.beat({ progress: 0.5 }); // one-off heartbeat with details * manager.stop(); * ``` */ export declare class HeartbeatManager { #private; constructor(sendHeartbeat: (details?: unknown) => void, intervalMs?: number); /** Start sending periodic heartbeats. */ start(): void; /** Stop sending heartbeats. */ stop(): void; /** Send a one-off heartbeat with optional details. */ beat(details?: unknown): void; get isRunning(): boolean; }