import { Effect, Option, Schema as S } from 'effect'; import * as Command from 'foldkit/command'; import type { ChildAttribute, Html } from 'foldkit/html'; import * as Mount from 'foldkit/mount'; import { type View as SubmodelView } from 'foldkit/submodel'; import * as Update from 'foldkit/update'; import { AnchorConfig } from '../anchor/index.js'; import { groupContiguous } from '../group.js'; export { groupContiguous }; /** Schema for the activation trigger: whether the user interacted via mouse or keyboard. */ export declare const ActivationTrigger: S.Literals; export type ActivationTrigger = typeof ActivationTrigger.Type; /** Schema fields shared by all combobox variants (single-select and multi-select). Spread into each variant's `S.Struct` to avoid duplicating field definitions. */ export declare const BaseModel: S.Struct<{ readonly id: S.String; readonly isOpen: S.Boolean; readonly isAnimated: S.Boolean; readonly isModal: S.Boolean; readonly nullable: S.Boolean; readonly immediate: S.Boolean; readonly selectInputOnFocus: S.Boolean; readonly animation: S.Struct<{ readonly id: S.String; readonly isShowing: S.Boolean; readonly transitionState: S.Literals; }>; readonly maybeActiveItemIndex: S.Option; readonly activationTrigger: S.Literals; readonly inputValue: S.String; readonly maybeLastPointerPosition: S.Option>; }>; export type BaseModel = typeof BaseModel.Type; /** Configuration fields shared by all combobox variant `init` functions. */ export type BaseInitConfig = Readonly<{ id: string; isAnimated?: boolean; isModal?: boolean; nullable?: boolean; /** Emits `Selected` on every keyboard activation while open, so arrow keys * commit as they move instead of waiting for Enter. Combining `immediate` * with `nullable` is discouraged: a nullable toggle fold would deselect as * the arrows pass back over the selected item (see issue #693). Default * `false`. */ immediate?: boolean; selectInputOnFocus?: boolean; }>; /** Creates the shared base fields for a combobox model from a config. Each variant spreads this and adds its selection fields. */ export declare const baseInit: (config: BaseInitConfig) => BaseModel; /** Union of all messages the combobox component can produce. */ export declare const Message: import("foldkit/message").MessageUnion<{ readonly Opened: { readonly maybeActiveItemIndex: S.Option; }; readonly Closed: { readonly restingInputValue: S.String; readonly isClearable: S.Boolean; }; readonly BlurredInput: { readonly restingInputValue: S.String; readonly isClearable: S.Boolean; }; readonly ActivatedItem: { readonly index: S.Number; readonly activationTrigger: S.Literals; readonly maybeImmediateSelection: S.Option>; }; readonly DeactivatedItem: {}; readonly SelectedItem: { readonly item: S.String; readonly displayText: S.String; readonly wasSelected: S.Boolean; }; readonly MovedPointerOverItem: { readonly index: S.Number; readonly screenX: S.Number; readonly screenY: S.Number; }; readonly RequestedItemClick: { readonly index: S.Number; }; readonly SuppressedItemCommit: {}; readonly CompletedLockScroll: {}; readonly CompletedUnlockScroll: {}; readonly CompletedInertOthers: {}; readonly CompletedRestoreInert: {}; readonly CompletedFocusInput: {}; readonly CompletedScrollIntoView: {}; readonly CompletedClickItem: {}; readonly CompletedAnchorCombobox: {}; readonly CompletedAttachComboboxPreventBlur: {}; readonly CompletedAttachComboboxSelectOnFocus: {}; readonly CompletedPortalComboboxBackdrop: {}; readonly GotAnimationMessage: { readonly message: import("foldkit/message").MessageUnion<{ readonly Showed: {}; readonly Hid: {}; readonly CompletedWaitForPaint: {}; readonly EndedAnimation: {}; }>; }; readonly UpdatedInputValue: { readonly value: S.String; }; readonly PressedToggleButton: { readonly restingInputValue: S.String; readonly isClearable: S.Boolean; }; }>; export type Opened = typeof Message.Opened.Type; export type Closed = typeof Message.Closed.Type; export type BlurredInput = typeof Message.BlurredInput.Type; export type ActivatedItem = typeof Message.ActivatedItem.Type; export type DeactivatedItem = typeof Message.DeactivatedItem.Type; export type SelectedItem = typeof Message.SelectedItem.Type; export type MovedPointerOverItem = typeof Message.MovedPointerOverItem.Type; export type RequestedItemClick = typeof Message.RequestedItemClick.Type; export type SuppressedItemCommit = typeof Message.SuppressedItemCommit.Type; export type CompletedLockScroll = typeof Message.CompletedLockScroll.Type; export type CompletedUnlockScroll = typeof Message.CompletedUnlockScroll.Type; export type CompletedInertOthers = typeof Message.CompletedInertOthers.Type; export type CompletedRestoreInert = typeof Message.CompletedRestoreInert.Type; export type CompletedFocusInput = typeof Message.CompletedFocusInput.Type; export type CompletedScrollIntoView = typeof Message.CompletedScrollIntoView.Type; export type CompletedClickItem = typeof Message.CompletedClickItem.Type; export type UpdatedInputValue = typeof Message.UpdatedInputValue.Type; export type PressedToggleButton = typeof Message.PressedToggleButton.Type; export type Message = typeof Message.Type; export type Selected = Readonly<{ readonly _tag: 'Selected'; readonly value: Value; }>; export type ClearedSelection = typeof OutMessage.ClearedSelection.Type; /** Union of out-messages the combobox component can produce. The parent folds `Selected` into the selection it owns and clears that selection on `ClearedSelection`. */ export declare const OutMessage: import("foldkit/message").MessageUnion<{ readonly Selected: { readonly value: S.String; }; readonly ClearedSelection: {}; }>; /** Generic over `Value extends string` so consumers who create the combobox * via `Combobox.create()` receive `value: MyUnion` in the * `Selected` OutMessage from the factory's `update`, instead of * `value: string`. Defaults to `string`. */ export type OutMessage = Selected | ClearedSelection; /** Returns the bare DOM id of the combobox input, derived from the * combobox's base id. Use this to associate an external label with the * input via a native `