import type { ControlBehaviorBase, ControlBehaviorReturn } from '../../Controls/Behaviors/Abstracts/Behavior'; import type { CustomElement } from '../../Controls/Components/Abstracts/CustomElement'; import type { FormAssociatedConstructor } from '../../Types/Constructor'; import type { FormRestoreReason } from '../FormRestoreReason'; import type { FormRestoreState } from '../FormRestoreState'; import type { FormValue } from '../FormValue'; /** * Represents the `IFormAssociated` interface. * * @public */ export interface IFormAssociated { /** * The internals object of the element. */ readonly internals: ElementInternals; /** * The associated form element with which this element's value will submit. */ readonly form: HTMLFormElement | null; /** * The labels this element is associated with. */ readonly labels: NodeList; /** * The HTML name to use in form submission. */ name: string; /** * Whether or not the element is disabled. */ disabled: boolean; /** * Gets the current form value of a component. * * @return The current form value. */ getFormValue(): FormValue | null; /** * Gets the current form state of a component. Defaults to the component's `[formValue]`. * * Use this when the state of an element is different from its value, such as * checkboxes (internal boolean state and a user string value). * * @return The current form state, defaults to the form value. */ getFormState(): FormValue | null; /** * An optional callback for when the associated form changes. * * @param form - The new associated form, or `null` if there is none. */ formAssociatedCallback?(form: HTMLFormElement | null): void; /** * A callback for when a form component should be disabled or enabled. This * can be called in a variety of situations, such as disabled `