/** The rule a value breaks: it picks the validity flag and the message reported to the form. */ type ValidityRule = 'cardNumber' | 'color' | 'email' | 'invalid' | 'invalidDate' | 'max' | 'maxDate' | 'maxlength' | 'min' | 'minDate' | 'minlength' | 'pattern' | 'required' | 'requiredSelect' | 'url' | 'vatNumber'; type ValidityProblem = { rule: ValidityRule; /** The values the message interpolates: `max`, `min`, `maxlength`, `minlength`. */ context?: Record; /** Replaces the built-in message, e.g. with the one of a custom validator. */ message?: string; }; /** The message of a problem, in the language of the page. */ declare const validityMessage: ({ rule, context, message }: ValidityProblem) => string; /** * Reports to the form the problem of a form-associated component, or clears it when there is * none: like a native control, an invalid component matches `:invalid` and stops the submit of * its form, which shows the message next to the anchor and focuses it. * @param internals the ElementInternals of the component * @param problem the rule the value breaks, `undefined` when the value is valid * @param anchor the control of the shadow tree the browser points the message at */ declare const updateValidity: (internals: ElementInternals, problem?: ValidityProblem, anchor?: HTMLElement) => void; export { updateValidity, validityMessage }; export type { ValidityProblem, ValidityRule };