UNPKG

998 BTypeScriptView Raw
1/**
2 * A `StructFailure` represents a single specific failure in validation.
3 */
4export declare type Failure = {
5 value: any;
6 key: any;
7 type: string;
8 refinement: string | undefined;
9 message: string;
10 branch: Array<any>;
11 path: Array<any>;
12};
13/**
14 * `StructError` objects are thrown (or returned) when validation fails.
15 *
16 * Validation logic is design to exit early for maximum performance. The error
17 * represents the first error encountered during validation. For more detail,
18 * the `error.failures` property is a generator function that can be run to
19 * continue validation and receive all the failures in the data.
20 */
21export declare class StructError extends TypeError {
22 value: any;
23 key: any;
24 type: string;
25 refinement: string | undefined;
26 path: Array<any>;
27 branch: Array<any>;
28 failures: () => Array<Failure>;
29 [x: string]: any;
30 constructor(failure: Failure, failures: () => Generator<Failure>);
31}
32//# sourceMappingURL=error.d.ts.map
\No newline at end of file