import { CommonValidatorBuilder , CommonValidatorBuilderImpl , DateValidatorBuilder , DateValidatorBuilderImpl , NumberValidatorBuilder , NumberValidatorBuilderImpl , StringValidationOptionsBuilder , StringValidatorBuilder , StringValidatorBuilderImpl , TypeValidatorBuilder , ValidationOptionsBuilder } from "./" ; import { ValidationRule } from "../validation" ; import { IsArrayValidator , IsBooleanValidator , IsDateValidator , IsNumberValidator , IsStringValidator } from "../validators/type-based" ; export class TypeValidatorBuilderImpl < T > extends CommonValidatorBuilderImpl < T , any > implements TypeValidatorBuilder < T > { constructor ( validationRule ) { super ( validationRule ) ; } isArray ( ) { this . validationRule . addValidator ( new IsArrayValidator ( ) ) ; return new CommonValidatorBuilderImpl < T , Array < any > > ( this . validationRule ) ; } isBoolean ( ) { this . validationRule . addValidator ( new IsBooleanValidator ( ) ) ; return new CommonValidatorBuilderImpl < T , boolean > ( this . validationRule ) ; } isDate ( ) { this . validationRule . addValidator ( new IsDateValidator ( ) ) ; return new DateValidatorBuilderImpl ( this . validationRule ) ; } isNumber ( ) { this . validationRule . addValidator ( new IsNumberValidator ( ) ) ; return new NumberValidatorBuilderImpl ( this . validationRule ) ; } isString ( ) { this . validationRule . addValidator ( new IsStringValidator ( ) ) ; return new StringValidatorBuilderImpl ( this . validationRule ) ; } }