export interface ExceptionSchema {
    name: string;
    message: string;
    status?: number;
    code?: string;
    help?: string;
    stack?: string;
    [key: string]: string | number | undefined;
}
/**
 * Create a custom error class with the ability to define the error
 * code, status, and the help text.
 *
 * ```js
 * export class FileNotFoundException extends Exception {
 *   static status = 500
 *   static code = 'E_FILE_NOT_FOUND'
 * }
 *
 * throw new FileNotFoundException(
 *  `Unable to find file from ${filePath} location`
 * )
 * ```
 */
export declare class Exception 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;
    /**
     * Create a new exception instance.
     * It tries to extract the error code and status from the
     * `init` object. If not found, it uses the default message.
     * @param init - An object containing error details
     * @param defaultMessage - A default message to use if `init.message` is not provided
     * @returns An instance of the Exception class
     * @example
     * ```js
     * const error = Exception.fromApiError({
     *   code: 'E_FILE_NOT_FOUND',
     *   status: 404,
     *   message: 'File not found',
     *   help: 'Please check the file path and try again'
     * }, 'An error occurred while processing your request')
     * ```
     */
    static fromRawException(init: object, defaultMessage: string): Exception;
    constructor(message?: string, options?: ErrorOptions & {
        code?: string;
        status?: number;
        help?: string;
    });
    setHelp(help: string): this;
    setCode(code: string): this;
    setStatus(status: number): this;
    get [Symbol.toStringTag](): string;
    toString(): string;
    toJSON(): ExceptionSchema;
}
//# sourceMappingURL=exception.d.ts.map