/**
 * Error Sanitizer
 *
 * Removes sensitive information from errors before returning to clients.
 * Prevents leaking internal details like file paths, stack traces,
 * database schema, and internal service names.
 *
 * @packageDocumentation
 */
/**
 * Sanitized error safe to return to clients
 */
export interface SanitizedError {
    /** Error code for client handling */
    code: string;
    /** User-friendly error message (no internal details) */
    message: string;
    /** Request ID for correlation with server logs */
    requestId: string;
}
/**
 * Sanitize an error message by removing sensitive information
 *
 * @param message - The error message to sanitize
 * @returns Sanitized message safe for client consumption
 */
export declare function sanitizeErrorMessage(message: string): string;
/**
 * Sanitize an error for safe client consumption
 *
 * Full error details are logged server-side for debugging.
 * Only sanitized, generic information is returned for clients.
 *
 * @param error - The error to sanitize
 * @param requestId - Optional request ID for correlation (generated if not provided)
 * @returns Sanitized error safe to return to clients
 */
export declare function sanitizeError(error: Error, requestId?: string): SanitizedError;
/**
 * Generate a unique request ID for error correlation
 */
export declare function generateRequestId(): string;
/**
 * Create an error response object for HTTP responses
 *
 * @param error - The error to convert
 * @param requestId - Request ID for correlation
 * @param statusCode - HTTP status code (determined from error if not provided)
 * @returns Error response object
 */
export declare function createErrorResponse(error: Error, requestId?: string, statusCode?: number): {
    statusCode: number;
    body: SanitizedError;
};
/**
 * Wrap an async function with error sanitization
 *
 * @param fn - The async function to wrap
 * @param requestId - Request ID for error correlation
 * @returns Wrapped function that sanitizes errors
 */
export declare function withErrorSanitization<T extends (...args: unknown[]) => Promise<unknown>>(fn: T, requestId?: string): (...args: Parameters<T>) => Promise<ReturnType<T> | SanitizedError>;
/**
 * Check if an object is a SanitizedError
 */
export declare function isSanitizedError(obj: unknown): obj is SanitizedError;
//# sourceMappingURL=error-sanitizer.d.ts.map