import { IValidationErrorDetail } from '@rocketmakers/validation/lib/ValidationErrors'; import { IArgumentError, IArgumentValidationError, IConfigurationError, IValidationError } from './coreResponses'; interface IErrorRegistration { appCode: string; status: number; toJson: (e: TError) => TData; fromJson: (d: TData) => TError; } export declare abstract class ApiErrorBase extends Error { appCode: TAppCode; developerMessage?: string | undefined; constructor(appCode: TAppCode, message: string, developerMessage?: string | undefined); } export declare class ApiError { static errors: IErrorRegistration[]; static registerCore(): void; static isApiError(testError: any): testError is ApiErrorBase; static register { appCode: string; developerMessage?: string; }>(_error: TErrorConstructor, status: number): { transit, "developerMessage" | "appCode">>(...keys: TKeys[]): { recreate(fromJson: (d: Pick, TKeys>) => InstanceType): ClassDecorator; }; }; static createApiError(data: any): any; } export declare const argumentAppCode: IArgumentError['kind']; export declare const argumentValidationAppCode: IArgumentValidationError['kind']; export declare const configurationAppCode: IConfigurationError['kind']; export declare const validationAppCode: IValidationError['kind']; export declare class ArgumentError extends ApiErrorBase { parameter: string; constructor(parameter: string, developerMessage?: string); } export declare class ArgumentValidationError extends ApiErrorBase { parameter: string; constructor(parameter: string, developerMessage?: string); } export declare class ValidationError extends ApiErrorBase { errors: IValidationErrorDetail[]; constructor(errors: IValidationErrorDetail[], developerMessage?: string); } export declare class ConfigurationError extends ApiErrorBase { constructor(message: string, developerMessage?: string); } export type ServerErrors = ApiErrorBase | TAppErrors; declare const UnknownServerErrorAppCode = "UnknownServerError"; export declare class UnknownServerError extends ApiErrorBase { data: any; constructor(data: any, developerMessage?: string); } export declare function getErrorResponse(error: any): { status: number; send: { appCode: TAppCode; [key: string]: any; }; developerMessage?: string; }; export {}; //# sourceMappingURL=apiErrors.d.ts.map