export declare const SIGNAL_EXIT_CODES: () => Record; export declare const DEFAULT_FATAL_EXIT_CODE = 1; export type SignalName = 'SIGINT' | 'SIGTERM' | 'SIGQUIT'; export type FatalKind = 'uncaughtException' | 'unhandledRejection'; export type CloseReason = { kind: 'signal'; signal: SignalName; } | { kind: 'fatal'; fatal: FatalKind; } | { kind: 'exit'; }; export type ExitHandlerOptions = { onExit?: (code: number, reason: CloseReason) => void; onError?: (err: unknown, kind: FatalKind) => void; exitOnFatal?: boolean; exitOnSignal?: boolean; fatalExitCode?: number; }; /** * * @param options - Options for the exit handler * @param options.onExit - Callback to be called when the process exits * @param options.onError - Callback to be called when an error occurs * @param options.exitOnFatal - Whether to exit the process on fatal errors * @param options.exitOnSignal - Whether to exit the process on signals * @param options.fatalExitCode - The exit code to use for fatal errors * @returns A function to unsubscribe from the exit handlers */ export declare function subscribeProcessExit(options?: ExitHandlerOptions): () => void;