import type { DaemonLogger } from './logging.js'; export declare const SHUTDOWN_COMPONENT_TIMEOUT_MS = 5000; export declare const SHUTDOWN_DRAIN_TIMEOUT_MS = 5000; type Stoppable = { stop(): void | Promise; }; type Closable = { close(): void | Promise; }; export type GatewayShutdownDependencies = { logger: DaemonLogger; stopAccepting?: Stoppable; stopControl?: Closable; stopTimers?: Stoppable; drainCoordinator?: () => Promise; stopPi?: () => Promise; closeDatabase?: () => void; releaseLock?: () => void; /** Test seam and fixed upper bound for every asynchronous cleanup component. */ componentTimeoutMs?: number; drainTimeoutMs?: number; /** Must exceed PiRpcSession's complete stdin/TERM/KILL escalation window. */ piTimeoutMs?: number; setTimeout?: typeof setTimeout; clearTimeout?: typeof clearTimeout; }; /** Idempotent ordered shutdown; cleanup always reaches database and lock release. */ export declare class GatewayLifecycle { private readonly dependencies; private shutdownPromise; constructor(dependencies: GatewayShutdownDependencies); shutdown(reason?: string): Promise; private component; private performShutdown; } export {};