/** Minimal sink so tests can capture without touching the real logger. */ export interface RejectionLogSink { error(msg: string): void; } /** * Render a rejection reason for the log. * * Prefers the stack: without it an `unhandledRejection` report is close to * useless, because the throw site is exactly what the caller failed to observe. * Non-Error reasons (a rejected string, a plain object) still have to produce * something readable, since `String({})` alone would log "[object Object]". */ export declare function formatRejectionReason(reason: unknown): string; /** * The handler body, exported so a test can drive it directly instead of * emitting a real process-level event (which would leak across test files). * * Returns whether the rejection was logged; a broken-pipe-class reason is * dropped for the same reason stdio-epipe-guard drops it, and reporting that * would just add noise on every detached pm2 log stream. */ export declare function handleDaemonUnhandledRejection(reason: unknown, sink: RejectionLogSink): boolean; /** * Install the daemon-side guard. Idempotent, so multiple entry points may call * it. Returns true if it installed on this call. * * `target` is parameterized only so unit tests can inject a fake emitter rather * than registering a listener on the real process for the whole test run. */ export declare function installDaemonRejectionGuard(sink: RejectionLogSink, target?: { on(event: 'unhandledRejection', cb: (reason: unknown) => void): unknown; }): boolean; /** Test-only reset of the idempotency latch. */ export declare function resetDaemonRejectionGuardForTest(): void; //# sourceMappingURL=daemon-rejection-guard.d.ts.map