/** * @file `onExit` — register a callback for process exit / signal. Triggers * `load()` on first call. Returns a remover that unregisters the callback and * calls `unload()` once both `exit` and `afterexit` listener lists empty * out. */ import type { OnExitOptions } from './types.js'; /** * Register a callback to run on process exit or signal. * * @example * ```typescript * const remove = onExit((code, signal) => { * console.log(`Exiting with code ${code}, signal ${signal}`) * }) * // Later, to unregister: * remove() * ``` */ export declare function onExit(cb: (code: number | null, signal: string | null) => void, options?: OnExitOptions | undefined): () => void;