/** * Headless single-select controller. */ import type { MdyReactivity } from "@modyra/core"; import type { MdyWidgetController } from "../contract.js"; import type { MdySelectOption } from "@modyra/core"; import type { MdySelectControllerOptions, MdySelectIntent, MdySelectState } from "./select-types.js"; export interface MdySelectController extends MdyWidgetController, MdySelectIntent> { /** Set the selected value programmatically (e.g. from a form patch). */ setValue(value: TValue | null): void; /** Replace the option list (e.g. async loading finished). */ setOptions(options: readonly MdySelectOption[]): void; /** Update the open state programmatically without emitting commands. */ setOpen(open: boolean): void; /** Update the disabled state. */ setDisabled(disabled: boolean): void; /** Update the readonly state. */ setReadonly(readonly: boolean): void; /** Update the invalid state. */ setInvalid(invalid: boolean): void; /** * Whether the form is asking for an answer here. * * A combobox carries none of a field's rules on its own, so a required select announced nothing * about being required while its two siblings said so — each renderer deciding for itself what * the contract had not. */ setRequired(required: boolean): void; /** Update the loading state. */ setLoading(loading: boolean): void; /** Which of the field's descriptions are on screen, so the trigger names one that exists. */ setDescribedBy(next: { errorsVisible?: boolean; descriptionVisible?: boolean; }): void; /** Whether the listbox is mounted, so the trigger controls something that exists. */ setPopupRendered(rendered: boolean): void; } export declare function createSelectController(options: MdySelectControllerOptions, reactivity?: MdyReactivity): MdySelectController;