com.phloxui
Version:
PhloxUI Ng2+ Framework
18 lines (17 loc) • 684 B
TypeScript
import { IValidator } from './IValidator';
import { ValidationResult } from '../model/ValidationResult';
/**
* <p style="text-indent: 2em;">
* An interface class of component classes which can be validated. A single <code>validatable</code> component may consist of
* multiple validators ([[IValidator]]). ... waiting for p'oil code refactoring before writing more docs ...
* </p>
*
* @author shiorin, tee4cute
*/
export interface IValidatable<T> {
addValidator(validator: IValidator<T>): boolean;
removeValidator(validator: IValidator<T>): boolean;
getValidators(): IValidator<T>[];
validate(value: T): ValidationResult[];
resetValidationResult(): void;
}