@devp0nt/error0 1.0.0-next.41 → 1.0.0-next.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +77 -73
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +109 -100
- package/dist/esm/index.d.ts +109 -100
- package/dist/esm/index.js +76 -72
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.test.ts +68 -36
- package/src/index.ts +258 -239
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,44 +1,52 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
1
|
+
type IsUnknown<T> = unknown extends T ? ([T] extends [unknown] ? true : false) : false;
|
|
2
|
+
type NormalizeUnknownToUndefined<T> = IsUnknown<T> extends true ? undefined : T;
|
|
3
|
+
type IsOnlyUndefined<T> = [Exclude<T, undefined>] extends [never] ? true : false;
|
|
4
|
+
type InferFirstArg<TFn> = TFn extends (...args: infer TArgs) => unknown ? TArgs extends [infer TFirst, ...unknown[]] ? TFirst : undefined : undefined;
|
|
5
|
+
type InferPluginPropInput<TProp extends ErrorPluginPropOptions<any, any, any>> = NormalizeUnknownToUndefined<InferFirstArg<TProp['init']>>;
|
|
6
|
+
type ErrorPluginPropInit<TInputValue, TOutputValue> = ((input: TInputValue) => TOutputValue) | (() => TOutputValue);
|
|
7
|
+
type ErrorPluginPropSerialize<TOutputValue, TError extends Error0> = ((options: {
|
|
8
|
+
value: TOutputValue;
|
|
9
|
+
error: TError;
|
|
10
|
+
isPublic: boolean;
|
|
11
|
+
}) => unknown) | false;
|
|
12
|
+
type ErrorPluginPropDeserialize<TOutputValue> = ((options: {
|
|
13
|
+
value: unknown;
|
|
14
|
+
serialized: Record<string, unknown>;
|
|
15
|
+
}) => TOutputValue | undefined) | false;
|
|
16
|
+
type ErrorPluginPropOptions<TInputValue, TOutputValue, TError extends Error0 = Error0> = {
|
|
17
|
+
init: ErrorPluginPropInit<TInputValue, TOutputValue>;
|
|
3
18
|
resolve: (options: {
|
|
4
19
|
value: TOutputValue | undefined;
|
|
5
20
|
flow: Array<TOutputValue | undefined>;
|
|
6
21
|
error: TError;
|
|
7
22
|
}) => TOutputValue | undefined;
|
|
8
|
-
serialize:
|
|
9
|
-
|
|
10
|
-
error: TError;
|
|
11
|
-
isPublic: boolean;
|
|
12
|
-
}) => unknown;
|
|
13
|
-
deserialize: (options: {
|
|
14
|
-
value: unknown;
|
|
15
|
-
serialized: Record<string, unknown>;
|
|
16
|
-
}) => TOutputValue | undefined;
|
|
23
|
+
serialize: ErrorPluginPropSerialize<TOutputValue, TError>;
|
|
24
|
+
deserialize: ErrorPluginPropDeserialize<TOutputValue>;
|
|
17
25
|
};
|
|
18
|
-
type
|
|
19
|
-
type
|
|
20
|
-
type
|
|
26
|
+
type ErrorPluginMethodFn<TOutputValue, TArgs extends unknown[] = unknown[], TError extends Error0 = Error0> = (error: TError, ...args: TArgs) => TOutputValue;
|
|
27
|
+
type ErrorPluginAdaptResult<TOutputProps extends Record<string, unknown>> = Partial<TOutputProps> | undefined;
|
|
28
|
+
type ErrorPluginAdaptFn<TError extends Error0 = Error0, TOutputProps extends Record<string, unknown> = Record<never, never>> = ((error: TError) => void) | ((error: TError) => ErrorPluginAdaptResult<TOutputProps>);
|
|
21
29
|
type ErrorMethodRecord = {
|
|
22
30
|
args: unknown[];
|
|
23
31
|
output: unknown;
|
|
24
32
|
};
|
|
25
|
-
type
|
|
26
|
-
[key: string]:
|
|
33
|
+
type ErrorPluginProps = {
|
|
34
|
+
[key: string]: ErrorPluginPropOptions<any, any>;
|
|
27
35
|
};
|
|
28
|
-
type
|
|
29
|
-
[key: string]:
|
|
36
|
+
type ErrorPluginMethods = {
|
|
37
|
+
[key: string]: ErrorPluginMethodFn<any, any[]>;
|
|
30
38
|
};
|
|
31
|
-
type
|
|
39
|
+
type ErrorPlugin<TProps extends ErrorPluginProps = Record<never, never>, TMethods extends ErrorPluginMethods = Record<never, never>> = {
|
|
32
40
|
props?: TProps;
|
|
33
41
|
methods?: TMethods;
|
|
34
|
-
|
|
42
|
+
adapt?: Array<ErrorPluginAdaptFn<Error0, PluginOutputProps<TProps>>>;
|
|
35
43
|
};
|
|
36
|
-
type
|
|
37
|
-
type
|
|
38
|
-
type
|
|
39
|
-
[TKey in keyof TProps]: TProps[TKey] extends
|
|
44
|
+
type AddPropToPluginProps<TProps extends ErrorPluginProps, TKey extends string, TInputValue, TOutputValue> = TProps & Record<TKey, ErrorPluginPropOptions<TInputValue, TOutputValue>>;
|
|
45
|
+
type AddMethodToPluginMethods<TMethods extends ErrorPluginMethods, TKey extends string, TArgs extends unknown[], TOutputValue> = TMethods & Record<TKey, ErrorPluginMethodFn<TOutputValue, TArgs>>;
|
|
46
|
+
type PluginOutputProps<TProps extends ErrorPluginProps> = {
|
|
47
|
+
[TKey in keyof TProps]: TProps[TKey] extends ErrorPluginPropOptions<any, infer TOutputValue> ? TOutputValue : never;
|
|
40
48
|
};
|
|
41
|
-
type
|
|
49
|
+
type ErrorPluginsMap = {
|
|
42
50
|
props: Record<string, {
|
|
43
51
|
init: unknown;
|
|
44
52
|
resolve: unknown;
|
|
@@ -49,103 +57,104 @@ type IsEmptyObject<T> = keyof T extends never ? true : false;
|
|
|
49
57
|
type ErrorInputBase = {
|
|
50
58
|
cause?: unknown;
|
|
51
59
|
};
|
|
52
|
-
type
|
|
53
|
-
[TKey in keyof
|
|
54
|
-
}
|
|
55
|
-
type
|
|
56
|
-
|
|
60
|
+
type ErrorInputPluginProps<TPluginsMap extends ErrorPluginsMap> = {
|
|
61
|
+
[TKey in keyof TPluginsMap['props'] as IsOnlyUndefined<TPluginsMap['props'][TKey]['init']> extends true ? never : TKey]?: TPluginsMap['props'][TKey]['init'];
|
|
62
|
+
};
|
|
63
|
+
type ErrorInput<TPluginsMap extends ErrorPluginsMap> = IsEmptyObject<TPluginsMap['props']> extends true ? ErrorInputBase : ErrorInputBase & ErrorInputPluginProps<TPluginsMap>;
|
|
64
|
+
type ErrorOutputProps<TPluginsMap extends ErrorPluginsMap> = {
|
|
65
|
+
[TKey in keyof TPluginsMap['props']]: TPluginsMap['props'][TKey]['resolve'] | undefined;
|
|
57
66
|
};
|
|
58
|
-
type ErrorOutputMethods<
|
|
59
|
-
[TKey in keyof
|
|
67
|
+
type ErrorOutputMethods<TPluginsMap extends ErrorPluginsMap> = {
|
|
68
|
+
[TKey in keyof TPluginsMap['methods']]: TPluginsMap['methods'][TKey] extends {
|
|
60
69
|
args: infer TArgs extends unknown[];
|
|
61
70
|
output: infer TOutput;
|
|
62
71
|
} ? (...args: TArgs) => TOutput : never;
|
|
63
72
|
};
|
|
64
|
-
type ErrorOutput<
|
|
65
|
-
type ErrorStaticMethods<
|
|
66
|
-
[TKey in keyof
|
|
73
|
+
type ErrorOutput<TPluginsMap extends ErrorPluginsMap> = ErrorOutputProps<TPluginsMap> & ErrorOutputMethods<TPluginsMap>;
|
|
74
|
+
type ErrorStaticMethods<TPluginsMap extends ErrorPluginsMap> = {
|
|
75
|
+
[TKey in keyof TPluginsMap['methods']]: TPluginsMap['methods'][TKey] extends {
|
|
67
76
|
args: infer TArgs extends unknown[];
|
|
68
77
|
output: infer TOutput;
|
|
69
78
|
} ? (error: unknown, ...args: TArgs) => TOutput : never;
|
|
70
79
|
};
|
|
71
|
-
type
|
|
80
|
+
type EmptyPluginsMap = {
|
|
72
81
|
props: Record<never, {
|
|
73
82
|
init: never;
|
|
74
83
|
resolve: never;
|
|
75
84
|
}>;
|
|
76
85
|
methods: Record<never, ErrorMethodRecord>;
|
|
77
86
|
};
|
|
78
|
-
type
|
|
79
|
-
[TKey in keyof NonNullable<
|
|
80
|
-
init:
|
|
87
|
+
type PluginPropsMapOf<TPlugin extends ErrorPlugin> = {
|
|
88
|
+
[TKey in keyof NonNullable<TPlugin['props']>]: NonNullable<TPlugin['props']>[TKey] extends ErrorPluginPropOptions<any, infer TOutputValue> ? {
|
|
89
|
+
init: InferPluginPropInput<NonNullable<TPlugin['props']>[TKey]>;
|
|
81
90
|
resolve: TOutputValue;
|
|
82
91
|
} : never;
|
|
83
92
|
};
|
|
84
|
-
type
|
|
85
|
-
[TKey in keyof NonNullable<
|
|
93
|
+
type PluginMethodsMapOf<TPlugin extends ErrorPlugin> = {
|
|
94
|
+
[TKey in keyof NonNullable<TPlugin['methods']>]: NonNullable<TPlugin['methods']>[TKey] extends (error: Error0, ...args: infer TArgs extends unknown[]) => infer TOutput ? {
|
|
86
95
|
args: TArgs;
|
|
87
96
|
output: TOutput;
|
|
88
97
|
} : never;
|
|
89
98
|
};
|
|
90
|
-
type
|
|
91
|
-
props:
|
|
92
|
-
methods:
|
|
93
|
-
};
|
|
94
|
-
type
|
|
95
|
-
props: TMap['props'] &
|
|
96
|
-
methods: TMap['methods'] &
|
|
97
|
-
};
|
|
98
|
-
type
|
|
99
|
-
type
|
|
100
|
-
type
|
|
101
|
-
|
|
102
|
-
} ?
|
|
103
|
-
type
|
|
104
|
-
type ErrorInstanceOfMap<TMap extends
|
|
105
|
-
type BuilderError0<TProps extends
|
|
106
|
-
type
|
|
107
|
-
declare class
|
|
108
|
-
private readonly
|
|
99
|
+
type ErrorPluginsMapOfPlugin<TPlugin extends ErrorPlugin> = {
|
|
100
|
+
props: PluginPropsMapOf<TPlugin>;
|
|
101
|
+
methods: PluginMethodsMapOf<TPlugin>;
|
|
102
|
+
};
|
|
103
|
+
type ExtendErrorPluginsMap<TMap extends ErrorPluginsMap, TPlugin extends ErrorPlugin> = {
|
|
104
|
+
props: TMap['props'] & ErrorPluginsMapOfPlugin<TPlugin>['props'];
|
|
105
|
+
methods: TMap['methods'] & ErrorPluginsMapOfPlugin<TPlugin>['methods'];
|
|
106
|
+
};
|
|
107
|
+
type ExtendErrorPluginsMapWithProp<TMap extends ErrorPluginsMap, TKey extends string, TInputValue, TOutputValue> = ExtendErrorPluginsMap<TMap, ErrorPlugin<Record<TKey, ErrorPluginPropOptions<TInputValue, TOutputValue>>>>;
|
|
108
|
+
type ExtendErrorPluginsMapWithMethod<TMap extends ErrorPluginsMap, TKey extends string, TArgs extends unknown[], TOutputValue> = ExtendErrorPluginsMap<TMap, ErrorPlugin<Record<never, never>, Record<TKey, ErrorPluginMethodFn<TOutputValue, TArgs>>>>;
|
|
109
|
+
type PluginsMapOf<TClass> = TClass extends {
|
|
110
|
+
__pluginsMap?: infer TPluginsMap;
|
|
111
|
+
} ? TPluginsMap extends ErrorPluginsMap ? TPluginsMap : EmptyPluginsMap : EmptyPluginsMap;
|
|
112
|
+
type PluginsMapFromParts<TProps extends ErrorPluginProps, TMethods extends ErrorPluginMethods> = ErrorPluginsMapOfPlugin<ErrorPlugin<TProps, TMethods>>;
|
|
113
|
+
type ErrorInstanceOfMap<TMap extends ErrorPluginsMap> = Error0 & ErrorOutput<TMap>;
|
|
114
|
+
type BuilderError0<TProps extends ErrorPluginProps, TMethods extends ErrorPluginMethods> = Error0 & ErrorOutput<PluginsMapFromParts<TProps, TMethods>>;
|
|
115
|
+
type PluginOfBuilder<TBuilder> = TBuilder extends PluginError0<infer TProps, infer TMethods> ? ErrorPlugin<TProps, TMethods> : never;
|
|
116
|
+
declare class PluginError0<TProps extends ErrorPluginProps = Record<never, never>, TMethods extends ErrorPluginMethods = Record<never, never>> {
|
|
117
|
+
private readonly _plugin;
|
|
109
118
|
readonly Infer: {
|
|
110
119
|
props: TProps;
|
|
111
120
|
methods: TMethods;
|
|
112
121
|
};
|
|
113
|
-
constructor(
|
|
114
|
-
prop<TKey extends string, TInputValue, TOutputValue>(key: TKey, value:
|
|
115
|
-
method<TKey extends string, TArgs extends unknown[], TOutputValue>(key: TKey, value:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
constructor(plugin?: ErrorPlugin<ErrorPluginProps, ErrorPluginMethods>);
|
|
123
|
+
prop<TKey extends string, TInputValue, TOutputValue>(key: TKey, value: ErrorPluginPropOptions<TInputValue, TOutputValue, BuilderError0<TProps, TMethods>>): PluginError0<AddPropToPluginProps<TProps, TKey, TInputValue, TOutputValue>, TMethods>;
|
|
124
|
+
method<TKey extends string, TArgs extends unknown[], TOutputValue>(key: TKey, value: ErrorPluginMethodFn<TOutputValue, TArgs, BuilderError0<TProps, TMethods>>): PluginError0<TProps, AddMethodToPluginMethods<TMethods, TKey, TArgs, TOutputValue>>;
|
|
125
|
+
adapt(value: ErrorPluginAdaptFn<BuilderError0<TProps, TMethods>, PluginOutputProps<TProps>>): PluginError0<TProps, TMethods>;
|
|
126
|
+
use<TKey extends string, TInputValue, TOutputValue>(kind: 'prop', key: TKey, value: ErrorPluginPropOptions<TInputValue, TOutputValue, BuilderError0<TProps, TMethods>>): PluginError0<AddPropToPluginProps<TProps, TKey, TInputValue, TOutputValue>, TMethods>;
|
|
127
|
+
use<TKey extends string, TArgs extends unknown[], TOutputValue>(kind: 'method', key: TKey, value: ErrorPluginMethodFn<TOutputValue, TArgs, BuilderError0<TProps, TMethods>>): PluginError0<TProps, AddMethodToPluginMethods<TMethods, TKey, TArgs, TOutputValue>>;
|
|
128
|
+
use(kind: 'adapt', value: ErrorPluginAdaptFn<BuilderError0<TProps, TMethods>, PluginOutputProps<TProps>>): PluginError0<TProps, TMethods>;
|
|
120
129
|
}
|
|
121
|
-
type ClassError0<
|
|
122
|
-
new (message: string, input?: ErrorInput<
|
|
130
|
+
type ClassError0<TPluginsMap extends ErrorPluginsMap = EmptyPluginsMap> = {
|
|
131
|
+
new (message: string, input?: ErrorInput<TPluginsMap>): Error0 & ErrorOutput<TPluginsMap>;
|
|
123
132
|
new (input: {
|
|
124
133
|
message: string;
|
|
125
|
-
} & ErrorInput<
|
|
126
|
-
readonly
|
|
127
|
-
from: (error: unknown) => Error0 & ErrorOutput<
|
|
134
|
+
} & ErrorInput<TPluginsMap>): Error0 & ErrorOutput<TPluginsMap>;
|
|
135
|
+
readonly __pluginsMap?: TPluginsMap;
|
|
136
|
+
from: (error: unknown) => Error0 & ErrorOutput<TPluginsMap>;
|
|
128
137
|
serialize: (error: unknown, isPublic?: boolean) => Record<string, unknown>;
|
|
129
|
-
prop: <TKey extends string, TInputValue, TOutputValue>(key: TKey, value:
|
|
130
|
-
method: <TKey extends string, TArgs extends unknown[], TOutputValue>(key: TKey, value:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<TBuilder extends
|
|
134
|
-
<TKey extends string, TInputValue, TOutputValue>(kind: 'prop', key: TKey, value:
|
|
135
|
-
<TKey extends string, TArgs extends unknown[], TOutputValue>(kind: 'method', key: TKey, value:
|
|
136
|
-
(kind: '
|
|
138
|
+
prop: <TKey extends string, TInputValue, TOutputValue>(key: TKey, value: ErrorPluginPropOptions<TInputValue, TOutputValue, ErrorInstanceOfMap<TPluginsMap>>) => ClassError0<ExtendErrorPluginsMapWithProp<TPluginsMap, TKey, TInputValue, TOutputValue>>;
|
|
139
|
+
method: <TKey extends string, TArgs extends unknown[], TOutputValue>(key: TKey, value: ErrorPluginMethodFn<TOutputValue, TArgs, ErrorInstanceOfMap<TPluginsMap>>) => ClassError0<ExtendErrorPluginsMapWithMethod<TPluginsMap, TKey, TArgs, TOutputValue>>;
|
|
140
|
+
adapt: (value: ErrorPluginAdaptFn<ErrorInstanceOfMap<TPluginsMap>, ErrorOutputProps<TPluginsMap>>) => ClassError0<TPluginsMap>;
|
|
141
|
+
use: {
|
|
142
|
+
<TBuilder extends PluginError0>(plugin: TBuilder): ClassError0<ExtendErrorPluginsMap<TPluginsMap, PluginOfBuilder<TBuilder>>>;
|
|
143
|
+
<TKey extends string, TInputValue, TOutputValue>(kind: 'prop', key: TKey, value: ErrorPluginPropOptions<TInputValue, TOutputValue, ErrorInstanceOfMap<TPluginsMap>>): ClassError0<ExtendErrorPluginsMapWithProp<TPluginsMap, TKey, TInputValue, TOutputValue>>;
|
|
144
|
+
<TKey extends string, TArgs extends unknown[], TOutputValue>(kind: 'method', key: TKey, value: ErrorPluginMethodFn<TOutputValue, TArgs, ErrorInstanceOfMap<TPluginsMap>>): ClassError0<ExtendErrorPluginsMapWithMethod<TPluginsMap, TKey, TArgs, TOutputValue>>;
|
|
145
|
+
(kind: 'adapt', value: ErrorPluginAdaptFn<ErrorInstanceOfMap<TPluginsMap>, ErrorOutputProps<TPluginsMap>>): ClassError0<TPluginsMap>;
|
|
137
146
|
};
|
|
138
|
-
|
|
139
|
-
} & ErrorStaticMethods<
|
|
147
|
+
plugin: () => PluginError0;
|
|
148
|
+
} & ErrorStaticMethods<TPluginsMap>;
|
|
140
149
|
declare class Error0 extends Error {
|
|
141
|
-
static readonly
|
|
142
|
-
protected static
|
|
143
|
-
private static readonly
|
|
144
|
-
private static
|
|
145
|
-
constructor(message: string, input?: ErrorInput<
|
|
150
|
+
static readonly __pluginsMap?: EmptyPluginsMap;
|
|
151
|
+
protected static _plugins: ErrorPlugin[];
|
|
152
|
+
private static readonly _emptyPlugin;
|
|
153
|
+
private static _getResolvedPlugin;
|
|
154
|
+
constructor(message: string, input?: ErrorInput<EmptyPluginsMap>);
|
|
146
155
|
constructor(input: {
|
|
147
156
|
message: string;
|
|
148
|
-
} & ErrorInput<
|
|
157
|
+
} & ErrorInput<EmptyPluginsMap>);
|
|
149
158
|
private static readonly isSelfProperty;
|
|
150
159
|
static own(error: object, key: string): unknown;
|
|
151
160
|
own(key: string): unknown;
|
|
@@ -158,22 +167,22 @@ declare class Error0 extends Error {
|
|
|
158
167
|
static is<T extends typeof Error0>(this: T, error: unknown): error is InstanceType<T>;
|
|
159
168
|
static isSerialized(error: unknown): error is Record<string, unknown>;
|
|
160
169
|
static from(error: unknown): Error0;
|
|
161
|
-
private static
|
|
170
|
+
private static _applyAdapt;
|
|
162
171
|
private static _fromSerialized;
|
|
163
172
|
private static _fromNonError0;
|
|
164
173
|
private static _extractMessage;
|
|
165
|
-
private static
|
|
166
|
-
private static
|
|
167
|
-
static prop<TThis extends typeof Error0, TKey extends string, TInputValue, TOutputValue>(this: TThis, key: TKey, value:
|
|
168
|
-
static method<TThis extends typeof Error0, TKey extends string, TArgs extends unknown[], TOutputValue>(this: TThis, key: TKey, value:
|
|
169
|
-
static
|
|
170
|
-
static
|
|
171
|
-
static
|
|
172
|
-
static
|
|
173
|
-
static
|
|
174
|
-
static
|
|
174
|
+
private static _useWithPlugin;
|
|
175
|
+
private static _pluginFromBuilder;
|
|
176
|
+
static prop<TThis extends typeof Error0, TKey extends string, TInputValue, TOutputValue>(this: TThis, key: TKey, value: ErrorPluginPropOptions<TInputValue, TOutputValue, ErrorInstanceOfMap<PluginsMapOf<TThis>>>): ClassError0<ExtendErrorPluginsMapWithProp<PluginsMapOf<TThis>, TKey, TInputValue, TOutputValue>>;
|
|
177
|
+
static method<TThis extends typeof Error0, TKey extends string, TArgs extends unknown[], TOutputValue>(this: TThis, key: TKey, value: ErrorPluginMethodFn<TOutputValue, TArgs, ErrorInstanceOfMap<PluginsMapOf<TThis>>>): ClassError0<ExtendErrorPluginsMapWithMethod<PluginsMapOf<TThis>, TKey, TArgs, TOutputValue>>;
|
|
178
|
+
static adapt<TThis extends typeof Error0>(this: TThis, value: ErrorPluginAdaptFn<ErrorInstanceOfMap<PluginsMapOf<TThis>>, ErrorOutputProps<PluginsMapOf<TThis>>>): ClassError0<PluginsMapOf<TThis>>;
|
|
179
|
+
static use<TThis extends typeof Error0, TBuilder extends PluginError0>(this: TThis, plugin: TBuilder): ClassError0<ExtendErrorPluginsMap<PluginsMapOf<TThis>, PluginOfBuilder<TBuilder>>>;
|
|
180
|
+
static use<TThis extends typeof Error0, TKey extends string, TInputValue, TOutputValue>(this: TThis, kind: 'prop', key: TKey, value: ErrorPluginPropOptions<TInputValue, TOutputValue, ErrorInstanceOfMap<PluginsMapOf<TThis>>>): ClassError0<ExtendErrorPluginsMapWithProp<PluginsMapOf<TThis>, TKey, TInputValue, TOutputValue>>;
|
|
181
|
+
static use<TThis extends typeof Error0, TKey extends string, TArgs extends unknown[], TOutputValue>(this: TThis, kind: 'method', key: TKey, value: ErrorPluginMethodFn<TOutputValue, TArgs, ErrorInstanceOfMap<PluginsMapOf<TThis>>>): ClassError0<ExtendErrorPluginsMapWithMethod<PluginsMapOf<TThis>, TKey, TArgs, TOutputValue>>;
|
|
182
|
+
static use<TThis extends typeof Error0>(this: TThis, kind: 'adapt', value: ErrorPluginAdaptFn<ErrorInstanceOfMap<PluginsMapOf<TThis>>, ErrorOutputProps<PluginsMapOf<TThis>>>): ClassError0<PluginsMapOf<TThis>>;
|
|
183
|
+
static plugin(): PluginError0;
|
|
175
184
|
static serialize(error: unknown, isPublic?: boolean): Record<string, unknown>;
|
|
176
185
|
serialize(isPublic?: boolean): object;
|
|
177
186
|
}
|
|
178
187
|
|
|
179
|
-
export { type ClassError0, Error0, type
|
|
188
|
+
export { type ClassError0, Error0, type ErrorInput, type ErrorInputBase, type ErrorOutput, type ErrorPlugin, type ErrorPluginAdaptFn, type ErrorPluginAdaptResult, type ErrorPluginMethodFn, type ErrorPluginMethods, type ErrorPluginPropOptions, type ErrorPluginProps, type ErrorPluginsMap, type IsEmptyObject, PluginError0 };
|