/**
 * WatchdogHeartbeat — periodic liveness signal for external supervisors.
 *
 * Story 6.6 — OpenLife v1.2 Royal Stack.
 *
 * The daemon emits a heartbeat file every `intervalMs` so an external
 * supervisor (systemd `WatchdogSec=`, supervisord `eventlistener`, k8s
 * livenessProbe via a file mtime check) can detect hangs even when the
 * HTTP `/health` endpoint becomes unresponsive (e.g. event-loop block).
 *
 * Format: `.openlife/heartbeat.json` with `{ pid, host, ts, uptime_s,
 * startedAt }`. ts is updated atomically each tick so a torn read is
 * impossible.
 */
export interface HeartbeatRecord {
    pid: number;
    host: string;
    ts: number;
    uptime_s: number;
    startedAt: number;
    version?: string;
}
export interface WatchdogHeartbeatOptions {
    /** Override the file path. Default: <stateDir>/heartbeat.json */
    filePath?: string;
    /** Override the emission cadence. Default: 30_000 ms (30s). */
    intervalMs?: number;
    /** Optional version label (typically package.json#version). */
    version?: string;
    /**
     * Optional callback fired AFTER each successful tick. Errors thrown by the
     * callback are caught and logged so they cannot poison the heartbeat loop.
     * Used by v1.11.0 GatewayManifest.refresh() to ride the same 30s cadence
     * without spawning a parallel timer.
     */
    onTick?: (rec: HeartbeatRecord) => void;
}
export declare class WatchdogHeartbeat {
    private readonly filePath;
    private readonly intervalMs;
    private readonly startedAt;
    private readonly version?;
    private readonly onTick?;
    private timer;
    constructor(opts?: WatchdogHeartbeatOptions);
    /**
     * Emit one heartbeat immediately and schedule periodic re-emission.
     * Idempotent: calling start() while already running is a no-op.
     */
    start(): void;
    private fireTick;
    /**
     * Stop emitting heartbeats. Idempotent. Does not delete the heartbeat
     * file (so post-shutdown the supervisor still sees the last known
     * good ts; staleness is the supervisor's signal that we are down).
     */
    stop(): void;
    /**
     * Force-emit one heartbeat now (used by tests and graceful shutdown).
     */
    emit(): HeartbeatRecord;
    /** Exposed for tests. */
    _filePath(): string;
}
