UNPKG

805 BTypeScriptView Raw
1/**
2 * `StructFailure` objects represent a specific failure in validation. They are
3 * used internally for validation and can be turned into real `StructError`
4 * objects when necessary.
5 */
6export declare class StructFailure {
7 branch: Array<any>;
8 path: Array<string | number>;
9 type: string;
10 value: any;
11 [key: string]: any;
12 constructor(props: {
13 value: any;
14 type: string;
15 branch: Array<any>;
16 path: Array<string | number>;
17 [key: string]: any;
18 });
19}
20/**
21 * Wrap every child `StructFailure` in an iterable so that they refer to the
22 * same failures but from the context of a parent value.
23 */
24export declare function wrap(iterable: Iterable<StructFailure>, value: any, key: string | number): Iterable<StructFailure>;