UNPKG

nowjs-core

Version:

NowCanDo Javascript Core [nowjs-core] is a library written by TypeScript code maintains under Apache 2.0 licence

21 lines (20 loc) 1.35 kB
import { StringFormatType } from '../../utils/index'; import { ValidationContext, ValidatorBase } from '../index'; export declare const VALIDATOR_INRANGE_METADATA_KEY: unique symbol; export declare const VALIDATOR_INLENGTH_METADATA_KEY: unique symbol; export declare function isInRange(min: number | Date, max: number | Date, errorMessage?: StringFormatType): (target: Record<string, any>, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>) => void; export declare function isInLength(min: number | Date, max: number | Date, errorMessage?: StringFormatType): (target: Record<string, any>, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>) => void; export declare class InRangeValidatorBase extends ValidatorBase { private min; private max; constructor(name: string, min: number | Date, max: number | Date, errorMessage?: StringFormatType); get Min(): number | Date; get Max(): number | Date; validate(context: ValidationContext<any, any>): Promise<boolean>; } export declare class InRangeValidator extends InRangeValidatorBase { constructor(min: number | Date, max: number | Date, errorMessage?: StringFormatType); } export declare class InLengthValidator extends InRangeValidatorBase { constructor(min: number | Date, max: number | Date, errorMessage?: StringFormatType); }