import type { CommerceEngine } from '../../../app/commerce-engine/commerce-engine.js'; import { type Controller } from '../../controller/headless-controller.js'; import type { RecentQueriesListInitialState, RecentQueriesListOptions as CoreRecentQueriesListOptions, RecentQueriesListProps as CoreRecentQueriesListProps } from '../../recent-queries-list/headless-recent-queries-list.js'; export type { RecentQueriesListInitialState }; export type RecentQueriesListOptions = Partial & { /** * When set to true, fills the `results` field rather than the `products` field * in the response. It may also include Spotlight Content in the results. * @default false */ enableResults?: boolean; }; export interface RecentQueriesListProps extends Omit { options?: RecentQueriesListOptions; } /** * The `RecentQueriesList` controller manages the user's recent queries. * * @group Buildable controllers * @category RecentQueriesList */ export interface RecentQueriesList extends Controller { /** * The state of the RecentQueriesList controller. * */ state: RecentQueriesState; /** * Clears the recent queries list. */ clear(): void; /** * Executes the given recent query. * @param index - The index of the recent query to execute. */ executeRecentQuery(index: number): void; /** * Sets the recent queries list to the specified array of queries. * @param queries - The array of queries to set. */ updateRecentQueries(queries: string[]): void; } /** * A scoped and simplified part of the headless state that is relevant to the `RecentQueriesList` controller. * * @group Buildable controllers * @category RecentQueriesList * */ export interface RecentQueriesState { /** * The list of recent queries. */ queries: string[]; /** * The maximum number of queries to retain in the list. */ maxLength: number; /** * Whether analytics and tracking are enabled. * In the case where it is disabled, it is recommended not to save recent queries. */ analyticsEnabled: boolean; } /** * Creates a `RecentQueriesList` controller instance. * * @param engine - The headless engine. * @param props - The configuration `RecentQueriesList` properties. * @returns A `RecentQueriesList` controller instance. * * @group Buildable controllers * @category RecentQueriesList * * */ export declare function buildRecentQueriesList(engine: CommerceEngine, props?: RecentQueriesListProps): RecentQueriesList;