UNPKG

551 BTypeScriptView Raw
1import { ValidationArguments } from './ValidationArguments';
2/**
3 * Custom validators must implement this interface to provide custom validation logic.
4 */
5export interface ValidatorConstraintInterface {
6 /**
7 * Method to be called to perform custom validation over given value.
8 */
9 validate(value: any, validationArguments?: ValidationArguments): Promise<boolean> | boolean;
10 /**
11 * Gets default message when validation for this constraint fail.
12 */
13 defaultMessage?(validationArguments?: ValidationArguments): string;
14}