UNPKG

756 BTypeScriptView Raw
1import { Struct } from './struct';
2/**
3 * Augment a `Struct` to add an additional coercion step to its input.
4 */
5export declare function coercion<T>(struct: Struct<T>, coercer: Struct<T>['coercer']): Struct<T>;
6/**
7 * Augment a struct to coerce a default value for missing values.
8 *
9 * Note: You must use `coerce(value, Struct)` on the value before validating it
10 * to have the value defaulted!
11 */
12export declare function defaulted<T>(S: Struct<T>, fallback: any, strict?: true): Struct<T>;
13/**
14 * Coerce a value to mask its properties to only that defined in the struct.
15 */
16export declare function masked<T extends {
17 [key: string]: any;
18}, V extends Record<string, Struct<any>>>(S: Struct<T, V>): Struct<T>;
19//# sourceMappingURL=coercions.d.ts.map
\No newline at end of file