UNPKG

980 BTypeScriptView Raw
1import { ValidatorConstraintInterface } from './validation/ValidatorConstraintInterface';
2import { ValidationOptions } from './decorator/ValidationOptions';
3export interface ValidationDecoratorOptions {
4 /**
5 * Target object to be validated.
6 */
7 target: Function;
8 /**
9 * Target object's property name to be validated.
10 */
11 propertyName: string;
12 /**
13 * Name of the validation that is being registered.
14 */
15 name?: string;
16 /**
17 * Indicates if this decorator will perform async validation.
18 */
19 async?: boolean;
20 /**
21 * Validator options.
22 */
23 options?: ValidationOptions;
24 /**
25 * Array of validation constraints.
26 */
27 constraints?: any[];
28 /**
29 * Validator that performs validation.
30 */
31 validator: ValidatorConstraintInterface | Function;
32}
33/**
34 * Registers a custom validation decorator.
35 */
36export declare function registerDecorator(options: ValidationDecoratorOptions): void;