export type GeneralErrorCodes = "DATA_VALIDATION_ERROR" | "NETWORK_ERROR" | "CANCELED_ERROR" | "INTERNAL_ERROR" | "UNKNOWN_ERROR";
export declare class ApplicationException<CodeT> extends Error {
    code: CodeT;
    serverMessage: string | null;
    constructor(message: string, code: CodeT, serverMessage: string | null);
}
export interface ErrorEntry<CodeT> {
    code: CodeT;
    condition: (error: unknown) => boolean;
    getMessage: (error: unknown) => string;
}
export interface ErrorHandlerOptions<CodeT extends string> {
    entries: ErrorEntry<CodeT>[];
    onRethrowError?: (error: unknown, exception: ApplicationException<CodeT | GeneralErrorCodes>) => void;
}
export declare class ErrorHandler<CodeT extends string> {
    entries: ErrorEntry<CodeT | GeneralErrorCodes>[];
    private onRethrowError?;
    constructor({ entries, onRethrowError }: ErrorHandlerOptions<CodeT>);
    rethrowError(error: unknown): ApplicationException<CodeT | GeneralErrorCodes>;
    getError(error: unknown): ApplicationException<CodeT | GeneralErrorCodes> | null;
    getErrorCode(error: unknown): CodeT | GeneralErrorCodes | null;
    static getErrorMessage(error: unknown, fallbackToUnknown?: boolean): string | null;
}
export declare const SharedErrorHandler: ErrorHandler<never>;
