UNPKG

node-web-mvc

Version:
29 lines (28 loc) 896 B
import ValidationContext from '../ValidationContext'; import Constraints from './Constraints'; declare class Pattern extends Constraints { message?: string; /** * 正则表达式 */ regexp: RegExp; isValid(value: any, context: ValidationContext): boolean; } /** * 通过正则表达式验证配置的元素值 * * 支持类型: * - `String` * * `null` 或者 `undefined` 不做验证 */ declare const _default: { (options: import("../../servlets/annotations/Target").CreateOptions<typeof Pattern>): (target: Object, name: string, p?: number) => any; (target: { [x: string]: any; }, propertyKey: string): any; (target: { [x: string]: any; }, propertyKey: string, parameterIndex: number): any; } & import("../../servlets/annotations/annotation/type").LinkAnnotationType<typeof Pattern> & typeof Pattern; export default _default;