import { on, type CSSMixinDescriptor, type Dispatched, type ElementProps, type Handle, type MixinFactory, type Props, type RemixNode } from '@remix-run/ui'; import * as listbox from '../listbox/listbox.ts'; import { type SearchValue } from '../../interactions/typeahead/typeahead-mixin.ts'; declare const COMBOBOX_CHANGE_EVENT: "rmx:combobox-change"; type ComboboxChangeHandler = (event: Dispatched, signal: AbortSignal) => void | Promise; type ShowReason = 'hint' | 'nav'; export declare const inputStyle: CSSMixinDescriptor; export declare const popoverStyle: CSSMixinDescriptor; declare global { interface HTMLElementEventMap { [COMBOBOX_CHANGE_EVENT]: ComboboxChangeEvent; } } export declare class ComboboxChangeEvent extends Event { readonly label: string | null; readonly optionId: string | null; readonly value: string | null; constructor({ label, optionId, value, }: { label: string | null; optionId: string | null; value: string | null; }); } export type ComboboxOpenStrategy = 'selected' | 'selected-or-none' | 'first' | 'last'; export interface ComboboxHandle { readonly activeOptionId: string | null; readonly id: string; readonly inputText: string; readonly isOpen: boolean; readonly label: string | null; readonly value: string | null; close: () => void; open: (strategy?: ComboboxOpenStrategy) => Promise; } export interface ComboboxContextProps { children?: RemixNode; defaultValue?: string | null; disabled?: boolean; name?: string; ref?: (handle: ComboboxHandle) => void; } export interface ComboboxProps extends Omit, 'children'> { children?: RemixNode; defaultValue?: string | null; disabled?: boolean; inputId?: string; name?: string; placeholder?: string; } export interface ComboboxOptionOptions { disabled?: boolean; label: string; searchValue?: SearchValue; value: string; } export interface ComboboxOptionProps extends Omit, 'children'> { children?: RemixNode; disabled?: boolean; label: string; searchValue?: SearchValue; value: string; } interface ComboboxContextValue { readonly activeId: string | undefined; readonly disabled: boolean; readonly filterText: string; readonly inputText: string; readonly isOpen: boolean; readonly listId: string; readonly name: string | undefined; readonly showReason: ShowReason; readonly surfaceVisible: boolean; readonly value: listbox.ListboxValue; clearInputSelection: () => void; close: () => void; handleBlur: () => void; handleEscape: () => void; navigateNext: () => void; navigatePrevious: () => void; open: (strategy?: ComboboxOpenStrategy) => Promise; openFromArrow: (direction: 'first' | 'last') => Promise; openFromInputActivation: () => Promise; registerInput: (node: HTMLInputElement) => void; registerSurface: (node: HTMLElement) => void; setInputText: (text: string) => Promise; syncPopoverMinWidth: () => void; selectActive: () => Promise; unregisterInput: (node: HTMLInputElement) => void; unregisterSurface: (node: HTMLElement) => void; } declare function ComboboxProvider(handle: Handle): () => RemixNode; declare const popoverMixin: MixinFactory; export declare const Context: typeof ComboboxProvider; export declare const hiddenInput: MixinFactory; export declare const input: MixinFactory; export declare const list: MixinFactory; export declare const option: MixinFactory; export { popoverMixin as popover }; export declare function onComboboxChange(handler: ComboboxChangeHandler, captureBoolean?: boolean): ReturnType>; export declare function Combobox(handle: Handle): () => RemixNode; export declare function ComboboxOption(handle: Handle): () => RemixNode;