UNPKG

837 BTypeScriptView Raw
1import { ValidationArguments } from '../validation/ValidationArguments';
2/**
3 * Options used to pass to validation decorators.
4 */
5export interface ValidationOptions {
6 /**
7 * Specifies if validated value is an array and each of its items must be validated.
8 */
9 each?: boolean;
10 /**
11 * Error message to be used on validation fail.
12 * Message can be either string or a function that returns a string.
13 */
14 message?: string | ((validationArguments: ValidationArguments) => string);
15 /**
16 * Validation groups used for this validation.
17 */
18 groups?: string[];
19 /**
20 * Indicates if validation must be performed always, no matter of validation groups used.
21 */
22 always?: boolean;
23 context?: any;
24}
25export declare function isValidationOptions(val: any): val is ValidationOptions;
26
\No newline at end of file