import type { UmbVariantId } from '../../variant/index.js'; export interface UmbValidator extends EventTarget { /** * The path to the data that the validator is validating. */ /** * Validate the form, will return a promise that resolves if what the Validator represents is valid. */ validate(): Promise; /** * Validate the form by an array of variant IDs, will return a promise that resolves if what the Validator represents is valid. */ validateByVariantIds?: (variantIds: Array) => Promise; /** * Returns the variant ID that this validator is scoped to, if any. */ getVariantId?(): UmbVariantId | undefined; /** * Reset the validator to its initial state. */ reset(): void; /** * Returns true if the validator is valid. * This might represent last known state and might first be updated when validate() is called. */ isValid: boolean; /** * Focus the first invalid element. */ focusFirstInvalidElement(): void; destroy(): void; }