Skip to content

IObjectValidator

github-actions[bot] edited this page Dec 3, 2024 · 3 revisions
API / IObjectValidator<TValidatable, TValidationError> interface

Represents an object validator.

Extends IReadOnlyObjectValidator<TValidatable, TValidationError>.

interface IObjectValidator<TValidatable extends IValidatable<TValidationError> | INotifyPropertiesChanged, TValidationError = string>
    extends IReadOnlyObjectValidator<TValidatable, TValidationError>

Source reference: src/validation/objectValidator/IObjectValidator.ts:13.

Generic Parameters

  • TValidatable - The instance type that is being validated.

    Type constraints: IValidatable<TValidationError> & INotifyPropertiesChanged.

  • TValidationError - The concrete type for representing validation errors (strings, enums, numbers etc.).

    Default value: string.

Properties

  • readonly triggers - Gets the validation triggers that have been configured.
  • readonly validators - Gets the validators that have been configured.
  • inherited readonly target - Gets the object that is being validated.

Methods

  • add - Configures the given validators and validates the target afterwards.
  • reset - Resets the validator configuraiton, removes all triggers and validators and sets the error on the target to null.

Implementations

Clone this wiki locally