import { Validatable, Validator } from './types'; /** Each item in the array is a validatable */ export declare type ValidatableArray = Validatable[]; /** * Makes it easier to work with dynamically maintained array */ export declare class FormStateLazy implements Validatable { /** It is a function as fields can change over time */ protected getFields: () => TValue; get $(): TValue; constructor( /** It is a function as fields can change over time */ getFields: () => TValue); validating: boolean; protected _validators: Validator[]; validators(...validators: Validator[]): this; validate(): Promise<{ hasError: true; } | { hasError: false; value: TValue; }>; enableAutoValidation(): void; disableAutoValidation(): void; protected _error: string | null | undefined; /** * Does any field or form have an error */ get hasError(): boolean; /** * Does any field have an error */ get hasFieldError(): boolean; /** * Does form level validation have an error */ get hasFormError(): boolean; /** * Call it when you are `reinit`ing child fields */ clearFormError(): void; /** * Error from some sub field if any */ get fieldError(): string | null | undefined; /** * Error from form if any */ get formError(): string | null | undefined; /** * The first error from any sub (if any) or form error */ get error(): string | null | undefined; /** * You should only show the form error if there are no field errors */ get showFormError(): boolean; }