zent
Version:
一套前端设计语言和基于React的实现
16 lines (15 loc) • 1.12 kB
TypeScript
import { ISyncValidator, IMaybeError, IValidator } from './validate';
export interface IWithLength {
length: number;
}
export declare const SYMBOL_REQUIRED: unique symbol;
export declare function markForRequired<T>(validator: IValidator<T>): void;
export declare function isRequiredValidator<T>(validator: IValidator<T>): boolean;
export declare function min(limit: number | string, message?: string): (value: number | string) => IMaybeError<number | string>;
export declare function max(limit: number, message?: string): (value: number | string) => IMaybeError<number | string>;
export declare function required(message?: string): ISyncValidator<any>;
export declare function requiredTrue(message?: string): ISyncValidator<boolean>;
export declare function email(message?: string): ISyncValidator<string>;
export declare function minLength<T extends IWithLength>(length: number, message?: string): ISyncValidator<T>;
export declare function maxLength<T extends IWithLength>(length: number, message?: string): ISyncValidator<T>;
export declare function pattern(regexp: RegExp, message?: string): ISyncValidator<string>;