import { Failure } from '../base'; import { ValidatorBase, ValidatorBaseConstructorParams } from './validatorBase'; import { TypeGuardWithContext } from './common'; import { Validator, ValidatorOptions } from './validator'; /** * Parameters used to construct a {@link Validation.Classes.TypeGuardValidator}. * @public */ export interface TypeGuardValidatorConstructorParams extends ValidatorBaseConstructorParams { guard: TypeGuardWithContext; description: string; } /** * An in-place {@link Validation.Validator | Validator} that can be instantiated using a type guard * function. * @public */ export declare class TypeGuardValidator extends ValidatorBase { /** * {@link Validation.ValidatorOptions | Options} which apply to this * validator. */ readonly options: ValidatorOptions; readonly description: string; protected readonly _guard: TypeGuardWithContext; /** * Constructs a new {@link Validation.Classes.TypeGuardValidator | TypeGuardValidator}. * @param params - Optional {@link Validation.Classes.TypeGuardValidatorConstructorParams | init params} for the * new {@link Validation.Classes.TypeGuardValidator | TypeGuardValidator}. */ constructor(params: TypeGuardValidatorConstructorParams); /** * Static method which validates that a supplied `unknown` value matches the supplied * type guard, returning a `Failure` containing more information about a failure. * @param from - Value to be converted. * @param context - Optional validation context. * @param self - Optional self-reference for recursive validation. * @returns `true` if `from` is valid, {@link Failure | Failure} * with an error message if `from` is invalid. * @internal */ protected _validate(from: unknown, context?: TC, self?: Validator): boolean | Failure; } //# sourceMappingURL=typeGuard.d.ts.map