/**
 * https://www.levelaccess.com/differences-aria-1-0-1-1-changes-rolecombobox/
 * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
 * https://www.digitala11y.com/aria-autocomplete-properties/
 *
 * We have opted to retain the ARIA 1.0 markup pattern for comboboxes.
 * This was done because the ARIA 1.1 markup pattern triggers a different
 * behavior on containers with a role="combobox" attribute. WCAG refers to
 * this as a composite widget: https://www.w3.org/TR/wai-aria-1.1/#h-composite
 *
 * Our testing with screen readers, specifically JAWS, has been the deciding
 * factor in going back to the ARIA 1.0 markup pattern. There were a number
 * of conflicting interactions using the 1.1 markup pattern that felt like
 * an unacceptable regression of the user experience.
 */
import { DownshiftProps } from 'downshift';
import React from 'react';
export interface AutocompleteItems {
    /**
     * Unique identifier for this item
     */
    id?: string;
    /**
     * Displayed value of the item. May alternatively provide a `children` value
     */
    name?: string;
    /**
     * Custom React node as an alternative to a string-only `name`
     */
    children?: React.ReactNode;
    /**
     * Additional classes to be added to the root element.
     * Useful for adding utility classes.
     */
    className?: string;
    /**
     * Whether this item should be counted as one of the results for the purpose of announcing the
     * result count to screen readers
     */
    isResult?: boolean;
}
declare type PropsNotPassedToDownshift = 'ariaClearLabel' | 'clearInputText' | 'items' | 'label' | 'loading' | 'children' | 'className' | 'clearInputOnBlur' | 'clearSearchButton';
export interface AutocompleteProps extends Omit<DownshiftProps<any>, PropsNotPassedToDownshift> {
    /**
     * Screenreader-specific label for the Clear search `<button>`. Intended to provide a longer, more descriptive explanation of the button's behavior.
     */
    ariaClearLabel?: string;
    /**
     * Control the `TextField` autocomplete attribute. Defaults to "off" to support accessibility. [Read more.](https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion)
     */
    autoCompleteLabel?: string;
    /**
     * Must contain a `TextField` component
     */
    children: React.ReactNode;
    /**
     * Additional classes to be added to the root element.
     * Useful for adding utility classes.
     */
    className?: string;
    /**
     * When set to `false`, do not clear the input when the input element loses focus.
     */
    clearInputOnBlur?: boolean;
    /**
     * Text rendered on the page if `clearInput` prop is passed. Default is "Clear search".
     */
    clearInputText?: React.ReactNode;
    /**
     * Removes the Clear search button when set to `false`
     */
    clearSearchButton?: boolean;
    /**
     * Used to focus child `TextField` on `componentDidMount()`
     */
    focusTrigger?: boolean;
    /**
     * A unique id to be passed to the child `TextField`. If no id is passed as a prop,
     * the `Autocomplete` component will auto-generate one. This prop was provided in cases
     * where an id might need to be passed to multiple components, such as the `htmlFor`
     * attribute on a label and the id of an input.
     */
    id?: string;
    /**
     * Customize the default status messages announced to screenreader users via aria-live when autocomplete results are populated. [Read more on downshift docs.](https://github.com/paypal/downshift#geta11ystatusmessage)
     */
    getA11yStatusMessage?: DownshiftProps<any>['getA11yStatusMessage'];
    /**
     * Access a reference to the child `TextField`'s `input` element
     */
    inputRef?: (...args: any[]) => any;
    /**
     * Used to determine the string value for the selected item (which is used to compute the `inputValue`). [Read more on downshift docs.](https://github.com/paypal/downshift#itemtostring)
     */
    itemToString?: DownshiftProps<any>['itemToString'];
    /**
     * Array of objects used to populate the suggestion list that appears below the input as users type. This array of objects is intended for an async data callback, and should conform to the prescribed shape to avoid errors.
     */
    items?: AutocompleteItems[];
    /**
     * Adds a heading to the top of the autocomplete list. This can be used to convey to the user that they're required to select an option from the autocomplete list.
     */
    label?: React.ReactNode;
    /**
     * A unique `id` to be used on the child `TextField` label tag
     */
    labelId?: string;
    /**
     * Can be called when the `items` array is being fetched remotely, or will be delayed for more than 1-2 seconds.
     */
    loading?: boolean;
    /**
     * Message users will see when the `loading` prop is passed to `Autocomplete`.
     */
    loadingMessage?: React.ReactNode;
    /**
     * Message users will see when the `items` array returns empty and the `loading` prop is passed to `<Autocomplete />`.
     */
    noResultsMessage?: React.ReactNode;
    /**
     * Called when the user selects an item and the selected item has changed. Called with the item that was selected and the new state. [Read more on downshift docs.](https://github.com/paypal/downshift#onchange)
     */
    onChange?: (...args: any[]) => any;
    /**
     * Called when the child `TextField` value changes. Returns a String `inputValue`. [Read more on downshift docs.](https://github.com/paypal/downshift#oninputvaluechange)
     */
    onInputValueChange?: DownshiftProps<any>['onInputValueChange'];
}
export declare class Autocomplete extends React.Component<AutocompleteProps, any> {
    static defaultProps: {
        autoCompleteLabel: string;
        clearSearchButton: boolean;
        clearInputOnBlur: boolean;
        itemToString: (item: any) => string;
    };
    constructor(props: AutocompleteProps);
    id: string;
    labelId: string;
    listboxId: string;
    listboxContainerId: string;
    listboxHeadingId: string;
    filterItems(items: AutocompleteItems[], inputValue: string, getInputProps: (...args: any[]) => unknown, getItemProps: (...args: any[]) => unknown, highlightedIndex: number): React.ReactNode;
    renderChildren(getInputProps: (...args: any[]) => any, listboxOpen: boolean): React.ReactNode[];
    render(): JSX.Element;
}
export default Autocomplete;
