import { EventEmitter } from '../stencil-public-runtime'; /** * Defines interface for form-associated components. * * Along with the interface, use the matching form utils to help set up the component behavior. */ export interface FormComponent { /** Fired only when value is committed (e.g. pressing the enter key). */ abdsChange: EventEmitter; /** Fired every time value changes. */ abdsInput?: EventEmitter; /** * The initial value for this form component. * When the form is reset, the value will be set to this property. */ defaultValue?: string; /** When true, this component's value will not be submitted in the form. */ disabled: boolean; /** The form this component is associated with. */ formEl?: HTMLFormElement; /** Hidden element used by forms for submissions. */ hiddenElement: HTMLInputElement | HTMLSelectElement; max?: string; maxlength?: string; min?: string; minlength?: string; /** The name used to submit the value to the associated form. */ name: string; /** Hook for components to provide custom form reset behavior. */ onFormReset?(): void; pattern?: string; /** Custom error message displayed on input maxLength validation failure. */ patternMessage?: string; readonly?: boolean; /** The host element. */ readonly host: HTMLElement; /** When true, form submit requests will enforce field requirement. */ required?: boolean; /** Custom error message displayed on input required validation failure. */ requiredMessage?: string; /** This form component's value. */ value: string; } export interface CheckableFormCompoment extends FormComponent { /** For boolean-valued components, this property defines whether the associated value is submitted to the form or not. */ checked: boolean; /** * The initial checked value for this form component. * * When the form is reset, the checked property will be set to this value. */ defaultChecked?: boolean; } export interface IndeterminateFormCompoment extends FormComponent { /** * The initial indeterminate value for this form component. * * When the form is reset, the indeterminate property will be set to this value. */ defaultIndeterminate?: boolean; /** A component's indeterminate state, a mix between checked and unchecked */ indeterminate?: boolean; } export interface HiddenFormElementSlotProps { component: FormComponent; type: string; }