import { type InterruptJoinHost, type InterruptJoinOptions } from './InterruptJoin.ts'; /** Application-owned cleanup invoked on the first process interrupt. */ export type ServiceStop = () => Promise | void; /** * Blocks until the first process interrupt (SIGINT/SIGTERM via the host), * then awaits exactly one `stop()` under a shutdown deadline. * * Resolves once shutdown completes so the caller can drain to a clean exit. * Rejects if `stop()` fails so the failure surfaces through the normal exit-code * mapper (typically `software`, 70) rather than being reported as success. * Hosts with an exit capability retain escalation until cleanup settles; * a second interrupt exits 130 and a timeout exits 1. Minimal hosts preserve * early listener disposal, restoring their native second-signal behavior, * while timeout rejects the pending join without inventing a process exit. * A registration failure still attempts cleanup of the already-running * service under the same deadline. The default is 15 seconds; zero disables * the watchdog. Invalid options reject before registration or cleanup. * * Use this for long-running command handlers that start a server or actor and * should exit only when the operator interrupts the process. */ export declare function runServiceUntilInterrupt(host: InterruptJoinHost, stop: ServiceStop, options?: InterruptJoinOptions): Promise; //# sourceMappingURL=runServiceUntilInterrupt.d.ts.map