/** * Base exception class that extends the native Error class. * Provides a foundation for all custom exceptions with additional metadata * like error codes, status codes, and help descriptions. */ export declare class BaseException extends Error { /** * Define the error metadata as static properties to avoid * setting them repeatedly on the error instance */ static help?: string; static code?: string; static status?: number; static message?: string; /** * Name of the class that raised the exception. */ name: string; /** * Optional help description for the error. You can use it to define additional * human readable information for the error. */ help?: string; /** * A machine readable error code. This will allow the error handling logic * to narrow down exceptions based upon the error code. */ code?: string; /** * A status code for the error. Usually helpful when converting errors * to HTTP responses. */ status: number; /** * Creates a new BaseException instance. * * @param message - The error message. If not provided, uses the static message from the constructor. * @param options - Additional options including error cause, code, and status. */ constructor(message?: string, options?: ErrorOptions_2 & { code?: string; status?: number; }); /** * Returns the constructor name for the Symbol.toStringTag property. * * @returns The name of the exception class. */ get [Symbol.toStringTag](): string; /** * Returns a string representation of the exception. * Includes the error code in brackets if available. * * @returns A formatted string representation of the exception. */ toString(): string; } /** * Exception thrown when a circular reference is detected during encoding. * Circular references cannot be encoded and must be avoided. */ export declare class E_CIRCULAR_REFERENCE extends BaseException { static status: number; static code: string; /** * Creates a new E_CIRCULAR_REFERENCE exception. */ constructor(); } /** * Exception thrown when encoding fails due to an underlying error. * This wraps the original error as the cause for better error tracing. */ export declare class E_ENCODING_FAILED extends BaseException { static status: number; static code: string; /** * Creates a new E_ENCODING_FAILED exception. * * @param value - The value that failed to encode. * @param cause - The underlying error that caused the encoding to fail. */ constructor(value: unknown, cause: unknown); } /** * Exception thrown when attempting to decode data encoded with an incompatible version. * This typically occurs when the encoded data is from a newer version than the decoder supports. */ export declare class E_INCOMPATIBLE_VERSION extends BaseException { static status: number; static code: string; static help: string; /** * Creates a new E_INCOMPATIBLE_VERSION exception. * * @param version - The incompatible version string from the encoded data. */ constructor(version: string); } /** * Exception thrown when an invalid version string is encountered. */ export declare class E_INVALID_VERSION extends BaseException { static status: number; static code: string; /** * Creates a new E_INVALID_VERSION exception. * * @param version - The invalid version string. */ constructor(version: string); } /** * Exception thrown when attempting to decode a value that is not a valid encoded value. * This indicates the input string is not in the expected encoded format. */ export declare class E_NOT_AN_ENCODED_VALUE extends BaseException { static status: number; static code: string; /** * Creates a new E_NOT_AN_ENCODED_VALUE exception. * * @param value - The string value that is not a valid encoded value. */ constructor(value: string); } /** * Exception thrown when a value with an unknown or unsupported type cannot be decoded. */ export declare class E_UNDECODABLE_VALUE extends BaseException { static status: number; static code: string; /** * Creates a new E_UNDECODABLE_VALUE exception. * * @param type - The type string that could not be decoded. */ constructor(type: string); } /** * Exception thrown when a value cannot be encoded. * This indicates that the value type is not supported by the encoder. */ export declare class E_UNENCODABLE_VALUE extends BaseException { static status: number; static code: string; /** * Creates a new E_UNENCODABLE_VALUE exception. * * @param value - The value that could not be encoded. */ constructor(value: unknown); } declare interface ErrorOptions_2 { cause?: unknown; } export { }