import React from 'react';
import { useAutocomplete } from 'react-instantsearch-core';
import type { PlainSearchParameters } from 'algoliasearch-helper';
import type { AutocompleteIndexClassNames, AutocompleteIndexConfig, AutocompleteClassNames, AutocompleteIndexProps } from 'instantsearch-ui-components';
import type { BaseHit, IndexUiState } from 'instantsearch.js';
import type { TransformItemsIndicesConfig } from 'instantsearch.js/es/connectors/autocomplete/connectAutocomplete';
import type { ComponentProps } from 'react';
type AutocompleteSearchParameters = Omit<PlainSearchParameters, 'index'> & {
    hitsPerPage?: number;
};
type IndexConfig<TItem extends BaseHit> = AutocompleteIndexConfig<TItem> & {
    headerComponent?: AutocompleteIndexProps<TItem>['HeaderComponent'];
    itemComponent: AutocompleteIndexProps<TItem>['ItemComponent'];
    noResultsComponent?: AutocompleteIndexProps<TItem>['NoResultsComponent'];
    searchParameters?: AutocompleteSearchParameters;
    classNames?: Partial<AutocompleteIndexClassNames>;
};
type PanelElements = Partial<Record<string, React.JSX.Element>>;
type AutocompleteTranslations = {
    detachedCancelButtonText: string;
    detachedSearchButtonTitle: string;
    detachedClearButtonTitle: string;
};
export type FeedConfig<TItem extends BaseHit> = {
    feedID: string;
    headerComponent?: AutocompleteIndexProps<TItem>['HeaderComponent'];
    itemComponent: AutocompleteIndexProps<TItem>['ItemComponent'];
    noResultsComponent?: AutocompleteIndexProps<TItem>['NoResultsComponent'];
    getURL?: AutocompleteIndexConfig<TItem>['getURL'];
    getQuery?: AutocompleteIndexConfig<TItem>['getQuery'];
    classNames?: Partial<AutocompleteIndexClassNames>;
};
type IndicesShowQuerySuggestionsConfig = Partial<Pick<IndexConfig<{
    query: string;
}>, 'indexName' | 'getURL' | 'headerComponent' | 'itemComponent' | 'classNames' | 'searchParameters'>>;
type FeedsShowQuerySuggestionsConfig = {
    feedID: string;
    getURL?: IndexConfig<{
        query: string;
    }>['getURL'];
    headerComponent?: IndexConfig<{
        query: string;
    }>['headerComponent'];
    itemComponent?: IndexConfig<{
        query: string;
    }>['itemComponent'];
    classNames?: Partial<AutocompleteIndexClassNames>;
};
type IndicesShowPromptSuggestionsConfig = Partial<Pick<IndexConfig<{
    query: string;
    label?: string;
}>, 'indexName' | 'getURL' | 'headerComponent' | 'itemComponent' | 'classNames' | 'searchParameters'>>;
type FeedsShowPromptSuggestionsConfig = {
    feedID: string;
    getURL?: IndexConfig<{
        query: string;
        label?: string;
    }>['getURL'];
    headerComponent?: IndexConfig<{
        query: string;
        label?: string;
    }>['headerComponent'];
    itemComponent?: IndexConfig<{
        query: string;
        label?: string;
    }>['itemComponent'];
    classNames?: Partial<AutocompleteIndexClassNames>;
};
type AutocompleteShowRecentConfig = {
    /**
     * Storage key to use in the local storage.
     */
    storageKey?: string;
    /**
     * Component to use for the header, before the list of items.
     */
    headerComponent?: AutocompleteIndexProps<{
        query: string;
    }>['HeaderComponent'];
    /**
     * Component to use for each recent search item.
     */
    itemComponent?: AutocompleteIndexProps<{
        query: string;
    }>['ItemComponent'] & {
        onRemoveRecentSearch: () => void;
    };
    classNames?: Partial<AutocompleteIndexClassNames>;
};
type AutocompleteCommonProps<TItem extends BaseHit> = ComponentProps<'div'> & {
    showRecent?: boolean | AutocompleteShowRecentConfig;
    getSearchPageURL?: (nextUiState: IndexUiState) => string;
    onSelect?: AutocompleteIndexConfig<TItem>['onSelect'];
    transformItems?: (indices: TransformItemsIndicesConfig[]) => TransformItemsIndicesConfig[];
    panelComponent?: (props: {
        elements: PanelElements;
        indices: ReturnType<typeof useAutocomplete>['indices'];
    }) => React.JSX.Element;
    searchParameters?: AutocompleteSearchParameters;
    classNames?: Partial<AutocompleteClassNames>;
    placeholder?: string;
    /**
     * Whether the input should be focused and the panel open initially.
     */
    autoFocus?: boolean;
    /**
     * Media query to enable detached (mobile) mode.
     * When the media query matches, the autocomplete switches to a full-screen overlay.
     * Set to empty string to disable detached mode.
     * When omitted, defaults to `--ais-autocomplete-detached-media-query`.
     * @default "(max-width: 680px)"
     */
    detachedMediaQuery?: string;
    /**
     * Translations for the Autocomplete widget.
     */
    translations?: Partial<AutocompleteTranslations>;
    /**
     * When true, renders an AI mode button inside the search input
     * that opens the Chat widget and sends the current query.
     * Requires a Chat widget on the same index.
     */
    aiMode?: boolean;
};
export type AutocompleteIndicesProps<TItem extends BaseHit> = AutocompleteCommonProps<TItem> & {
    indices?: Array<IndexConfig<TItem>>;
    feeds?: never;
    showQuerySuggestions?: IndicesShowQuerySuggestionsConfig;
    showPromptSuggestions?: IndicesShowPromptSuggestionsConfig;
};
export type AutocompleteFeedsProps<TItem extends BaseHit> = AutocompleteCommonProps<TItem> & {
    feeds: Array<FeedConfig<TItem>>;
    indices?: never;
    showQuerySuggestions?: FeedsShowQuerySuggestionsConfig;
    showPromptSuggestions?: FeedsShowPromptSuggestionsConfig;
};
export type AutocompleteProps<TItem extends BaseHit> = AutocompleteIndicesProps<TItem> | AutocompleteFeedsProps<TItem>;
export declare function EXPERIMENTAL_Autocomplete<TItem extends BaseHit = BaseHit>(props: AutocompleteProps<TItem>): React.JSX.Element;
export {};
