import { Cre8Element } from './cre8-element'; import { type Cre8ElementInternals, type FormElementState } from './contexts/form-internals-context'; export { type Cre8ElementInternals, type FormElementState } from './contexts/form-internals-context'; /** * Base class for form-associated custom elements. * Provides ElementInternals context to descendant components. */ export declare abstract class Cre8FormElement extends Cre8Element { /** * @internal * Tells the browser to treat the element like a form field. * Ties the element to the HTML form it is in. */ static formAssociated: boolean; /** * The type of form control (text, checkbox, radio, etc.) */ abstract type: string; /** * @protected * @internal * Stores the value for the `value` getter and setter. */ protected internalValue: string; /** * The underlying HTML form field element. * Should be implemented with `@query` in extending classes. */ protected field?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLButtonElement; /** * @internal * Stores the initial value for form reset functionality */ protected defaultValue: string | boolean; /** * Provides ElementInternals to descendant components via context. * Descendants can consume this to access form participation APIs. */ _internals: Cre8ElementInternals; /** * Provides form element state to descendants via context. * Useful for nested components that need to react to form state. */ _formState: FormElementState; /** * The name of the form field */ name?: string; /** * Whether the field is disabled */ disabled?: boolean; /** * Whether the field is required */ required?: boolean; /** * Whether the field is in an error state */ isError?: boolean; /** * Whether the field is in a success state */ isSuccess?: boolean; /** * The value of the form field. */ get value(): string; /** * Sets the value of the form field. * 1. Stores the new value so it can be retrieved by the getter. * 2. Sets the current value of the control via ElementInternals. * 3. Updates the actual field element. * 4. Updates the form state context. * 5. Triggers a re-render. */ set value(newValue: string); /** * Updates the form state context for descendant consumption */ protected updateFormState(): void; /** * Updates the actual field element's value */ protected updateField(): void; /** * Lifecycle hook called after first render */ protected firstUpdated(): void; /** * Called when properties change */ protected updated(changedProperties: Map): void; /** * Form lifecycle callback - called when the form is reset */ formResetCallback(): void; /** * Form lifecycle callback - called when the element is disabled via fieldset */ formDisabledCallback(disabled: boolean): void; /** * Form lifecycle callback - called when form state is restored */ formStateRestoreCallback(state: string | FormData | null, _mode: 'restore' | 'autocomplete'): void; /** * Gets the form associated with this element */ get form(): HTMLFormElement | null; /** * Gets the validation message */ get validationMessage(): string; /** * Gets the validity state */ get validity(): ValidityState | undefined; /** * Gets whether the element will be validated */ get willValidate(): boolean; /** * Checks validity and reports to the user */ reportValidity(): boolean; /** * Checks validity without reporting */ checkValidity(): boolean; /** * Sets a custom validity message */ setCustomValidity(message: string): void; constructor(); } export default Cre8FormElement; //# sourceMappingURL=cre8-form-element.d.ts.map