@jsxtools/aui
Version:
A baseline UI as Mixins, Custom Elements, React Components, etc.
22 lines (21 loc) • 872 B
TypeScript
import type { CustomElementConstructor } from "../api/dom.ts";
import { InternalsMixin } from "./internals.ts";
/** A mixin to provide form association and validation support to a custom element. */
export declare const FormAssociatedMixin: <T extends CustomElementConstructor>(Element: T) => T & FormAssociatedMixin.Constructor;
export declare namespace FormAssociatedMixin {
interface Constructor extends CustomElementConstructor<Mixin> {
}
interface Mixin extends InternalsMixin.Mixin {
defaultValue: string;
disabled: boolean;
form: HTMLFormElement | null;
name: string;
required: boolean;
validationMessage: string;
validity: ValidityState;
willValidate: boolean;
checkValidity(): boolean;
setCustomValidity(message: string): void;
reportValidity(): boolean;
}
}