import type { ControlBehaviorBase, ControlBehaviorReturn } from '../../../Controls/Behaviors/Abstracts/Behavior'; import type { CustomElement } from '../../../Controls/Components/Abstracts/CustomElement'; import type { IFormAssociated } from '../../Behaviors/FormAssociated'; import type { ControlValidatorBase } from '../Abstracts/ControlValidatorBase'; import type { ElementValidatorFn } from '../VNext/Abstracts/Interfaces/IElementValidator'; /** * Represents the `IValidateable` interface. * * @public */ export interface IValidateable { validators: Array; /** * Returns a ValidityState object that represents the validity states of the element. */ readonly validity: ValidityState & Readonly>; /** * Returns a validation error message or an empty string if the element is valid. */ readonly validationMessage: string; /** * Returns whether an element will successfully validate based on forms validation rules and constraints. * Disabled and readonly elements will not validate. */ readonly willValidate: boolean; /** * Checks the element's constraint validation and returns true if the element is valid or false if not. * If invalid, this method will dispatch an `invalid` event. * * @return true if the element is valid, or false if not. */ checkValidity(): boolean; /** * Checks the element's constraint validation and returns true if the element * is valid or false if not. * * If invalid, this method will dispatch a cancelable `invalid` event. If not * canceled, a the current `validationMessage` will be reported to the user. * * @return true if the element is valid, or false if not. */ reportValidity(): boolean; /** * Sets the element's constraint validation error message. When set to a * non-empty string, `validity.customError` will be true and * `validationMessage` will display the provided error. * * Use this method to customize error messages reported. * * @param error - The error message to display, or an empty string. */ setCustomValidity(error: string): void; /** * Creates and returns a `Validator` that is used to compute and cache * validity for the element. * * A validator that caches validity is important since constraint validation * must be computed synchronously and frequently in response to constraint * validation property changes. */ createValidator(): ControlValidatorBase; /** * Returns shadow DOM child that is used as the anchor for the platform * `reportValidity()` popup. This is often the root element or the inner * focus-delegated element. */ getValidityAnchor(): HTMLElement | null; } /** * @public */ export declare const Validateable: >(base: T) => ControlBehaviorReturn; //# sourceMappingURL=Validateable.d.ts.map