@devp0nt/error0 1.0.0-next.52 → 1.0.0-next.54
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 +109 -105
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +44 -85
- package/dist/cjs/plugins/code.d.cts +40 -2
- package/dist/cjs/plugins/expected.d.cts +53 -11
- package/dist/cjs/plugins/meta.d.cts +40 -2
- package/dist/cjs/plugins/stack-merge.cjs +3 -3
- package/dist/cjs/plugins/stack-merge.cjs.map +1 -1
- package/dist/cjs/plugins/status.d.cts +40 -2
- package/dist/cjs/plugins/tags.cjs +13 -14
- package/dist/cjs/plugins/tags.cjs.map +1 -1
- package/dist/cjs/plugins/tags.d.cts +73 -5
- package/dist/esm/index.d.ts +44 -85
- package/dist/esm/index.js +109 -105
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/plugins/code.d.ts +40 -2
- package/dist/esm/plugins/expected.d.ts +53 -11
- package/dist/esm/plugins/meta.d.ts +40 -2
- package/dist/esm/plugins/stack-merge.js +3 -3
- package/dist/esm/plugins/stack-merge.js.map +1 -1
- package/dist/esm/plugins/status.d.ts +40 -2
- package/dist/esm/plugins/tags.d.ts +73 -5
- package/dist/esm/plugins/tags.js +13 -14
- package/dist/esm/plugins/tags.js.map +1 -1
- package/package.json +4 -2
- package/src/index.test.ts +187 -5
- package/src/index.ts +327 -311
- package/src/plugins/stack-merge.ts +2 -3
- package/src/plugins/tags.test.ts +1 -3
- package/src/plugins/tags.ts +28 -16
package/dist/cjs/index.d.cts
CHANGED
|
@@ -35,6 +35,18 @@ type ErrorPluginPropOptionsWithoutInit<TOutputValue, TError extends Error0, TRes
|
|
|
35
35
|
init?: undefined;
|
|
36
36
|
};
|
|
37
37
|
type ErrorPluginPropOptions<TInputValue = undefined, TOutputValue = unknown, TError extends Error0 = Error0, TResolveValue extends TOutputValue | undefined = TOutputValue | undefined> = ErrorPluginPropOptionsWithInit<TInputValue, TOutputValue, TError, TResolveValue> | ErrorPluginPropOptionsWithoutInit<TOutputValue, TError, TResolveValue>;
|
|
38
|
+
type ErrorPluginPropOptionsBaseDefinition<TOutputValue, TError extends Error0, TResolveValue extends TOutputValue | undefined> = {
|
|
39
|
+
resolve?: ((options: ErrorPluginPropOptionsResolveOptions<TOutputValue, TError>) => TResolveValue) | boolean;
|
|
40
|
+
serialize?: ErrorPluginPropSerialize<TOutputValue, TError, TResolveValue>;
|
|
41
|
+
deserialize?: ErrorPluginPropDeserialize<TOutputValue>;
|
|
42
|
+
};
|
|
43
|
+
type ErrorPluginPropOptionsWithInitDefinition<TInputValue, TOutputValue, TError extends Error0, TResolveValue extends TOutputValue | undefined> = ErrorPluginPropOptionsBaseDefinition<TOutputValue, TError, TResolveValue> & {
|
|
44
|
+
init: ErrorPluginPropInit<TInputValue, TOutputValue>;
|
|
45
|
+
};
|
|
46
|
+
type ErrorPluginPropOptionsWithoutInitDefinition<TOutputValue, TError extends Error0, TResolveValue extends TOutputValue | undefined> = ErrorPluginPropOptionsBaseDefinition<TOutputValue, TError, TResolveValue> & {
|
|
47
|
+
init?: undefined;
|
|
48
|
+
};
|
|
49
|
+
type ErrorPluginPropOptionsDefinition<TInputValue = undefined, TOutputValue = unknown, TError extends Error0 = Error0, TResolveValue extends TOutputValue | undefined = TOutputValue | undefined> = ErrorPluginPropOptionsWithInitDefinition<TInputValue, TOutputValue, TError, TResolveValue> | ErrorPluginPropOptionsWithoutInitDefinition<TOutputValue, TError, TResolveValue>;
|
|
38
50
|
type ErrorPluginMethodFn<TOutputValue, TArgs extends unknown[] = unknown[], TError extends Error0 = Error0> = (error: TError, ...args: TArgs) => TOutputValue;
|
|
39
51
|
type ErrorPluginAnyMethodFn = (error: any, ...args: any[]) => any;
|
|
40
52
|
type ErrorPluginAdaptResult<TOutputProps extends Record<string, unknown>> = Partial<TOutputProps> | undefined;
|
|
@@ -116,66 +128,20 @@ type ErrorResolvedProps<TPluginsMap extends ErrorPluginsMap> = {
|
|
|
116
128
|
type ErrorOwnProps<TPluginsMap extends ErrorPluginsMap> = {
|
|
117
129
|
[TKey in keyof TPluginsMap['props']]: TPluginsMap['props'][TKey]['output'] | undefined;
|
|
118
130
|
};
|
|
131
|
+
type ErrorResolveMethods<TPluginsMap extends ErrorPluginsMap> = {
|
|
132
|
+
resolve: () => ErrorResolvedProps<TPluginsMap>;
|
|
133
|
+
};
|
|
134
|
+
type Error0ResolvedInstance<TPluginsMap extends ErrorPluginsMap> = Error0 & ErrorResolved<TPluginsMap> & ErrorResolveMethods<TPluginsMap>;
|
|
119
135
|
type ErrorOwnMethods<TPluginsMap extends ErrorPluginsMap> = {
|
|
120
|
-
own
|
|
121
|
-
(): ErrorOwnProps<TPluginsMap>;
|
|
122
|
-
<TKey extends keyof TPluginsMap['props'] & string>(key: TKey): ErrorOwnProps<TPluginsMap>[TKey];
|
|
123
|
-
};
|
|
136
|
+
own?: Partial<ErrorOwnProps<TPluginsMap>>;
|
|
124
137
|
flow: <TKey extends keyof TPluginsMap['props'] & string>(key: TKey) => Array<ErrorOwnProps<TPluginsMap>[TKey]>;
|
|
138
|
+
assign: (props: Partial<ErrorOwnProps<TPluginsMap>>) => Error0ResolvedInstance<TPluginsMap>;
|
|
125
139
|
};
|
|
126
|
-
type
|
|
127
|
-
|
|
140
|
+
type InstanceError0<TPluginsMap extends ErrorPluginsMap> = Error0ResolvedInstance<TPluginsMap> & ErrorOwnMethods<TPluginsMap> & {
|
|
141
|
+
readonly __pluginsMap?: TPluginsMap;
|
|
128
142
|
};
|
|
129
|
-
type BindInstanceMethod<TMethod> = TMethod extends
|
|
130
|
-
|
|
131
|
-
(error: any, ...args: infer TArgs2): infer TOutput2;
|
|
132
|
-
(error: any, ...args: infer TArgs3): infer TOutput3;
|
|
133
|
-
(error: any, ...args: infer TArgs4): infer TOutput4;
|
|
134
|
-
} ? {
|
|
135
|
-
(...args: TArgs1): TOutput1;
|
|
136
|
-
(...args: TArgs2): TOutput2;
|
|
137
|
-
(...args: TArgs3): TOutput3;
|
|
138
|
-
(...args: TArgs4): TOutput4;
|
|
139
|
-
} : TMethod extends {
|
|
140
|
-
(error: any, ...args: infer TArgs1): infer TOutput1;
|
|
141
|
-
(error: any, ...args: infer TArgs2): infer TOutput2;
|
|
142
|
-
(error: any, ...args: infer TArgs3): infer TOutput3;
|
|
143
|
-
} ? {
|
|
144
|
-
(...args: TArgs1): TOutput1;
|
|
145
|
-
(...args: TArgs2): TOutput2;
|
|
146
|
-
(...args: TArgs3): TOutput3;
|
|
147
|
-
} : TMethod extends {
|
|
148
|
-
(error: any, ...args: infer TArgs1): infer TOutput1;
|
|
149
|
-
(error: any, ...args: infer TArgs2): infer TOutput2;
|
|
150
|
-
} ? {
|
|
151
|
-
(...args: TArgs1): TOutput1;
|
|
152
|
-
(...args: TArgs2): TOutput2;
|
|
153
|
-
} : TMethod extends (error: any, ...args: infer TArgs) => infer TOutput ? (...args: TArgs) => TOutput : never;
|
|
154
|
-
type BindStaticMethod<TMethod> = TMethod extends {
|
|
155
|
-
(error: any, ...args: infer TArgs1): infer TOutput1;
|
|
156
|
-
(error: any, ...args: infer TArgs2): infer TOutput2;
|
|
157
|
-
(error: any, ...args: infer TArgs3): infer TOutput3;
|
|
158
|
-
(error: any, ...args: infer TArgs4): infer TOutput4;
|
|
159
|
-
} ? {
|
|
160
|
-
(error: unknown, ...args: TArgs1): TOutput1;
|
|
161
|
-
(error: unknown, ...args: TArgs2): TOutput2;
|
|
162
|
-
(error: unknown, ...args: TArgs3): TOutput3;
|
|
163
|
-
(error: unknown, ...args: TArgs4): TOutput4;
|
|
164
|
-
} : TMethod extends {
|
|
165
|
-
(error: any, ...args: infer TArgs1): infer TOutput1;
|
|
166
|
-
(error: any, ...args: infer TArgs2): infer TOutput2;
|
|
167
|
-
(error: any, ...args: infer TArgs3): infer TOutput3;
|
|
168
|
-
} ? {
|
|
169
|
-
(error: unknown, ...args: TArgs1): TOutput1;
|
|
170
|
-
(error: unknown, ...args: TArgs2): TOutput2;
|
|
171
|
-
(error: unknown, ...args: TArgs3): TOutput3;
|
|
172
|
-
} : TMethod extends {
|
|
173
|
-
(error: any, ...args: infer TArgs1): infer TOutput1;
|
|
174
|
-
(error: any, ...args: infer TArgs2): infer TOutput2;
|
|
175
|
-
} ? {
|
|
176
|
-
(error: unknown, ...args: TArgs1): TOutput1;
|
|
177
|
-
(error: unknown, ...args: TArgs2): TOutput2;
|
|
178
|
-
} : TMethod extends (error: any, ...args: infer TArgs) => infer TOutput ? (error: unknown, ...args: TArgs) => TOutput : never;
|
|
143
|
+
type BindInstanceMethod<TMethod> = TMethod extends (error: any, ...args: infer TArgs) => infer TOutput ? (...args: TArgs) => TOutput : never;
|
|
144
|
+
type BindStaticMethod<TMethod> = TMethod extends (error: any, ...args: infer TArgs) => infer TOutput ? (error: unknown, ...args: TArgs) => TOutput : never;
|
|
179
145
|
type ErrorMethods<TPluginsMap extends ErrorPluginsMap> = {
|
|
180
146
|
[TKey in keyof TPluginsMap['methods']]: BindInstanceMethod<TPluginsMap['methods'][TKey]['fn']>;
|
|
181
147
|
};
|
|
@@ -231,12 +197,8 @@ type PluginsMapOfInstance<TInstance> = TInstance extends {
|
|
|
231
197
|
__pluginsMap?: infer TPluginsMap;
|
|
232
198
|
} ? TPluginsMap extends ErrorPluginsMap ? TPluginsMap : EmptyPluginsMap : EmptyPluginsMap;
|
|
233
199
|
type PluginsMapFromParts<TProps extends ErrorPluginProps, TMethods extends ErrorPluginMethods> = ErrorPluginsMapOfPlugin<ErrorPlugin<TProps, TMethods>>;
|
|
234
|
-
type ErrorInstanceOfMap<TMap extends ErrorPluginsMap> =
|
|
235
|
-
|
|
236
|
-
};
|
|
237
|
-
type BuilderError0<TProps extends ErrorPluginProps, TMethods extends ErrorPluginMethods> = Error0 & ErrorResolved<PluginsMapFromParts<TProps, TMethods>> & ErrorOwnMethods<PluginsMapFromParts<TProps, TMethods>> & ErrorResolveMethods<PluginsMapFromParts<TProps, TMethods>> & {
|
|
238
|
-
readonly __pluginsMap?: PluginsMapFromParts<TProps, TMethods>;
|
|
239
|
-
};
|
|
200
|
+
type ErrorInstanceOfMap<TMap extends ErrorPluginsMap> = InstanceError0<TMap>;
|
|
201
|
+
type BuilderError0<TProps extends ErrorPluginProps, TMethods extends ErrorPluginMethods> = InstanceError0<PluginsMapFromParts<TProps, TMethods>>;
|
|
240
202
|
type PluginOfBuilder<TBuilder> = TBuilder extends PluginError0<infer TProps, infer TMethods> ? ErrorPlugin<TProps, TMethods> : never;
|
|
241
203
|
declare class PluginError0<TProps extends ErrorPluginProps = Record<never, never>, TMethods extends ErrorPluginMethods = Record<never, never>> {
|
|
242
204
|
private readonly _plugin;
|
|
@@ -245,38 +207,36 @@ declare class PluginError0<TProps extends ErrorPluginProps = Record<never, never
|
|
|
245
207
|
methods: TMethods;
|
|
246
208
|
};
|
|
247
209
|
constructor(plugin?: ErrorPlugin<ErrorPluginProps, ErrorPluginMethods>);
|
|
248
|
-
prop<TKey extends string, TInputValue = undefined, TOutputValue = unknown, TResolveValue extends TOutputValue | undefined = TOutputValue | undefined>(key: TKey, value:
|
|
210
|
+
prop<TKey extends string, TInputValue = undefined, TOutputValue = unknown, TResolveValue extends TOutputValue | undefined = TOutputValue | undefined>(key: TKey, value: ErrorPluginPropOptionsDefinition<TInputValue, TOutputValue, BuilderError0<TProps, TMethods>, TResolveValue>): PluginError0<AddPropToPluginProps<TProps, TKey, TInputValue, TOutputValue, TResolveValue>, TMethods>;
|
|
249
211
|
method<TKey extends string, TMethod extends (error: BuilderError0<TProps, TMethods>, ...args: any[]) => any>(key: TKey, value: TMethod): PluginError0<TProps, AddMethodToPluginMethods<TMethods, TKey, TMethod>>;
|
|
250
212
|
adapt(value: ErrorPluginAdaptFn<BuilderError0<TProps, TMethods>, PluginOutputProps<TProps>>): PluginError0<TProps, TMethods>;
|
|
251
213
|
stack(value: ErrorPluginStack<BuilderError0<TProps, TMethods>>): PluginError0<TProps, TMethods>;
|
|
252
214
|
cause(value: ErrorPluginCause<BuilderError0<TProps, TMethods>>): PluginError0<TProps, TMethods>;
|
|
253
215
|
message(value: ErrorPluginMessage<BuilderError0<TProps, TMethods>>): PluginError0<TProps, TMethods>;
|
|
254
|
-
use<TKey extends string, TInputValue = undefined, TOutputValue = unknown, TResolveValue extends TOutputValue | undefined = TOutputValue | undefined>(kind: 'prop', key: TKey, value:
|
|
216
|
+
use<TKey extends string, TInputValue = undefined, TOutputValue = unknown, TResolveValue extends TOutputValue | undefined = TOutputValue | undefined>(kind: 'prop', key: TKey, value: ErrorPluginPropOptionsDefinition<TInputValue, TOutputValue, BuilderError0<TProps, TMethods>, TResolveValue>): PluginError0<AddPropToPluginProps<TProps, TKey, TInputValue, TOutputValue, TResolveValue>, TMethods>;
|
|
255
217
|
use<TKey extends string, TMethod extends (error: BuilderError0<TProps, TMethods>, ...args: any[]) => any>(kind: 'method', key: TKey, value: TMethod): PluginError0<TProps, AddMethodToPluginMethods<TMethods, TKey, TMethod>>;
|
|
256
218
|
use(kind: 'adapt', value: ErrorPluginAdaptFn<BuilderError0<TProps, TMethods>, PluginOutputProps<TProps>>): PluginError0<TProps, TMethods>;
|
|
257
219
|
use(kind: 'stack', value: ErrorPluginStack<BuilderError0<TProps, TMethods>>): PluginError0<TProps, TMethods>;
|
|
258
220
|
use(kind: 'cause', value: ErrorPluginCause<BuilderError0<TProps, TMethods>>): PluginError0<TProps, TMethods>;
|
|
259
221
|
use(kind: 'message', value: ErrorPluginMessage<BuilderError0<TProps, TMethods>>): PluginError0<TProps, TMethods>;
|
|
260
222
|
}
|
|
223
|
+
type ErrorOwnStore = Record<string, unknown>;
|
|
261
224
|
type ClassError0<TPluginsMap extends ErrorPluginsMap = EmptyPluginsMap> = {
|
|
262
225
|
MAX_CAUSES_DEPTH: number;
|
|
263
|
-
new (message: string, input?: ErrorInput<TPluginsMap>):
|
|
264
|
-
readonly __pluginsMap?: TPluginsMap;
|
|
265
|
-
};
|
|
226
|
+
new (message: string, input?: ErrorInput<TPluginsMap>): InstanceError0<TPluginsMap>;
|
|
266
227
|
new (input: {
|
|
267
228
|
message: string;
|
|
268
|
-
} & ErrorInput<TPluginsMap>):
|
|
269
|
-
readonly __pluginsMap?: TPluginsMap;
|
|
270
|
-
};
|
|
229
|
+
} & ErrorInput<TPluginsMap>): InstanceError0<TPluginsMap>;
|
|
271
230
|
readonly __pluginsMap?: TPluginsMap;
|
|
272
|
-
from: (error: unknown) =>
|
|
273
|
-
round: (error: unknown, isPublic?: boolean) =>
|
|
231
|
+
from: <TThis extends ClassError0<any>>(this: TThis, error: unknown) => InstanceType<TThis>;
|
|
232
|
+
round: <TThis extends ClassError0<any>>(this: TThis, error: unknown, isPublic?: boolean) => InstanceType<TThis>;
|
|
274
233
|
causes: {
|
|
275
234
|
(error: unknown, instancesOnly?: false): unknown[];
|
|
276
|
-
(error: unknown, instancesOnly: true): Array<
|
|
235
|
+
(error: unknown, instancesOnly: true): Array<InstanceError0<TPluginsMap>>;
|
|
277
236
|
};
|
|
278
237
|
resolve: (error: unknown) => ErrorResolvedProps<TPluginsMap>;
|
|
279
238
|
serialize: (error: unknown, isPublic?: boolean) => Record<string, unknown>;
|
|
239
|
+
assign: <TThis extends ClassError0<any>>(this: TThis, error: unknown, props: Partial<ErrorOwnProps<PluginsMapOf<TThis>>>) => InstanceError0<PluginsMapOf<TThis>>;
|
|
280
240
|
own: {
|
|
281
241
|
(error: object): ErrorOwnProps<TPluginsMap>;
|
|
282
242
|
<TKey extends keyof TPluginsMap['props'] & string>(error: object, key: TKey): ErrorOwnProps<TPluginsMap>[TKey];
|
|
@@ -299,6 +259,7 @@ declare class Error0 extends Error {
|
|
|
299
259
|
static MAX_CAUSES_DEPTH: number;
|
|
300
260
|
protected static _plugins: ErrorPlugin[];
|
|
301
261
|
protected static _resolvedPlugin?: ErrorPluginResolved;
|
|
262
|
+
own?: ErrorOwnStore;
|
|
302
263
|
private static readonly _emptyPlugin;
|
|
303
264
|
private static _indexResolvedPlugin;
|
|
304
265
|
private static _applyPlugin;
|
|
@@ -308,17 +269,13 @@ declare class Error0 extends Error {
|
|
|
308
269
|
constructor(input: {
|
|
309
270
|
message: string;
|
|
310
271
|
} & ErrorInput<EmptyPluginsMap>);
|
|
311
|
-
private static
|
|
312
|
-
private static readonly isOwnProperty;
|
|
313
|
-
private static _ownByKey;
|
|
314
|
-
private static _flowByKey;
|
|
272
|
+
private static fixStack;
|
|
315
273
|
static own<TThis extends typeof Error0>(this: TThis, error: unknown): ErrorOwnProps<PluginsMapOf<TThis>>;
|
|
316
274
|
static own<TThis extends typeof Error0, TKey extends keyof PluginsMapOf<TThis>['props'] & string>(this: TThis, error: unknown, key: TKey): ErrorOwnProps<PluginsMapOf<TThis>>[TKey];
|
|
317
|
-
own<TThis extends Error0>(this: TThis): ErrorOwnProps<PluginsMapOfInstance<TThis>>;
|
|
318
|
-
own<TThis extends Error0, TKey extends keyof PluginsMapOfInstance<TThis>['props'] & string>(this: TThis, key: TKey): ErrorOwnProps<PluginsMapOfInstance<TThis>>[TKey];
|
|
319
275
|
static flow<TThis extends typeof Error0, TKey extends keyof PluginsMapOf<TThis>['props'] & string>(this: TThis, error: unknown, key: TKey): Array<ErrorOwnProps<PluginsMapOf<TThis>>[TKey]>;
|
|
320
276
|
flow<TThis extends Error0, TKey extends keyof PluginsMapOfInstance<TThis>['props'] & string>(this: TThis, key: TKey): Array<ErrorOwnProps<PluginsMapOfInstance<TThis>>[TKey]>;
|
|
321
|
-
|
|
277
|
+
private readonly _resolveByKeyCache;
|
|
278
|
+
private _resolveByKey;
|
|
322
279
|
static resolve<TThis extends typeof Error0>(this: TThis, error: unknown): ErrorResolvedProps<PluginsMapOf<TThis>>;
|
|
323
280
|
static resolve(error: unknown): Record<string, unknown>;
|
|
324
281
|
resolve<TThis extends Error0>(this: TThis): ErrorResolvedProps<PluginsMapOfInstance<TThis>>;
|
|
@@ -328,8 +285,11 @@ declare class Error0 extends Error {
|
|
|
328
285
|
causes<TThis extends Error0>(this: TThis, instancesOnly: true): [TThis, ...TThis[]];
|
|
329
286
|
static is<T extends typeof Error0>(this: T, error: unknown): error is InstanceType<T>;
|
|
330
287
|
static isSerialized(error: unknown): error is Record<string, unknown>;
|
|
331
|
-
static from(error: unknown):
|
|
332
|
-
static round(error: unknown, isPublic?: boolean):
|
|
288
|
+
static from<TThis extends typeof Error0>(this: TThis, error: unknown): InstanceType<TThis>;
|
|
289
|
+
static round<TThis extends typeof Error0>(this: TThis, error: unknown, isPublic?: boolean): InstanceType<TThis>;
|
|
290
|
+
round<TThis extends Error0>(this: TThis, isPublic?: boolean): TThis;
|
|
291
|
+
static assign<TThis extends typeof Error0>(this: TThis, error: unknown, props: Partial<ErrorOwnProps<PluginsMapOf<TThis>>>): InstanceType<TThis>;
|
|
292
|
+
assign<TThis extends Error0>(this: TThis, props: Partial<ErrorOwnProps<PluginsMapOfInstance<TThis>>>): TThis;
|
|
333
293
|
private static _applyAdapt;
|
|
334
294
|
private static _fromSerialized;
|
|
335
295
|
private static _fromNonError0;
|
|
@@ -337,7 +297,7 @@ declare class Error0 extends Error {
|
|
|
337
297
|
private static _useWithPlugin;
|
|
338
298
|
private static _pluginFromBuilder;
|
|
339
299
|
static use<TThis extends typeof Error0, TBuilder extends PluginError0>(this: TThis, plugin: TBuilder): ClassError0<ExtendErrorPluginsMap<PluginsMapOf<TThis>, PluginOfBuilder<TBuilder>>>;
|
|
340
|
-
static use<TThis extends typeof Error0, TKey extends string, TInputValue = undefined, TOutputValue = unknown, TResolveValue extends TOutputValue | undefined = TOutputValue | undefined>(this: TThis, kind: 'prop', key: TKey, value:
|
|
300
|
+
static use<TThis extends typeof Error0, TKey extends string, TInputValue = undefined, TOutputValue = unknown, TResolveValue extends TOutputValue | undefined = TOutputValue | undefined>(this: TThis, kind: 'prop', key: TKey, value: ErrorPluginPropOptionsDefinition<TInputValue, TOutputValue, ErrorInstanceOfMap<PluginsMapOf<TThis>>, TResolveValue>): ClassError0<ExtendErrorPluginsMapWithProp<PluginsMapOf<TThis>, TKey, TInputValue, TOutputValue, TResolveValue>>;
|
|
341
301
|
static use<TThis extends typeof Error0, TKey extends string, TMethod extends (error: ErrorInstanceOfMap<PluginsMapOf<TThis>>, ...args: any[]) => any>(this: TThis, kind: 'method', key: TKey, value: TMethod): ClassError0<ExtendErrorPluginsMapWithMethod<PluginsMapOf<TThis>, TKey, TMethod>>;
|
|
342
302
|
static use<TThis extends typeof Error0>(this: TThis, kind: 'adapt', value: ErrorPluginAdaptFn<ErrorInstanceOfMap<PluginsMapOf<TThis>>, ErrorResolvedProps<PluginsMapOf<TThis>>>): ClassError0<PluginsMapOf<TThis>>;
|
|
343
303
|
static use<TThis extends typeof Error0>(this: TThis, kind: 'stack', value: ErrorPluginStack<ErrorInstanceOfMap<PluginsMapOf<TThis>>>): ClassError0<PluginsMapOf<TThis>>;
|
|
@@ -346,7 +306,6 @@ declare class Error0 extends Error {
|
|
|
346
306
|
static plugin(): PluginError0;
|
|
347
307
|
static serialize(error: unknown, isPublic?: boolean): Record<string, unknown>;
|
|
348
308
|
serialize(isPublic?: boolean): Record<string, unknown>;
|
|
349
|
-
round<TThis extends Error0>(this: TThis, isPublic?: boolean): TThis;
|
|
350
309
|
}
|
|
351
310
|
|
|
352
|
-
export { type ClassError0, Error0, type
|
|
311
|
+
export { type ClassError0, Error0, type ErrorPlugin, type InstanceError0, PluginError0 };
|
|
@@ -1,8 +1,46 @@
|
|
|
1
|
-
import { PluginError0,
|
|
1
|
+
import { PluginError0, Error0 } from '../index.cjs';
|
|
2
2
|
|
|
3
3
|
declare const codePlugin: <TCode extends string>({ codes, isPublic, }?: {
|
|
4
4
|
codes?: TCode[];
|
|
5
5
|
isPublic?: boolean;
|
|
6
|
-
}) => PluginError0<Record<never, never> & Record<"code",
|
|
6
|
+
}) => PluginError0<Record<never, never> & Record<"code", ({
|
|
7
|
+
resolve: (options: {
|
|
8
|
+
own: TCode | undefined;
|
|
9
|
+
flow: (TCode | undefined)[];
|
|
10
|
+
error: Error0;
|
|
11
|
+
}) => TCode | undefined;
|
|
12
|
+
serialize: false | ((options: {
|
|
13
|
+
own: TCode | undefined;
|
|
14
|
+
flow: (TCode | undefined)[];
|
|
15
|
+
resolved: TCode | undefined;
|
|
16
|
+
error: Error0;
|
|
17
|
+
isPublic: boolean;
|
|
18
|
+
}) => unknown);
|
|
19
|
+
deserialize: false | ((options: {
|
|
20
|
+
value: unknown;
|
|
21
|
+
record: Record<string, unknown>;
|
|
22
|
+
}) => TCode | undefined);
|
|
23
|
+
} & {
|
|
24
|
+
init: ((input: TCode) => TCode) | (() => TCode);
|
|
25
|
+
}) | ({
|
|
26
|
+
resolve: (options: {
|
|
27
|
+
own: TCode | undefined;
|
|
28
|
+
flow: (TCode | undefined)[];
|
|
29
|
+
error: Error0;
|
|
30
|
+
}) => TCode | undefined;
|
|
31
|
+
serialize: false | ((options: {
|
|
32
|
+
own: TCode | undefined;
|
|
33
|
+
flow: (TCode | undefined)[];
|
|
34
|
+
resolved: TCode | undefined;
|
|
35
|
+
error: Error0;
|
|
36
|
+
isPublic: boolean;
|
|
37
|
+
}) => unknown);
|
|
38
|
+
deserialize: false | ((options: {
|
|
39
|
+
value: unknown;
|
|
40
|
+
record: Record<string, unknown>;
|
|
41
|
+
}) => TCode | undefined);
|
|
42
|
+
} & {
|
|
43
|
+
init?: undefined;
|
|
44
|
+
})>, Record<never, never>>;
|
|
7
45
|
|
|
8
46
|
export { codePlugin };
|
|
@@ -1,25 +1,67 @@
|
|
|
1
|
-
import { Error0, PluginError0
|
|
1
|
+
import { Error0, PluginError0 } from '../index.cjs';
|
|
2
2
|
|
|
3
3
|
declare const expectedPlugin: <TError extends Error0>({ isPublic, override, }?: {
|
|
4
4
|
isPublic?: boolean;
|
|
5
5
|
override?: (error: TError) => boolean | undefined;
|
|
6
|
-
}) => PluginError0<Record<never, never> & Record<"expected",
|
|
6
|
+
}) => PluginError0<Record<never, never> & Record<"expected", ({
|
|
7
|
+
resolve: (options: {
|
|
8
|
+
own: boolean | undefined;
|
|
9
|
+
flow: (boolean | undefined)[];
|
|
10
|
+
error: Error0;
|
|
11
|
+
}) => boolean;
|
|
12
|
+
serialize: false | ((options: {
|
|
13
|
+
own: boolean | undefined;
|
|
14
|
+
flow: (boolean | undefined)[];
|
|
15
|
+
resolved: boolean;
|
|
16
|
+
error: Error0;
|
|
17
|
+
isPublic: boolean;
|
|
18
|
+
}) => unknown);
|
|
19
|
+
deserialize: false | ((options: {
|
|
20
|
+
value: unknown;
|
|
21
|
+
record: Record<string, unknown>;
|
|
22
|
+
}) => boolean | undefined);
|
|
23
|
+
} & {
|
|
24
|
+
init: ((input: boolean) => boolean) | (() => boolean);
|
|
25
|
+
}) | ({
|
|
26
|
+
resolve: (options: {
|
|
27
|
+
own: boolean | undefined;
|
|
28
|
+
flow: (boolean | undefined)[];
|
|
29
|
+
error: Error0;
|
|
30
|
+
}) => boolean;
|
|
31
|
+
serialize: false | ((options: {
|
|
32
|
+
own: boolean | undefined;
|
|
33
|
+
flow: (boolean | undefined)[];
|
|
34
|
+
resolved: boolean;
|
|
35
|
+
error: Error0;
|
|
36
|
+
isPublic: boolean;
|
|
37
|
+
}) => unknown);
|
|
38
|
+
deserialize: false | ((options: {
|
|
39
|
+
value: unknown;
|
|
40
|
+
record: Record<string, unknown>;
|
|
41
|
+
}) => boolean | undefined);
|
|
42
|
+
} & {
|
|
43
|
+
init?: undefined;
|
|
44
|
+
})>, Record<never, never> & Record<"isExpected", (error: Error0 & {
|
|
7
45
|
expected: boolean;
|
|
8
46
|
} & {} & {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
expected: boolean | undefined;
|
|
12
|
-
};
|
|
13
|
-
<TKey extends "expected">(key: TKey): {
|
|
14
|
-
expected: boolean | undefined;
|
|
15
|
-
}[TKey];
|
|
47
|
+
resolve: () => {
|
|
48
|
+
expected: boolean;
|
|
16
49
|
};
|
|
50
|
+
} & {
|
|
51
|
+
own?: Partial<{
|
|
52
|
+
expected: boolean | undefined;
|
|
53
|
+
}> | undefined;
|
|
17
54
|
flow: <TKey extends "expected">(key: TKey) => {
|
|
18
55
|
expected: boolean | undefined;
|
|
19
56
|
}[TKey][];
|
|
20
|
-
|
|
21
|
-
|
|
57
|
+
assign: (props: Partial<{
|
|
58
|
+
expected: boolean | undefined;
|
|
59
|
+
}>) => Error0 & {
|
|
22
60
|
expected: boolean;
|
|
61
|
+
} & {} & {
|
|
62
|
+
resolve: () => {
|
|
63
|
+
expected: boolean;
|
|
64
|
+
};
|
|
23
65
|
};
|
|
24
66
|
} & {
|
|
25
67
|
readonly __pluginsMap?: {
|
|
@@ -1,7 +1,45 @@
|
|
|
1
|
-
import { PluginError0,
|
|
1
|
+
import { PluginError0, Error0 } from '../index.cjs';
|
|
2
2
|
|
|
3
3
|
declare const metaPlugin: ({ isPublic }?: {
|
|
4
4
|
isPublic?: boolean;
|
|
5
|
-
}) => PluginError0<Record<never, never> & Record<"meta",
|
|
5
|
+
}) => PluginError0<Record<never, never> & Record<"meta", ({
|
|
6
|
+
resolve: (options: {
|
|
7
|
+
own: Record<string, unknown> | undefined;
|
|
8
|
+
flow: (Record<string, unknown> | undefined)[];
|
|
9
|
+
error: Error0;
|
|
10
|
+
}) => Record<string, unknown> | undefined;
|
|
11
|
+
serialize: false | ((options: {
|
|
12
|
+
own: Record<string, unknown> | undefined;
|
|
13
|
+
flow: (Record<string, unknown> | undefined)[];
|
|
14
|
+
resolved: Record<string, unknown> | undefined;
|
|
15
|
+
error: Error0;
|
|
16
|
+
isPublic: boolean;
|
|
17
|
+
}) => unknown);
|
|
18
|
+
deserialize: false | ((options: {
|
|
19
|
+
value: unknown;
|
|
20
|
+
record: Record<string, unknown>;
|
|
21
|
+
}) => Record<string, unknown> | undefined);
|
|
22
|
+
} & {
|
|
23
|
+
init: ((input: Record<string, unknown>) => Record<string, unknown>) | (() => Record<string, unknown>);
|
|
24
|
+
}) | ({
|
|
25
|
+
resolve: (options: {
|
|
26
|
+
own: Record<string, unknown> | undefined;
|
|
27
|
+
flow: (Record<string, unknown> | undefined)[];
|
|
28
|
+
error: Error0;
|
|
29
|
+
}) => Record<string, unknown> | undefined;
|
|
30
|
+
serialize: false | ((options: {
|
|
31
|
+
own: Record<string, unknown> | undefined;
|
|
32
|
+
flow: (Record<string, unknown> | undefined)[];
|
|
33
|
+
resolved: Record<string, unknown> | undefined;
|
|
34
|
+
error: Error0;
|
|
35
|
+
isPublic: boolean;
|
|
36
|
+
}) => unknown);
|
|
37
|
+
deserialize: false | ((options: {
|
|
38
|
+
value: unknown;
|
|
39
|
+
record: Record<string, unknown>;
|
|
40
|
+
}) => Record<string, unknown> | undefined);
|
|
41
|
+
} & {
|
|
42
|
+
init?: undefined;
|
|
43
|
+
})>, Record<never, never>>;
|
|
6
44
|
|
|
7
45
|
export { metaPlugin };
|
|
@@ -30,9 +30,9 @@ const stackMergePlugin = ({
|
|
|
30
30
|
if (!isPublic && _isPublic) {
|
|
31
31
|
return void 0;
|
|
32
32
|
}
|
|
33
|
-
return error.causes().
|
|
34
|
-
return cause instanceof Error ? cause.stack :
|
|
35
|
-
}).
|
|
33
|
+
return error.causes().flatMap((cause) => {
|
|
34
|
+
return cause instanceof Error && cause.stack && typeof cause.stack === "string" ? cause.stack : [];
|
|
35
|
+
}).join(delimiter);
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/plugins/stack-merge.ts"],"sourcesContent":["import { Error0 } from '../index.js'\n\nexport const stackMergePlugin = ({\n isPublic = false,\n delimiter = '\\n',\n}: { isPublic?: boolean; delimiter?: string } = {}) =>\n Error0.plugin().stack({\n serialize: ({ error, isPublic: _isPublic }) => {\n if (!isPublic && _isPublic) {\n return undefined\n }\n return error\n .causes()\n .
|
|
1
|
+
{"version":3,"sources":["../../../src/plugins/stack-merge.ts"],"sourcesContent":["import { Error0 } from '../index.js'\n\nexport const stackMergePlugin = ({\n isPublic = false,\n delimiter = '\\n',\n}: { isPublic?: boolean; delimiter?: string } = {}) =>\n Error0.plugin().stack({\n serialize: ({ error, isPublic: _isPublic }) => {\n if (!isPublic && _isPublic) {\n return undefined\n }\n return error\n .causes()\n .flatMap((cause) => {\n return cause instanceof Error && cause.stack && typeof cause.stack === 'string' ? cause.stack : []\n })\n .join(delimiter)\n },\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAuB;AAEhB,MAAM,mBAAmB,CAAC;AAAA,EAC/B,WAAW;AAAA,EACX,YAAY;AACd,IAAgD,CAAC,MAC/C,gBAAO,OAAO,EAAE,MAAM;AAAA,EACpB,WAAW,CAAC,EAAE,OAAO,UAAU,UAAU,MAAM;AAC7C,QAAI,CAAC,YAAY,WAAW;AAC1B,aAAO;AAAA,IACT;AACA,WAAO,MACJ,OAAO,EACP,QAAQ,CAAC,UAAU;AAClB,aAAO,iBAAiB,SAAS,MAAM,SAAS,OAAO,MAAM,UAAU,WAAW,MAAM,QAAQ,CAAC;AAAA,IACnG,CAAC,EACA,KAAK,SAAS;AAAA,EACnB;AACF,CAAC;","names":[]}
|
|
@@ -1,9 +1,47 @@
|
|
|
1
|
-
import { PluginError0,
|
|
1
|
+
import { PluginError0, Error0 } from '../index.cjs';
|
|
2
2
|
|
|
3
3
|
declare const statusPlugin: <TStatuses extends Record<string, number> = Record<never, number>>({ isPublic, statuses, strict, }?: {
|
|
4
4
|
isPublic?: boolean;
|
|
5
5
|
statuses?: TStatuses;
|
|
6
6
|
strict?: boolean;
|
|
7
|
-
}) => PluginError0<Record<never, never> & Record<"status",
|
|
7
|
+
}) => PluginError0<Record<never, never> & Record<"status", ({
|
|
8
|
+
resolve: (options: {
|
|
9
|
+
own: number | undefined;
|
|
10
|
+
flow: (number | undefined)[];
|
|
11
|
+
error: Error0;
|
|
12
|
+
}) => number | undefined;
|
|
13
|
+
serialize: false | ((options: {
|
|
14
|
+
own: number | undefined;
|
|
15
|
+
flow: (number | undefined)[];
|
|
16
|
+
resolved: number | undefined;
|
|
17
|
+
error: Error0;
|
|
18
|
+
isPublic: boolean;
|
|
19
|
+
}) => unknown);
|
|
20
|
+
deserialize: false | ((options: {
|
|
21
|
+
value: unknown;
|
|
22
|
+
record: Record<string, unknown>;
|
|
23
|
+
}) => number | undefined);
|
|
24
|
+
} & {
|
|
25
|
+
init: ((input: number | Extract<keyof TStatuses, string>) => number | undefined) | (() => number | undefined);
|
|
26
|
+
}) | ({
|
|
27
|
+
resolve: (options: {
|
|
28
|
+
own: number | undefined;
|
|
29
|
+
flow: (number | undefined)[];
|
|
30
|
+
error: Error0;
|
|
31
|
+
}) => number | undefined;
|
|
32
|
+
serialize: false | ((options: {
|
|
33
|
+
own: number | undefined;
|
|
34
|
+
flow: (number | undefined)[];
|
|
35
|
+
resolved: number | undefined;
|
|
36
|
+
error: Error0;
|
|
37
|
+
isPublic: boolean;
|
|
38
|
+
}) => unknown);
|
|
39
|
+
deserialize: false | ((options: {
|
|
40
|
+
value: unknown;
|
|
41
|
+
record: Record<string, unknown>;
|
|
42
|
+
}) => number | undefined);
|
|
43
|
+
} & {
|
|
44
|
+
init?: undefined;
|
|
45
|
+
})>, Record<never, never>>;
|
|
8
46
|
|
|
9
47
|
export { statusPlugin };
|
|
@@ -27,19 +27,6 @@ const tagsPlugin = ({
|
|
|
27
27
|
tags,
|
|
28
28
|
strict = true
|
|
29
29
|
} = {}) => {
|
|
30
|
-
function hasTag(error, tag, policy) {
|
|
31
|
-
const tags2 = error.tags;
|
|
32
|
-
if (!tags2) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
if (Array.isArray(tag)) {
|
|
36
|
-
if (policy === "every") {
|
|
37
|
-
return tag.every((item) => tags2.includes(item));
|
|
38
|
-
}
|
|
39
|
-
return tag.some((item) => tags2.includes(item));
|
|
40
|
-
}
|
|
41
|
-
return tags2.includes(tag);
|
|
42
|
-
}
|
|
43
30
|
const isTag = (value) => typeof value === "string" && (!tags || !strict || tags.includes(value));
|
|
44
31
|
return import__.Error0.plugin().prop("tags", {
|
|
45
32
|
init: (input) => input,
|
|
@@ -64,7 +51,19 @@ const tagsPlugin = ({
|
|
|
64
51
|
}
|
|
65
52
|
return value.filter((item) => isTag(item));
|
|
66
53
|
}
|
|
67
|
-
}).method("hasTag",
|
|
54
|
+
}).method("hasTag", (error, tag, policy = "every") => {
|
|
55
|
+
const tags2 = error.tags;
|
|
56
|
+
if (!tags2) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
if (Array.isArray(tag)) {
|
|
60
|
+
if (policy === "every") {
|
|
61
|
+
return tag.every((item) => tags2.includes(item));
|
|
62
|
+
}
|
|
63
|
+
return tag.some((item) => tags2.includes(item));
|
|
64
|
+
}
|
|
65
|
+
return tags2.includes(tag);
|
|
66
|
+
});
|
|
68
67
|
};
|
|
69
68
|
// Annotate the CommonJS export names for ESM import in node:
|
|
70
69
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/plugins/tags.ts"],"sourcesContent":["import { Error0 } from '../index.js'\n\nexport const tagsPlugin = <TTag extends string>({\n isPublic = false,\n tags,\n strict = true,\n}: { isPublic?: boolean; tags?: TTag[] | readonly TTag[]; strict?: boolean } = {}) => {\n function hasTag(error: Error0, tag: TTag): boolean\n function hasTag(error: Error0, tag: TTag[], policy: 'every' | 'some'): boolean\n function hasTag(error: Error0, tag: TTag | TTag[], policy?: 'every' | 'some'): boolean {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/plugins/tags.ts"],"sourcesContent":["import { Error0 } from '../index.js'\n\nexport const tagsPlugin = <TTag extends string>({\n isPublic = false,\n tags,\n strict = true,\n}: { isPublic?: boolean; tags?: TTag[] | readonly TTag[]; strict?: boolean } = {}) => {\n // function hasTag(error: Error0, tag: TTag): boolean\n // function hasTag(error: Error0, tag: TTag[], policy: 'every' | 'some'): boolean\n // function hasTag(error: Error0, tag: TTag | TTag[], policy?: 'every' | 'some'): boolean {\n // const tags = (error as any).tags as string[] | undefined\n // if (!tags) {\n // return false\n // }\n // if (Array.isArray(tag)) {\n // if (policy === 'every') {\n // return tag.every((item) => tags.includes(item))\n // }\n // return tag.some((item) => tags.includes(item))\n // }\n // return tags.includes(tag)\n // }\n const isTag = (value: unknown): value is TTag =>\n typeof value === 'string' && (!tags || !strict || tags.includes(value as TTag))\n return Error0.plugin()\n .prop('tags', {\n init: (input: string[]) => input,\n resolve: ({ flow }) => {\n const merged: string[] = []\n for (const value of flow) {\n if (Array.isArray(value)) {\n merged.push(...value)\n }\n }\n return merged.length > 0 ? Array.from(new Set(merged)) : undefined\n },\n serialize: ({ resolved, isPublic: _isPublic }) => {\n if (!isPublic && _isPublic) {\n return undefined\n }\n return resolved\n },\n deserialize: ({ value }) => {\n if (!Array.isArray(value)) {\n return undefined\n }\n return value.filter((item) => isTag(item))\n },\n })\n .method('hasTag', (error, tag: TTag | TTag[], policy: 'every' | 'some' = 'every'): boolean => {\n const tags = error.tags\n if (!tags) {\n return false\n }\n if (Array.isArray(tag)) {\n if (policy === 'every') {\n return tag.every((item) => tags.includes(item))\n }\n return tag.some((item) => tags.includes(item))\n }\n return tags.includes(tag)\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAuB;AAEhB,MAAM,aAAa,CAAsB;AAAA,EAC9C,WAAW;AAAA,EACX;AAAA,EACA,SAAS;AACX,IAA+E,CAAC,MAAM;AAgBpF,QAAM,QAAQ,CAAC,UACb,OAAO,UAAU,aAAa,CAAC,QAAQ,CAAC,UAAU,KAAK,SAAS,KAAa;AAC/E,SAAO,gBAAO,OAAO,EAClB,KAAK,QAAQ;AAAA,IACZ,MAAM,CAAC,UAAoB;AAAA,IAC3B,SAAS,CAAC,EAAE,KAAK,MAAM;AACrB,YAAM,SAAmB,CAAC;AAC1B,iBAAW,SAAS,MAAM;AACxB,YAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,iBAAO,KAAK,GAAG,KAAK;AAAA,QACtB;AAAA,MACF;AACA,aAAO,OAAO,SAAS,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI;AAAA,IAC3D;AAAA,IACA,WAAW,CAAC,EAAE,UAAU,UAAU,UAAU,MAAM;AAChD,UAAI,CAAC,YAAY,WAAW;AAC1B,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AAAA,IACA,aAAa,CAAC,EAAE,MAAM,MAAM;AAC1B,UAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AACzB,eAAO;AAAA,MACT;AACA,aAAO,MAAM,OAAO,CAAC,SAAS,MAAM,IAAI,CAAC;AAAA,IAC3C;AAAA,EACF,CAAC,EACA,OAAO,UAAU,CAAC,OAAO,KAAoB,SAA2B,YAAqB;AAC5F,UAAMA,QAAO,MAAM;AACnB,QAAI,CAACA,OAAM;AACT,aAAO;AAAA,IACT;AACA,QAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,UAAI,WAAW,SAAS;AACtB,eAAO,IAAI,MAAM,CAAC,SAASA,MAAK,SAAS,IAAI,CAAC;AAAA,MAChD;AACA,aAAO,IAAI,KAAK,CAAC,SAASA,MAAK,SAAS,IAAI,CAAC;AAAA,IAC/C;AACA,WAAOA,MAAK,SAAS,GAAG;AAAA,EAC1B,CAAC;AACL;","names":["tags"]}
|
|
@@ -1,12 +1,80 @@
|
|
|
1
|
-
import { PluginError0,
|
|
1
|
+
import { PluginError0, Error0 } from '../index.cjs';
|
|
2
2
|
|
|
3
3
|
declare const tagsPlugin: <TTag extends string>({ isPublic, tags, strict, }?: {
|
|
4
4
|
isPublic?: boolean;
|
|
5
5
|
tags?: TTag[] | readonly TTag[];
|
|
6
6
|
strict?: boolean;
|
|
7
|
-
}) => PluginError0<Record<never, never> & Record<"tags",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
}) => PluginError0<Record<never, never> & Record<"tags", ({
|
|
8
|
+
resolve: (options: {
|
|
9
|
+
own: string[] | undefined;
|
|
10
|
+
flow: (string[] | undefined)[];
|
|
11
|
+
error: Error0;
|
|
12
|
+
}) => string[] | undefined;
|
|
13
|
+
serialize: false | ((options: {
|
|
14
|
+
own: string[] | undefined;
|
|
15
|
+
flow: (string[] | undefined)[];
|
|
16
|
+
resolved: string[] | undefined;
|
|
17
|
+
error: Error0;
|
|
18
|
+
isPublic: boolean;
|
|
19
|
+
}) => unknown);
|
|
20
|
+
deserialize: false | ((options: {
|
|
21
|
+
value: unknown;
|
|
22
|
+
record: Record<string, unknown>;
|
|
23
|
+
}) => string[] | undefined);
|
|
24
|
+
} & {
|
|
25
|
+
init: ((input: string[]) => string[]) | (() => string[]);
|
|
26
|
+
}) | ({
|
|
27
|
+
resolve: (options: {
|
|
28
|
+
own: string[] | undefined;
|
|
29
|
+
flow: (string[] | undefined)[];
|
|
30
|
+
error: Error0;
|
|
31
|
+
}) => string[] | undefined;
|
|
32
|
+
serialize: false | ((options: {
|
|
33
|
+
own: string[] | undefined;
|
|
34
|
+
flow: (string[] | undefined)[];
|
|
35
|
+
resolved: string[] | undefined;
|
|
36
|
+
error: Error0;
|
|
37
|
+
isPublic: boolean;
|
|
38
|
+
}) => unknown);
|
|
39
|
+
deserialize: false | ((options: {
|
|
40
|
+
value: unknown;
|
|
41
|
+
record: Record<string, unknown>;
|
|
42
|
+
}) => string[] | undefined);
|
|
43
|
+
} & {
|
|
44
|
+
init?: undefined;
|
|
45
|
+
})>, Record<never, never> & Record<"hasTag", (error: Error0 & {
|
|
46
|
+
tags: string[] | undefined;
|
|
47
|
+
} & {} & {
|
|
48
|
+
resolve: () => {
|
|
49
|
+
tags: string[] | undefined;
|
|
50
|
+
};
|
|
51
|
+
} & {
|
|
52
|
+
own?: Partial<{
|
|
53
|
+
tags: string[] | undefined;
|
|
54
|
+
}> | undefined;
|
|
55
|
+
flow: <TKey extends "tags">(key: TKey) => {
|
|
56
|
+
tags: string[] | undefined;
|
|
57
|
+
}[TKey][];
|
|
58
|
+
assign: (props: Partial<{
|
|
59
|
+
tags: string[] | undefined;
|
|
60
|
+
}>) => Error0 & {
|
|
61
|
+
tags: string[] | undefined;
|
|
62
|
+
} & {} & {
|
|
63
|
+
resolve: () => {
|
|
64
|
+
tags: string[] | undefined;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
} & {
|
|
68
|
+
readonly __pluginsMap?: {
|
|
69
|
+
props: {
|
|
70
|
+
tags: {
|
|
71
|
+
init: string[] | undefined;
|
|
72
|
+
output: string[];
|
|
73
|
+
resolve: string[] | undefined;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
methods: {};
|
|
77
|
+
} | undefined;
|
|
78
|
+
}, tag: TTag | TTag[], policy?: "every" | "some") => boolean>>;
|
|
11
79
|
|
|
12
80
|
export { tagsPlugin };
|