import { FormControlMetadata, FormControlValue } from '../internal/types.js'; type Constructor = (new (...args: any[]) => HTMLElement & { connectedCallback?(): void; disconnectedCallback?(): void; attributeChangedCallback?(name: string, oldValue: string | null, newValue: string | null): void; requestUpdate?(name?: string, oldValue?: unknown): void; }) & { observedAttributes?: string[]; }; export interface FormControlMixinInstance { /** * The initial value used when the parent form resets. */ defaultValue: string; /** * Prevents the user from changing the control value. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly * @attr readonly * @reflect */ readOnly: boolean; /** * Prevents the user from interacting with the control. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled * @attr disabled * @reflect */ disabled: boolean; /** * Requires a value before the parent form can submit. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required * @attr required * @reflect */ required: boolean; /** * Defines the pattern that text values must match. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern * @attr pattern * @reflect */ pattern: string; /** * Defines the minimum numeric value. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/min * @attr min * @reflect */ min: number | null; /** * Defines the maximum numeric value. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/max * @attr max * @reflect */ max: number | null; /** * Defines the value granularity for numeric inputs. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/step * @attr step * @reflect */ step: number | null; /** * Defines the minimum text length. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlength * @attr minlength * @reflect */ minLength: number; /** * Defines the maximum text length. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/maxlength * @attr maxlength * @reflect */ maxLength: number; /** * The name submitted with the control value as part of the form data. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/name * @attr name * @reflect */ name: string; /** * Disables constraint validation for this control. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/novalidate * @attr novalidate * @reflect */ noValidate: boolean; /** * The current form control value. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/value * @attr value * @reflect */ value: T | undefined; /** * The form associated with the control. * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/form */ form: HTMLFormElement | null; /** * Indicates whether the control participates in constraint validation. * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/willValidate */ willValidate: boolean; /** * The control validity state. * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/validity */ validity: ValidityState; /** * The validation message shown when the control is invalid. * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/validationMessage */ validationMessage: string; /** * The current value serialized as a string. */ valueAsString: string; /** * The current value parsed as a number. */ valueAsNumber: number; /** * The control type. */ type: string; /** * Labels associated with the control. * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/labels */ labels: NodeList; /** * Text content from labels associated with the control. */ composedLabel: string; _metadata: FormControlMetadata; _initialValue: T | undefined; _validators: NonNullable; _internals: ElementInternals; updateValue(value: T): void; _stopInternalPropagation(event: Event): void; _handleAttributeChange(name: string, newValue: string | null): void; formResetCallback(): void; formDisabledCallback(disabled: boolean): void; formStateRestoreCallback(state: T, reason: string): void; /** * Reports whether the control satisfies its constraints. * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity */ reportValidity(): boolean; /** * Checks whether the control satisfies its constraints. * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity */ checkValidity(): boolean; setValidity(validity: Partial, message?: string): void; /** * Sets a custom validation message. * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity */ setCustomValidity(message: string): void; /** * Resets the control value to its initial value. */ reset(): void; dispatchInputEvent(): void; dispatchChangeEvent(): void; dispatchUpdateEvent(type: 'input' | 'change'): void; _updateFormState(): void; _requestUpdate(): void; } export type FormControlMixinReturn = (new (...args: ConstructorParameters) => InstanceType & FormControlMixinInstance) & { formAssociated: boolean; metadata: FormControlMetadata; observedAttributes: string[]; } & Omit; /** * @description A mixin that adds form control functionality to a component. * @event input - Dispatched when the value of the component changes as a result of a user action. * @event change - Dispatched when the user modifies and commits the element's value. * @event reset - Dispatched when the control state was reset to its initial value. * @event invalid - Dispatched when the control is invalid. */ export declare function FormControlMixin(SuperClass: TBase): FormControlMixinReturn; export {};