import { HttpStatusCodes } from "../httpStatusCodes.js";
import { ResponseData } from "../responseData.js";
import { ErrorCodes } from "./errorCodes.js";
import { AppError } from "./ErrorsClass.js";
import { FastifyReply } from "fastify";
import { Response } from "express";
import { StrictModeLocaleMap } from "@intlayer/types/module_augmentation";

//#region src/utils/errors/ErrorHandler.d.ts
type ResponseLike = Response | FastifyReply;
/**
 * Handles generic error responses by formatting and sending a JSON response.
 * @param res - The response object provided by Express.js.
 * @param errorKey - A key representing the specific error.
 * @param statusCode - (Optional) A specific HTTP status code to use for the response.
 * @param isPaginatedResponse - Flag to determine if the response should be paginated.
 */
declare const handleGenericErrorResponse: (res: ResponseLike, errorKey: ErrorCodes, errorDetails?: object, statusCode?: HttpStatusCodes, isPaginatedResponse?: boolean) => void;
/**
 * Handles application-specific error responses by formatting and sending a JSON response.
 * @param res - The response object provided by Express.js.
 * @param error - The error object.
 * @param messageDetails - (Optional) Additional message details to include in the response.
 * @param isPaginatedResponse - (Optional) Flag to determine if the response should be paginated.
 */
declare const handleAppErrorResponse: (res: ResponseLike, error: AppError, messageDetails?: object, isPaginatedResponse?: boolean) => void;
/**
 * Handles more customizable error responses with detailed error messages and codes.
 * @param res - The response object.
 * @param errorKey - Error code key used to fetch the corresponding message and default status.
 * @param title - The localized error message object.
 * @param message - The localized error message object.
 * @param messageDetails - (Optional) Additional message details to include in the response.
 * @param statusCode - (Optional) HTTP status code, defaults to 500 if not specified.
 * @param isPaginatedResponse - Determines if the error should be part of a paginated response.
 */
declare const handleCustomErrorResponse: <T>(res: ResponseLike, errorKey: ErrorCodes | string, title: StrictModeLocaleMap<string> | string, message: StrictModeLocaleMap<string> | string, messageDetails?: object, statusCode?: HttpStatusCodes, isPaginatedResponse?: boolean) => void;
/**
 * Formats a generic error response without sending it (useful for Fastify plugins).
 * @param errorKey - A key representing the specific error.
 * @param errorDetails - Optional error details to include.
 * @param statusCode - Optional HTTP status code.
 * @returns Formatted error response object.
 */
declare const formatGenericErrorResponse: (errorKey: ErrorCodes, errorDetails?: object, statusCode?: HttpStatusCodes) => ResponseData<{
  [x: string]: any;
  [x: number]: any;
  [x: symbol]: any;
}>;
declare const ErrorHandler: {
  handleGenericErrorResponse: (res: ResponseLike, errorKey: ErrorCodes, errorDetails?: object, statusCode?: HttpStatusCodes, isPaginatedResponse?: boolean) => void;
  handleAppErrorResponse: (res: ResponseLike, error: AppError, messageDetails?: object, isPaginatedResponse?: boolean) => void;
  handleCustomErrorResponse: <T>(res: ResponseLike, errorKey: ErrorCodes | string, title: StrictModeLocaleMap<string> | string, message: StrictModeLocaleMap<string> | string, messageDetails?: object, statusCode?: HttpStatusCodes, isPaginatedResponse?: boolean) => void;
  formatGenericErrorResponse: (errorKey: ErrorCodes, errorDetails?: object, statusCode?: HttpStatusCodes) => ResponseData<{
    [x: string]: any;
    [x: number]: any;
    [x: symbol]: any;
  }>;
};
//#endregion
export { ErrorHandler, formatGenericErrorResponse, handleAppErrorResponse, handleCustomErrorResponse, handleGenericErrorResponse };
//# sourceMappingURL=ErrorHandler.d.ts.map