import { AxiosResponse, AxiosError } from 'axios';

declare class AxiosExceptionHandler<T> {
    response: AxiosResponse<T> | AxiosError<T> | Error | unknown;
    exceptions: Map<number, string>;
    unHandledMessage: string;
    /**
     * @param response AxiosResponse
     */
    constructor(response: AxiosResponse<T> | AxiosError<T> | Error | unknown);
    /**
     * Add a case
     * @param code HTTP Status Code to handle
     * @param message Error message to throw
     */
    addCase(code: number, message: string): this;
    /**
     * Add multiple cases
     * @param {Number[]} codes HTTP Status Codes to handle
     * @param {String} message Error message to throw
     */
    addCases(codes: number[], message: string): this;
    /**
     * Add a default case
     * @param message Error message to throw
     * @default "Unhandled exception"
     */
    addDefaultCase(message: string): this;
    /**
     * Handle the exception
     * @returns AxiosResponse<T>
     */
    handle(): AxiosResponse<T>;
}
declare function ExceptionHandler<T>(response: AxiosResponse<T> | AxiosError<T> | Error | unknown): AxiosExceptionHandler<T>;

export { ExceptionHandler, ExceptionHandler as default };
