/**
 * Enhanced Query Suggestions Hook
 *
 * Provides full support for query suggestions API including:
 * - Basic suggestions
 * - Dropdown recommendations (trending, top searches, related)
 * - Filtered tabs with products
 * - Recent searches (local storage)
 * - Analytics tracking
 */
import type { SeekoraClient } from "@seekora-ai/search-sdk";
import type { SuggestionItem, ProductItem, FilteredTab, DropdownRecommendations, RecentSearch, QuerySuggestionsResponse, TrendingSearch, TopSearch, RelatedSearch, PopularBrand, SuggestionCategory } from "@seekora-ai/ui-sdk-types";
export interface UseQuerySuggestionsEnhancedOptions {
    /** Seekora client instance */
    client: SeekoraClient;
    /** Current search query */
    query: string;
    /** Enable/disable the hook */
    enabled?: boolean;
    /** Prefetch initial (empty-query) data on mount even if not enabled yet */
    prefetch?: boolean;
    /** Debounce delay in ms */
    debounceMs?: number;
    /** Max suggestions to fetch */
    maxSuggestions?: number;
    /** Minimum query length to trigger search */
    minQueryLength?: number;
    /** Include dropdown recommendations (trending, products, etc.) */
    includeDropdownRecommendations?: boolean;
    /** When false, omit product hits list from dropdown (default true) */
    includeDropdownProductList?: boolean;
    /** When false, omit filtered_tabs from dropdown extensions (default true) */
    includeFilteredTabs?: boolean;
    /** Include categories in suggestions */
    includeCategories?: boolean;
    /** Include facets in suggestions */
    includeFacets?: boolean;
    /** Max categories per suggestion */
    maxCategories?: number;
    /** Max facets per suggestion */
    maxFacets?: number;
    /** Filtered tabs configuration */
    filteredTabs?: Array<{
        id?: string;
        label: string;
        filter: string;
    }>;
    /** Minimum popularity threshold */
    minPopularity?: number;
    /** Time range for analytics data */
    timeRange?: "7d" | "30d" | "90d";
    /** Disable typo tolerance */
    disableTypoTolerance?: boolean;
    /** Analytics tags */
    analyticsTags?: string[];
    /** Enable recent searches from localStorage */
    enableRecentSearches?: boolean;
    /** Max recent searches to store */
    maxRecentSearches?: number;
    /**
     * localStorage key for recent searches. Namespaces storage per instance so
     * multiple SearchBar widgets on the same page do not cross-pollinate their
     * recents. Default: 'seekora_recent_searches'.
     */
    storageKey?: string;
    /**
     * @deprecated Use storageKey instead. Kept for back-compat; storageKey takes
     * precedence when both are supplied.
     */
    recentSearchesKey?: string;
    /**
     * Optional callback invoked when a localStorage read or write fails (e.g.
     * quota exceeded, private-browsing mode, cookies disabled). The hook still
     * silently degrades — this callback is purely opt-in observability so
     * consumers can surface a "Recent searches won't persist" hint.
     */
    onStorageError?: (err: Error, op: "read" | "write") => void;
    /** Callback when suggestions are loaded */
    onSuggestionsLoaded?: (response: QuerySuggestionsResponse) => void;
    /** Callback on error */
    onError?: (error: Error) => void;
    /**
     * Generic field mapping for documents in suggestion results.
     * Keys = display slots (title, image, price, currency, url, urlPrefix).
     * Values = dot-paths resolved against each raw hit.
     * Configured per-store in the layout config so the same components
     * render any connector's document shape.
     */
    documentFieldMapping?: DocumentFieldMapping;
}
export interface UseQuerySuggestionsEnhancedReturn {
    /** Basic suggestion items */
    suggestions: SuggestionItem[];
    /** Loading state */
    loading: boolean;
    /** Error state */
    error: Error | null;
    /** Dropdown recommendations */
    dropdownRecommendations: DropdownRecommendations | null;
    /** Trending searches */
    trendingSearches: TrendingSearch[];
    /** Top searches */
    topSearches: TopSearch[];
    /** Related searches */
    relatedSearches: RelatedSearch[];
    /** Popular brands */
    popularBrands: PopularBrand[];
    /** Filtered tabs with products */
    filteredTabs: FilteredTab[];
    /** Trending products */
    trendingProducts: ProductItem[];
    /** Recent searches (from localStorage) */
    recentSearches: RecentSearch[];
    /** Processing time in ms */
    processingTimeMs: number | null;
    /** Total hits count */
    totalHits: number;
    /** Current page */
    currentPage: number;
    /** Total pages */
    totalPages: number;
    /** Original query */
    originalQuery: string;
    /** Add a search to recent searches */
    addRecentSearch: (query: string, resultsCount?: number) => void;
    /** Remove a search from recent searches */
    removeRecentSearch: (query: string) => void;
    /** Clear all recent searches */
    clearRecentSearches: () => void;
    /** Manually refetch suggestions */
    refetch: () => Promise<void>;
    /** Check if dropdown has any content to show */
    hasContent: boolean;
    /** Get all items for keyboard navigation (flattened) */
    getAllNavigableItems: () => NavigableItem[];
}
export interface NavigableItem {
    type: "suggestion" | "recent" | "trending" | "product" | "category" | "brand" | "tab";
    index: number;
    data: SuggestionItem | RecentSearch | TrendingSearch | ProductItem | SuggestionCategory | PopularBrand | FilteredTab;
}
/**
 * Generic field mapping for documents returned by the suggestions API.
 * Keys are display slot names (component decides what it supports).
 * Values are dot-paths resolved against the raw hit object.
 * Configured per-store in the layout config so the same ui-sdk
 * components render any document shape without code changes.
 */
export type DocumentFieldMapping = Record<string, string>;
export declare function useQuerySuggestionsEnhanced(options: UseQuerySuggestionsEnhancedOptions): UseQuerySuggestionsEnhancedReturn;
export default useQuerySuggestionsEnhanced;
//# sourceMappingURL=useQuerySuggestionsEnhanced.d.ts.map