1 | export interface ApplicationError<C extends number, D> extends Error {
|
2 | readonly code: C;
|
3 | readonly data: D;
|
4 | toJson(): ApplicationError.Literal<D>;
|
5 | }
|
6 | export declare namespace ApplicationError {
|
7 | interface Literal<D> {
|
8 | message: string;
|
9 | data: D;
|
10 | stack?: string;
|
11 | }
|
12 | interface Constructor<C extends number, D> {
|
13 | (...args: any[]): ApplicationError<C, D>;
|
14 | code: C;
|
15 | is(arg: object | undefined): arg is ApplicationError<C, D>;
|
16 | }
|
17 | function declare<C extends number, D>(code: C, factory: (...args: any[]) => Literal<D>): Constructor<C, D>;
|
18 | function is<C extends number, D>(arg: object | undefined): arg is ApplicationError<C, D>;
|
19 | function fromJson<C extends number, D>(code: C, raw: Literal<D>): ApplicationError<C, D>;
|
20 | }
|
21 |
|
\ | No newline at end of file |