nowjs-core
Version:
NowCanDo Javascript Core [nowjs-core] is a library written by TypeScript code maintains under Apache 2.0 licence
15 lines (14 loc) • 833 B
TypeScript
import { StringFormatType } from '../../utils/index';
import { ValidationContext, ValidatorBase } from '../index';
export declare const VALIDATOR_PATTERN_METADATA_KEY: unique symbol;
export declare function isPattern(pattern: RegExp, errorMessage?: StringFormatType): (target: Record<string, any>, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>) => void;
export declare class PatternValidatorBase extends ValidatorBase {
private pattern;
constructor(name: string, pattern: RegExp, errorMessage?: StringFormatType);
protected setPattern(pattern: RegExp): void;
get Pattern(): RegExp;
validate(context: ValidationContext<any, any>): Promise<boolean>;
}
export declare class PatternValidator extends PatternValidatorBase {
constructor(pattern: RegExp, errorMessage?: StringFormatType);
}