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 { resolveTypeaheadMatch } from '../typeahead.js'; export { resolveTypeaheadMatch }; /** 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 for the listbox orientation: whether items flow vertically or horizontally. */ export declare const Orientation: S.Literals; export type Orientation = typeof Orientation.Type; /** Schema fields shared by all listbox 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 orientation: S.Literals; 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 searchQuery: S.String; readonly searchVersion: S.Number; readonly maybeLastPointerPosition: S.Option>; readonly maybeLastButtonPointerType: S.Option; }>; export type BaseModel = typeof BaseModel.Type; /** Configuration fields shared by all listbox variant `init` functions. */ export type BaseInitConfig = Readonly<{ id: string; isAnimated?: boolean; isModal?: boolean; orientation?: typeof Orientation.Type; }>; /** Creates the shared base fields for a listbox model from a config. Each variant spreads this and adds its selection field. */ export declare const baseInit: (config: BaseInitConfig) => BaseModel; /** Union of all messages the listbox component can produce. */ export declare const Message: import("foldkit/message").MessageUnion<{ readonly Opened: { readonly maybeActiveItemIndex: S.Option; }; readonly Closed: {}; readonly BlurredItems: {}; readonly ActivatedItem: { readonly index: S.Number; readonly activationTrigger: S.Literals; }; readonly DeactivatedItem: {}; readonly SelectedItem: { readonly item: S.String; }; readonly MovedPointerOverItem: { readonly index: S.Number; readonly screenX: S.Number; readonly screenY: S.Number; }; readonly RequestedItemClick: { readonly index: S.Number; }; readonly Searched: { readonly key: S.String; readonly maybeTargetIndex: S.Option; }; readonly CompletedDelayClearSearch: { readonly version: S.Number; }; readonly CompletedLockScroll: {}; readonly CompletedUnlockScroll: {}; readonly CompletedInertOthers: {}; readonly CompletedRestoreInert: {}; readonly CompletedFocusButton: {}; readonly CompletedFocusItems: {}; readonly CompletedScrollIntoView: {}; readonly CompletedClickItem: {}; readonly IgnoredMouseClick: {}; readonly SuppressedSpaceScroll: {}; readonly SuppressedItemCommit: {}; readonly CompletedAnchorListbox: {}; readonly CompletedPortalListboxBackdrop: {}; readonly GotAnimationMessage: { readonly message: import("foldkit/message").MessageUnion<{ readonly Showed: {}; readonly Hid: {}; readonly CompletedWaitForPaint: {}; readonly EndedAnimation: {}; }>; }; readonly PressedPointerOnButton: { readonly pointerType: S.String; readonly button: S.Number; }; }>; export type Opened = typeof Message.Opened.Type; export type Closed = typeof Message.Closed.Type; export type BlurredItems = typeof Message.BlurredItems.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 Searched = typeof Message.Searched.Type; export type CompletedDelayClearSearch = typeof Message.CompletedDelayClearSearch.Type; export type IgnoredMouseClick = typeof Message.IgnoredMouseClick.Type; export type SuppressedSpaceScroll = typeof Message.SuppressedSpaceScroll.Type; export type SuppressedItemCommit = typeof Message.SuppressedItemCommit.Type; export type PressedPointerOnButton = typeof Message.PressedPointerOnButton.Type; export type Message = typeof Message.Type; export type Selected = Readonly<{ readonly _tag: 'Selected'; readonly value: Value; }>; /** Union of out-messages the listbox component can produce. The parent folds `Selected` into the selection it owns: single-select stores the value, multi-select toggles the value's membership. */ export declare const OutMessage: import("foldkit/message").MessageUnion<{ readonly Selected: { readonly value: S.String; }; }>; /** Generic over `Value extends string` so consumers who create the listbox * via `Listbox.create()` receive `value: MyUnion` in the * `Selected` OutMessage from the factory's `update`, instead of * `value: string`. Defaults to `string`. */ export type OutMessage = Selected; export declare const SEARCH_DEBOUNCE_MILLISECONDS = 350; export declare const LEFT_MOUSE_BUTTON = 0; export declare const buttonSelector: (id: string) => string; /** Returns the bare DOM id of the listbox trigger button, derived from the * listbox's base id. Use this to associate an external label with the * trigger via a native `