import { ReactNode } from 'react';
import { BaseProps } from '../../../libraries/common-types/src/common-types';
import { ListboxItemProps, ListboxProps } from '../../listbox/src/listbox';
export type AutocompleteOption = {
    label: string;
    id: string;
    value?: string;
    disabled?: boolean;
};
export type InputProps = Omit<BaseProps<"input">, "onFocus" | "onMouseDown"> & {
    onFocus: (event: React.FocusEvent<HTMLInputElement> | undefined) => void;
    onMouseDown: (event: React.MouseEvent<HTMLInputElement> | undefined) => void;
};
type ComboboxProps = {
    combobox: true;
    /**
     * An accessible label for the button that toggles the list of options for a combobox.
     * */
    comboboxButtonAriaLabel: string;
    noOptionsText: ReactNode;
};
type NoComboboxProps = {
    combobox?: never;
    comboboxButtonAriaLabel?: never;
    noOptionsText?: ReactNode;
};
export type UseAutocompleteResult<T extends AutocompleteOption> = {
    highlightFirstOption?: boolean;
    defaultInputValue?: string;
    inputValue?: string;
    filterOption?: (inputValue: string | undefined, option: T) => boolean;
    id: string;
    listboxLabel: string;
    listboxMaxHeight?: string | number;
    onInputBlur?: React.FocusEventHandler<HTMLInputElement>;
    onInputChange?: (value: string) => void;
    onInputFocus?: (event: React.FocusEvent<HTMLInputElement> | undefined) => undefined;
    onInputKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
    onInputMouseDown?: (event: React.MouseEvent<HTMLInputElement> | undefined) => undefined;
    openOnFocus?: boolean;
    onSelect?: (option: T | undefined) => void;
    options: T[];
    selectedOption?: T;
    ["data-testid"]?: string;
} & (ComboboxProps | NoComboboxProps);
export declare const useAutocomplete: <T extends AutocompleteOption>({ combobox, comboboxButtonAriaLabel, highlightFirstOption, defaultInputValue, inputValue, filterOption, id, listboxLabel, listboxMaxHeight, onInputBlur, onInputChange, onInputFocus, onInputKeyDown, onInputMouseDown, openOnFocus, noOptionsText, onSelect, options, selectedOption, ["data-testid"]: dataTestid, }: UseAutocompleteResult<T>) => {
    id: string;
    inputProps: InputProps;
    internalRef: import('react').RefObject<HTMLDivElement | null>;
    optionsToShow: (T | undefined)[];
    showListbox: boolean;
    noOptionsText: ReactNode;
    combobox: true | undefined;
    comboboxButtonAriaLabel: string | undefined;
    getListBoxItemProps: (option: T, index: number) => ListboxItemProps;
    listboxProps: ListboxProps;
};
export {};
//# sourceMappingURL=useAutocomplete.d.ts.map