/**
 * True when an uncaught exception is a known isolated/recoverable error that the
 * server should log-and-continue on, rather than crash. Matches on the error
 * message (substring). Returns false for anything unrecognized (→ crash, the
 * safe default).
 */
export declare function isNonFatalUncaught(err: unknown): boolean;
export declare function shouldLogStackForUncaught(err: unknown): boolean;
/** Test-only: reset the dedup memory so each test starts from a clean slate. */
export declare function __resetUncaughtStackDedupeForTests(): void;
/**
 * The single crash-vs-continue decision shared by BOTH process-level handlers
 * (`uncaughtException` and `unhandledRejection`). Extracting it into one function
 * is what guarantees the two handlers cannot drift to divergent policies — there
 * is exactly one allowlist, one default-crash posture, one dedup'd log path.
 *
 * Behavior:
 * - A non-fatal match (`isNonFatalUncaught`) → `console.warn` (with the first-seen
 *   stack attached once per distinct origin) and returns `'recovered'`. The server
 *   stays up.
 * - Anything else → `console.error`, run `opts.onFatalCleanup()` (best-effort —
 *   wrapped so a cleanup failure can't mask the original error), then exit(1) and
 *   return `'fatal'`. This is the fail-toward-crash default: an unknown error
 *   crashes, and net #2 respawns a clean process in ~10s.
 *
 * Cleanup and exit are INJECTED callbacks (server.ts passes `closeAllSqlite` and
 * the real `process.exit`) so this module stays pure decision-logic — it does NOT
 * import the SQLite registry, and the unit test injects fakes to assert the fatal
 * path triggers cleanup + exit under BOTH labels without actually exiting.
 *
 * The `exit` callback is typed `(code) => never`, but the function still has a
 * trailing `return 'fatal'`: with the real `process.exit` that line is
 * unreachable; with an injected test fake that returns, the assertion can observe
 * the verdict. This is the standard injectable-exit test pattern.
 */
export declare function handleProcessLevelError(err: unknown, label: 'uncaughtException' | 'unhandledRejection', opts: {
    onFatalCleanup: () => void;
    exit?: (code: number) => never;
}): 'recovered' | 'fatal';
//# sourceMappingURL=uncaughtExceptionPolicy.d.ts.map