import { IsEmailOptions, IsFQDNOptions, IsFloatOptions, IsURLOptions, IsIntOptions, IsCurrencyOptions } from "../ValidationOptions"; /** * Options used to pass to validation decorators. */ export interface ValidationOptions { /** * Specifies if validated value is an array and each of its item must be validated. */ each?: boolean; /** * Message used to be shown on validation fail. */ message?: string; /** * Validation groups used for this validation. */ groups?: string[]; /** * Indicates if validation must be performed always, no matter of validation groups used. */ always?: boolean; } /** * Decorator used to register custom validators. */ export declare function ValidatorConstraint(): (object: Function) => void; /** * Performs validation based on the given custom validation class. */ export declare function Validate(constraintClass: Function, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string contains the seed. */ export declare function Contains(seed: string, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string matches the comparison. */ export declare function Equals(comparison: string, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a date that's after the specified date. */ export declare function IsAfter(date: Date, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string contains only letters (a-zA-Z). */ export declare function IsAlpha(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string contains only letters and numbers. */ export declare function IsAlphanumeric(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string contains ASCII chars only. */ export declare function IsAscii(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if a string is base64 encoded. */ export declare function IsBase64(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a date that's before the specified date. */ export declare function IsBefore(date: Date, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if a value is a boolean. */ export declare function IsBoolean(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if a string is a boolean. */ export declare function IsBooleanString(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string's length (in bytes) falls in a range. */ export declare function IsByteLength(min: number, max?: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a credit card. */ export declare function IsCreditCard(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a valid currency amount. */ export declare function IsCurrency(options?: IsCurrencyOptions, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a date. */ export declare function IsDate(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc. */ export declare function IsDecimal(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a number that's divisible by another. */ export declare function IsDivisibleBy(num: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is an email. */ export declare function IsEmail(options?: IsEmailOptions, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a fully qualified domain name (e.g. domain.com). */ export declare function IsFQDN(options?: IsFQDNOptions, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a float. */ export declare function IsFloat(options?: IsFloatOptions, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string contains any full-width chars. */ export declare function IsFullWidth(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string contains any half-width chars. */ export declare function IsHalfWidth(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string contains a mixture of full and half-width chars. */ export declare function IsVariableWidth(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a hexadecimal color. */ export declare function IsHexColor(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a hexadecimal number. */ export declare function IsHexadecimal(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is an IP (version 4 or 6). */ export declare function IsIP(version?: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is an ISBN (version 10 or 13). */ export declare function IsISBN(version?: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is an ISIN (stock/security identifier). */ export declare function IsISIN(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a valid ISO 8601 date. */ export declare function IsISO8601(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is in a array of allowed values. */ export declare function IsIn(values: any[], annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is an integer. */ export declare function IsInt(options?: IsIntOptions, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is valid JSON (note: uses JSON.parse). */ export declare function IsJSON(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string's length falls in a range. Note: this function takes into account surrogate pairs. */ export declare function IsLength(min: number, max?: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is lowercase. */ export declare function IsLowercase(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a mobile phone number (locale is one of ['zh-CN', 'zh-TW', 'en-ZA', 'en-AU', 'en-HK', * 'pt-PT', 'fr-FR', 'el-GR', 'en-GB', 'en-US', 'en-ZM', 'ru-RU', 'nb-NO', 'nn-NO', 'vi-VN', 'en-NZ']). */ export declare function IsMobilePhone(locale: string, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. */ export declare function IsMongoId(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string contains one or more multibyte chars. */ export declare function IsMultibyte(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is null. */ export declare function IsNull(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is numeric. */ export declare function IsNumeric(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string contains any surrogate pairs chars. */ export declare function IsSurrogatePair(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a fully qualified domain name (e.g. domain.com). */ export declare function IsUrl(options?: IsURLOptions, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is a UUID (version 3, 4 or 5). */ export declare function IsUUID(version?: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string is uppercase. */ export declare function IsUppercase(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if string matches the pattern. Either matches('foo', /foo/i) or matches('foo', 'foo', 'i'). */ export declare function Matches(pattern: RegExp, annotationOptions?: ValidationOptions): Function; export declare function Matches(pattern: RegExp, modifiers?: string, annotationOptions?: ValidationOptions): Function; /** * Checks if the string's length is not less then given number. Note: this function takes into account surrogate pairs. */ export declare function MinLength(min: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the string's length is not more then given number. Note: this function takes into account surrogate pairs. */ export declare function MaxLength(max: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the given number is not less then given number. */ export declare function MinNumber(min: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if the given number is not more then given number. */ export declare function MaxNumber(max: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if given value is not empty. */ export declare function NotEmpty(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if given array is not empty. */ export declare function NotEmptyArray(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if array's length is as minimal this number. */ export declare function MinSize(min: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if array's length is as maximal this number. */ export declare function MaxSize(max: number, annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void; /** * Checks if array's length is as maximal this number. */ export declare function ValidateNested(annotationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;