import { type RefObject } from "react";
import { type EditableHTMLElement } from "../form/utils.js";
import { type NonNullMutableRef, type UseStateInitializer } from "../types.js";
import { type AutocompleteFilterOptions, type AutocompleteGetOptionLabel, type AutocompleteOption } from "./types.js";
/**
 * @since 6.0.0
 * @internal
 */
export interface GetDefaultValueOptions<Option extends AutocompleteOption> extends Required<AutocompleteGetOptionLabel<Option>> {
    query: string | undefined;
    multiselect?: boolean;
    defaultQuery: UseStateInitializer<string> | undefined;
    defaultValue: UseStateInitializer<Option | null | readonly Option[]> | undefined;
    options: readonly Option[];
    filter: (options: AutocompleteFilterOptions<Option>) => readonly Option[];
}
/**
 * @since 6.0.0
 * @internal
 */
export declare function getDefaultValue<Option extends AutocompleteOption>(options: GetDefaultValueOptions<Option>): UseStateInitializer<Option | null | readonly Option[]>;
/**
 * @since 6.0.0
 * @internal
 */
interface GetDefaultQueryOptions<Option extends AutocompleteOption> extends Required<AutocompleteGetOptionLabel<Option>> {
    value: Option | null | readonly Option[];
    defaultQuery?: UseStateInitializer<string>;
}
/**
 * @since 6.0.0
 * @internal
 */
export declare function getDefaultQuery<Option extends AutocompleteOption>(options: GetDefaultQueryOptions<Option>): UseStateInitializer<string>;
/**
 * @since 6.0.0
 * @internal
 */
export interface EnforceSelectedValueOptions<Option extends AutocompleteOption> extends Required<AutocompleteGetOptionLabel<Option>> {
    value: Option | readonly Option[] | null;
    visible: boolean;
    container: HTMLElement | null;
    popupRef: RefObject<HTMLElement>;
    comboboxRef: RefObject<EditableHTMLElement>;
    availableOptions: readonly Option[];
    prevAvailableOptions: NonNullMutableRef<readonly Option[] | null>;
}
/**
 * This enforces that if the user clicks away, touches somewhere else on the
 * page, tabs to the next element, or focuses another element programmatically
 * the autocomplete will set the `value` back to the previous selected value if
 * there was one. i.e.
 *
 * Case 1:
 * - User selects "Apple"
 * - User hits backspace twice. Input displays "App"
 * - User clicks somewhere else on the page
 * - Input now displays "Apple" again
 *
 * Case 2:
 * - User selects "Apple"
 * - User clears the input
 * - User types "app"
 * - User clicks somewhere else on the page
 * - Input now displays "" and the value is set to `null`
 *
 * NOTE: This mutates the {@link EnforceSelectedValueOptions.prevAvailableOptions}
 *
 * @since 6.0.0
 * @internal
 */
export declare function enforceSelectedValue<Option extends AutocompleteOption>(options: EnforceSelectedValueOptions<Option>): void;
/**
 * @since 6.0.0
 * @internal
 */
export declare function isMultipleValues<Option extends AutocompleteOption>(value: Option | null | readonly Option[]): value is readonly Option[];
export {};
