import { AriaButtonProps } from '../button/useButton'; import { AriaLabelingProps, DOMAttributes, DOMProps, InputDOMProps, KeyboardDelegate, LayoutDelegate, RefObject, ValidationResult } from '@react-types/shared'; import { AriaListBoxOptions } from '../listbox/useListBox'; import { ComboBoxProps, ComboBoxState, SelectionMode } from 'react-stately/useComboBoxState'; import { InputHTMLAttributes } from 'react'; export interface AriaComboBoxProps extends ComboBoxProps, DOMProps, InputDOMProps, AriaLabelingProps { /** Whether keyboard navigation is circular. */ shouldFocusWrap?: boolean; } export interface AriaComboBoxOptions extends Omit, 'children'> { /** The ref for the input element. */ inputRef: RefObject; /** The ref for the list box popover. */ popoverRef: RefObject; /** The ref for the list box. */ listBoxRef: RefObject; /** The ref for the optional list box popup trigger button. */ buttonRef?: RefObject; /** An optional keyboard delegate implementation, to override the default. */ keyboardDelegate?: KeyboardDelegate; /** * A delegate object that provides layout information for items in the collection. * By default this uses the DOM, but this can be overridden to implement things like * virtualized scrolling. */ layoutDelegate?: LayoutDelegate; } export interface ComboBoxAria extends ValidationResult { /** Props for the label element. */ labelProps: DOMAttributes; /** Props for the combo box input element. */ inputProps: InputHTMLAttributes; /** Props for the list box, to be passed to `useListBox`. */ listBoxProps: AriaListBoxOptions; /** Props for the optional trigger button, to be passed to `useButton`. */ buttonProps: AriaButtonProps; /** Props for the element representing the selected value. */ valueProps: DOMAttributes; /** Props for the combo box description element, if any. */ descriptionProps: DOMAttributes; /** Props for the combo box error message element, if any. */ errorMessageProps: DOMAttributes; } /** * Provides the behavior and accessibility implementation for a combo box component. * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query. * @param props - Props for the combo box. * @param state - State for the select, as returned by `useComboBoxState`. */ export declare function useComboBox(props: AriaComboBoxOptions, state: ComboBoxState): ComboBoxAria;