Roqueform
    Preparing search index...

    Interface ValidationMixin<Options>

    The plugin that enables a field value validation.

    interface ValidationMixin<Options = any> {
        isInvalid?: boolean;
        isValidating: boolean;
        validation: null | Validation;
        abortValidation(): void;
        validate(options: Options): boolean;
        validateAsync(options: Options): Promise<boolean>;
    }

    Type Parameters

    • Options = any

      Options passed to the validator.

    Index

    Properties

    isInvalid?: boolean

    true if this field has an invalid value, or false otherwise.

    isValidating: boolean

    true if the validation is pending, or false otherwise.

    validation: null | Validation

    The pending validation, or null if there's no pending validation.

    Methods

    • Aborts the async validation of the current validation root field associated with this field. No-op if there's no pending validation.

      Returns void

    • Triggers a synchronous field validation.

      If this field is currently being validated then the validation is aborted at the current validation root.

      Transient descendants of this field are excluded from validation.

      Parameters

      Returns boolean

      true if the field is valid, or false if this field or any of it descendants have an associated error.

    • Triggers an asynchronous field validation.

      If this field is currently being validated then the validation is aborted at the current validation root.

      Transient descendants of this field are excluded from validation.

      Parameters

      Returns Promise<boolean>

      true if the field is valid, or false if this field or any of it descendants have an associated error.