UNPKG

631 BTypeScriptView Raw
1import { Struct } from './struct';
2/**
3 * Augment a string or array struct to constrain its length to being between a
4 * minimum and maximum size.
5 */
6export declare function length<T extends string | any[]>(S: Struct<T>, min: number, max: number): Struct<T>;
7/**
8 * Refine a string struct to match a specific regexp pattern.
9 */
10export declare function pattern<T extends string>(S: Struct<T>, regexp: RegExp): Struct<T>;
11/**
12 * Augment a `Struct` to add an additional refinement to the validation.
13 */
14export declare function refinement<T>(struct: Struct<T>, type: string, refiner: Struct<T>['refiner']): Struct<T>;