import { type Accessor } from "solid-js"; import type { BaseUIChangeEventDetails, BaseUIGenericEventDetails, REASONS } from "../../internals/change-event-details.js"; import type { FloatingRootStore } from "../../internals/floating-ui/components/floating-root-store.js"; import type { UseInteractionsReturn } from "../../internals/floating-ui/hooks/use-interactions.js"; import type { MutableRef } from "../../internals/floating-ui/types.js"; import type { TransitionStatus } from "../../internals/use-transition-status/use-transition-status.js"; import type { ItemEqualityComparer } from "../internals/item-equality.js"; import type { Group } from "../internals/resolve-value-label.js"; import type { ComboboxSide } from "../positioner/positioner-context.js"; export type ComboboxRootChangeEventReason = typeof REASONS.triggerPress | typeof REASONS.outsidePress | typeof REASONS.escapeKey | typeof REASONS.focusOut | typeof REASONS.listNavigation | typeof REASONS.inputChange | typeof REASONS.inputClear | typeof REASONS.itemPress | typeof REASONS.clearPress | typeof REASONS.inputPress | typeof REASONS.chipRemovePress | typeof REASONS.none; export type ComboboxRootChangeEventDetails = BaseUIChangeEventDetails; export type ComboboxRootHighlightEventReason = "keyboard" | "pointer" | "none"; export type ComboboxRootHighlightEventDetails = BaseUIGenericEventDetails; /** * Shared state exposed through the root context. Accessors throughout so * consumers don't need to guard reactive reads. */ export interface ComboboxRootContextValue { id: Accessor; labelId: Accessor; setLabelId: (id: string | undefined) => void; open: Accessor; mounted: Accessor; transitionStatus: Accessor; inputValue: Accessor; setInputValue: (next: string, details: ComboboxRootChangeEventDetails) => void; /** * In single-select + `"none"` modes this is the single selected value (or * `null`); in multi-select mode it's an array of selected values. */ selectedValue: Accessor; setSelectedValue: (next: Value | Value[] | null, details: ComboboxRootChangeEventDetails) => void; /** Selection mode — drives chip/array vs. scalar semantics. */ selectionMode: Accessor<"none" | "single" | "multiple">; activeIndex: Accessor; selectedIndex: Accessor; setIndices: (options: { activeIndex?: number | null | undefined; selectedIndex?: number | null | undefined; type?: ComboboxRootHighlightEventReason | undefined; }) => void; disabled: Accessor; readOnly: Accessor; required: Accessor; autoHighlightMode: Accessor; highlightItemOnHover: Accessor; modal: Accessor; loopFocus: Accessor; openOnInputClick: Accessor; /** * Whether list items are presented as a grid. See `grid` prop on * ``. */ grid: Accessor; /** * Whether items are externally virtualized. See `virtualized` prop on * ``. */ virtualized: Accessor; itemToStringLabel: Accessor<((item: Value) => string) | undefined>; itemToStringValue: Accessor<((item: Value) => string) | undefined>; isItemEqualToValue: Accessor>; items: Accessor[] | undefined>; filteredItems: Accessor[]>; flatFilteredItems: Accessor; query: Accessor; matchesQuery: (value: Value) => boolean; setItemVisible: (token: symbol, visible: boolean) => void; visibleItemCount: Accessor; listRef: MutableRef>; labelsRef: MutableRef>; popupRef: MutableRef; inputRef: MutableRef; emptyRef: MutableRef; clearRef: MutableRef; valuesRef: MutableRef; allValuesRef: MutableRef; /** Host ref for ``. Used by dismiss outside-press filter. */ chipsContainerRef: MutableRef; triggerElement: Accessor; setTriggerElement: (el: HTMLElement | null) => void; inputElement: Accessor; setInputElement: (el: HTMLInputElement | null) => void; listElement: Accessor; setListElement: (el: HTMLElement | null) => void; positionerElement: Accessor; setPositionerElement: (el: HTMLElement | null) => void; popupSide: Accessor; setPopupSide: (side: ComboboxSide | null) => void; setOpen: (next: boolean, details: ComboboxRootChangeEventDetails) => void; handleSelection: (event: MouseEvent | PointerEvent | KeyboardEvent, value?: Value) => void; forceMount: () => void; floatingRootContext: FloatingRootStore; interactions: UseInteractionsReturn; keyboardActiveRef: MutableRef; } export declare const ComboboxRootContext: import("solid-js").Context | null>; export declare function useComboboxRootContext(): ComboboxRootContextValue; export declare function useComboboxRootContext(optional: true): ComboboxRootContextValue | null; //# sourceMappingURL=combobox-root-context.d.ts.map