UNPKG

1.35 kBTypeScriptView Raw
1import { ValidationMetadataArgs } from './ValidationMetadataArgs';
2import { ValidationArguments } from '../validation/ValidationArguments';
3/**
4 * This metadata contains validation rules.
5 */
6export declare class ValidationMetadata {
7 /**
8 * Validation type.
9 */
10 type: string;
11 /**
12 * Target class to which this validation is applied.
13 */
14 target: Function | string;
15 /**
16 * Property of the object to be validated.
17 */
18 propertyName: string;
19 /**
20 * Constraint class that performs validation. Used only for custom validations.
21 */
22 constraintCls: Function;
23 /**
24 * Array of constraints of this validation.
25 */
26 constraints: any[];
27 /**
28 * Validation message to be shown in the case of error.
29 */
30 message: string | ((args: ValidationArguments) => string);
31 /**
32 * Validation groups used for this validation.
33 */
34 groups: string[];
35 /**
36 * Indicates if validation must be performed always, no matter of validation groups used.
37 */
38 always?: boolean;
39 /**
40 * Specifies if validated value is an array and each of its item must be validated.
41 */
42 each: boolean;
43 context?: any;
44 /**
45 * Extra options specific to validation type.
46 */
47 validationTypeOptions: any;
48 constructor(args: ValidationMetadataArgs);
49}
50
\No newline at end of file