import { Failure } from '../base'; import { Validator, ValidatorOptions } from './validator'; import { ValidatorBase, ValidatorBaseConstructorParams } from './validatorBase'; /** * Parameters used to construct a {@link Validation.Classes.OneOfValidator | OneOfValidator}. * @public */ export interface OneOfValidatorConstructorParams extends ValidatorBaseConstructorParams { validators: Validator[]; } /** * An in-place {@link Validator | Validator} which validates that a supplied * value matches one of several other validators. * @public */ export declare class OneOfValidator extends ValidatorBase { /** * {@link Validation.ValidatorOptions | Options} which apply to this * validator. */ readonly options: ValidatorOptions; protected readonly _validators: Validator[]; /** * Constructs a new {@link Validation.Classes.OneOfValidator | OneOfValidator}. * @param params - Optional {@link Validation.Classes.OneOfValidatorConstructorParams | init params} for the * new {@link Validation.Classes.OneOfValidator | OneOfValidator}. */ constructor(params: OneOfValidatorConstructorParams); /** * Static method which validates that a supplied `unknown` value matches at least one * of the configured validators. * @param from - The `unknown` value to be tested. * @param context - Optional validation context will be propagated to element validator. * @param self - Optional self-reference for recursive validation. * @returns Returns `true` if `from` is an `array` of valid elements, or * {@link Failure} with an error message if not. */ protected _validate(from: unknown, context?: TC, self?: Validator): boolean | Failure; } //# sourceMappingURL=oneOf.d.ts.map