validx
Version:
Validation library for MobX
17 lines (16 loc) • 400 B
TypeScript
import { IRule, IValidator } from '../validation';
export declare type Pattern = 'email' | 'url' | RegExp;
/**
* Rule specifics.
*
* @export
* @interface IPatternRule
* @extends {IRule<any>}
*/
export interface IPatternRule extends IRule {
pattern: Pattern;
}
/**
* The validator function.
*/
export declare const pattern: (rule: IPatternRule | Pattern, msg?: string) => IValidator<any>;