Houjie
2025-07-24 1bc8f80935add7215fa98de1ab8b375b222a2046
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
interface ErrorOptions {
    cause?: unknown;
}
export declare class CustomError extends Error {
    name: string;
    constructor(message?: string, options?: ErrorOptions);
}
export {};
export interface CustomErrorInterface extends Error {
}
export interface CustomErrorProperties {
    [property: string]: any;
}
export interface CustomErrorConstructor<Properties extends CustomErrorProperties> extends ErrorConstructor {
    readonly prototype: CustomErrorInterface;
    new (...args: any[]): CustomErrorInterface & Properties;
    (...args: any[]): CustomErrorInterface & Properties;
}
export declare type GenericErrorConstructor = ErrorConstructor | EvalErrorConstructor | RangeErrorConstructor | ReferenceErrorConstructor | SyntaxErrorConstructor | TypeErrorConstructor | URIErrorConstructor | CustomErrorConstructor<CustomErrorProperties>;
declare type CustomErrorFunction<Properties> = (this: Properties, ...args: any[]) => void;
export declare function customErrorFactory<Properties extends CustomErrorProperties>(fn: CustomErrorFunction<Properties>, parent?: GenericErrorConstructor): CustomErrorConstructor<Properties>;
export {};