/** Release resources and stop accepting work. May be async. */ export type ShutdownTask = () => void | Promise; export interface ProcessGuardOptions { /** Transport id, used as the log prefix so the line says WHICH bridge died. */ name: string; /** Runs once, on the first signal, before the process exits. */ onShutdown?: ShutdownTask; /** Test seam; production ends the process. */ exit?: (code: number) => void; /** How long a shutdown task may take before the process leaves anyway. * Defaults to `SHUTDOWN_GRACE_MS`; tests shorten it. */ graceMs?: number; } /** A shutdown task that hangs must not hold the terminal hostage. */ export declare const SHUTDOWN_GRACE_MS = 5000; export declare function installProcessGuards(opts: ProcessGuardOptions): void;