export interface ErrorDefinition { name: string; message: string | ((...args: any[]) => string); } export type ErrorCodesMap = Record; export interface QvacErrorOptions { code?: number | undefined; adds?: any[] | string | undefined; cause?: Error | undefined; } export interface SerializedError { name: string; code: number; message: string; stack?: string | undefined; cause?: Error | undefined; } export interface PackageInfo { name: string; version: string; } declare const ERR_CODES: Readonly<{ readonly UNKNOWN_ERROR_CODE: 0; readonly INVALID_CODE_DEFINITION: 1; readonly ERROR_CODE_ALREADY_EXISTS: 2; readonly MISSING_ERROR_DEFINITION: 3; readonly PACKAGE_VERSION_CONFLICT: 4; readonly INVALID_PACKAGE_INFO: 5; }>; export declare class QvacErrorBase extends Error { code: number; name: string; cause: Error | undefined; constructor(options?: QvacErrorOptions); toJSON(): SerializedError; } export declare function addCodes(codes: ErrorCodesMap, packageInfo?: PackageInfo): void; export declare function getRegisteredCodes(): ErrorCodesMap; export declare function isCodeRegistered(code: number): boolean; export { ERR_CODES as INTERNAL_ERROR_CODES }; export default QvacErrorBase;