import type { ComboBoxProps } from "@react-types/combobox"; import type { LoadingState } from "@react-types/shared"; import React, { ReactNode } from "react"; import { Prettify } from "../../../utils/types"; export type AutocompleteProps = Prettify<{ /** An icon for the input field. Most likely, you want to use a magnifier glass here. */ icon?: ReactNode; /** * The loading state of the items. * * `loading` and `filtering` show a spinner inside the input field. * `loadingMore` shows a spinner inside the list box. * * Suggestion: use `useAsyncList` from `react-stately`, and the loading state will be handled for you for free. * */ loadingState?: LoadingState; /** The name of the form field. Useful for uncontrolled forms. */ name?: string; /** A callback for loading more items into the collection. */ onLoadMore?: () => void; /** * When the Autocomplete is mounted inside an element that scrolls, use this prop to pass a reference of the * scrolling element. This allows the Autocomplete to reposition its popover, if visible, when the content moves. */ scrollingContainer?: Element; } & ComboBoxProps>; declare const Autocomplete: ({ icon, scrollingContainer, ...props }: { icon?: ReactNode; loadingState?: LoadingState | undefined; name?: string | undefined; onLoadMore?: (() => void) | undefined; scrollingContainer?: Element | undefined; defaultItems?: Iterable | undefined; items?: Iterable | undefined; onOpenChange?: ((isOpen: boolean, menuTrigger?: import("@react-types/combobox").MenuTriggerAction | undefined) => void) | undefined; inputValue?: string | undefined; defaultInputValue?: string | undefined; onInputChange?: ((value: string) => void) | undefined; allowsCustomValue?: boolean | undefined; menuTrigger?: import("@react-types/combobox").MenuTriggerAction | undefined; children: import("@react-types/shared").CollectionChildren; disabledKeys?: Iterable | undefined; onSelectionChange?: ((key: React.Key) => any) | undefined; selectedKey?: React.Key | null | undefined; defaultSelectedKey?: React.Key | undefined; isDisabled?: boolean | undefined; isReadOnly?: boolean | undefined; placeholder?: string | undefined; isRequired?: boolean | undefined; isInvalid?: boolean | undefined; validationState?: import("react-stately").ValidationState | undefined; autoFocus?: boolean | undefined; onFocus?: ((e: React.FocusEvent) => void) | undefined; onBlur?: ((e: React.FocusEvent) => void) | undefined; onFocusChange?: ((isFocused: boolean) => void) | undefined; onKeyDown?: ((e: import("@react-types/shared").KeyboardEvent) => void) | undefined; onKeyUp?: ((e: import("@react-types/shared").KeyboardEvent) => void) | undefined; label?: React.ReactNode; description?: React.ReactNode; errorMessage?: React.ReactNode; }) => React.JSX.Element; export default Autocomplete;