import type { SerializedError } from '@reduxjs/toolkit';
import type { Result } from '../../api/search/search/result.js';
import type { SearchAPIErrorWithStatusCode } from '../../api/search/search-api-error-response.js';
import type { SearchEngine } from '../../app/search-engine/search-engine.js';
import { type Controller } from '../controller/headless-controller.js';
import { type InstantResultOptions } from './instant-results-options.js';
export type { InstantResultOptions } from './instant-results-options.js';
export interface InstantResultProps {
    options: InstantResultOptions;
}
/**
 * The `InstantResults` controller allows the end user to manage instant results queries.
 *
 * Example: [instant-results.fn.tsx](https://github.com/coveo/ui-kit/blob/main/packages/samples/headless-react/src/components/instant-results/instant-results.fn.tsx)
 *
 * @group Controllers
 * @category InstantResults
 */
export interface InstantResults extends Controller {
    /**
     * Updates the specified query and shows instant results for it.
     *
     * @param q - The query to get instant results for. For more precise instant results, query suggestions are recommended.
     */
    updateQuery(q: string): void;
    /**
     * Clears all expired instant results queries.
     */
    clearExpired(): void;
    /**
     * The state of the `InstantResults` controller.
     */
    state: InstantResultsState;
}
/**
 * A scoped and simplified part of the Headless state that is relevant to the `InstantResults` controller.
 *
 * @group Controllers
 * @category InstantResults
 */
export interface InstantResultsState {
    /**
     * The current query for instant results.
     */
    q: string;
    /**
     * The instant results for the current query.
     */
    results: Result[];
    /**
     * Determines if a search is in progress for the current query.
     */
    isLoading: boolean;
    /**
     * An error returned when executing an instant results request, if any. This is `null` otherwise.
     */
    error: SearchAPIErrorWithStatusCode | SerializedError | null;
}
/**
 * Creates an `InstantResults` controller instance.
 *
 * @param engine - The Headless engine.
 * @param props - The configurable `InstantResults` properties.
 * @returns An `InstantResults` controller instance.
 *
 * @group Controllers
 * @category InstantResults
 */
export declare function buildInstantResults(engine: SearchEngine, props: InstantResultProps): InstantResults;
