import type { Request, Response } from 'express'; type ErrorConstructor = new (...args: never[]) => Error; /** * Minimal application surface used by {@link ExceptionHandler} to resolve `config` and `log` * without importing optional packages (avoids circular dependencies). */ export interface ExceptionHandlerApp { make(abstractKey: string): TValue; } /** * Centralized HTTP exception reporting and rendering. */ export declare class ExceptionHandler { protected readonly app: ExceptionHandlerApp; /** * Exception classes that should NOT be reported to logs. */ protected dontReport: ErrorConstructor[]; /** * Request input keys that must never appear in error context/logs. */ protected dontFlash: string[]; private readonly reportableCallbacks; private readonly renderableCallbacks; private readonly reportedErrors; private deduplicateReports; private readonly ignoredExceptions; constructor(app: ExceptionHandlerApp); /** * Optional setup hook for subclasses (custom reporters, renderers, dedup). */ register(): Promise; /** * Register a custom reporter for a specific exception class. */ reportable(exceptionClass: new (...args: never[]) => T, callback: (error: T) => void | Promise): this; /** * Register a custom renderer for a specific exception class (last registration wins). */ renderable(exceptionClass: new (...args: never[]) => T, callback: (error: T, req: Request, res: Response) => Response | void | Promise): this; /** * Prevent duplicate reporting of the same exception within a request lifecycle. */ withoutDuplicates(): this; /** * Ignore an exception class for reporting (and treat as non-reportable). */ ignore(exceptionClass: ErrorConstructor): this; /** * Clears deduplication state after a request (call from global error middleware). */ clearReportDedup(): void; /** * Report an exception to the logging system (never throws). */ report(error: Error, req?: Request): Promise; /** * Render an exception into an HTTP response (never throws). */ render(error: Error, req: Request, res: Response): Promise; /** * Render an exception for CLI / console output. */ renderForConsole(error: Error): void; protected shouldReport(error: Error): boolean; protected buildContext(error: Error, req?: Request): Record; private getErrorHash; private isIgnored; private matchesDontReport; private isDebug; private defaultLog; private sendValidationException; private sendStandardJson; private sendHttpException; private sendDebugError; } export {}; //# sourceMappingURL=Handler.d.ts.map