interface GuardEventTarget { addEventListener(type: string, listener: (event: unknown) => void): void; removeEventListener(type: string, listener: (event: unknown) => void): void; } interface GuardLogger { error(message: string, context?: Record): void; } export interface UnhandledRejectionGuardOptions { /** Defaults to the global process event target. */ target?: GuardEventTarget; /** Defaults to the server logger. */ logger?: GuardLogger; } export interface UnhandledRejectionGuardHandle { /** * True while this handle holds a lease on an active guard. False only when the * target cannot receive listeners at all. */ readonly installed: boolean; /** * Rejections contained on this target so far, across every holder. This is a * process-level metric: export it and alert on its rate. */ getRejectionCount(): number; /** * Release this handle's lease. The listener is removed once the last holder * releases it. Safe to call more than once. */ dispose(): void; } /** * Install the process-wide guard. * * Returns a handle whose `installed` is false when the target already has an * owner or cannot receive listeners. */ export declare function installUnhandledRejectionGuard(options?: UnhandledRejectionGuardOptions): UnhandledRejectionGuardHandle; export {}; //# sourceMappingURL=unhandled-rejection-guard.d.ts.map