/**
 * SearchProvider Component
 *
 * Provides Seekora client and context to child components.
 * Supports A/B testing via abTestId/abVariant props.
 */
import React, { ReactNode } from "react";
import type { SeekoraClient } from "@seekora-ai/search-sdk";
import { SearchStateManager, type SearchStateManagerConfig, type TrackContext } from "@seekora-ai/ui-sdk-core";
import type { Theme, ThemeConfig } from "../themes/types";
interface SearchContextValue {
    client: SeekoraClient;
    theme: Theme;
    enableAnalytics: boolean;
    autoTrackSearch: boolean;
    stateManager: SearchStateManager;
    /**
     * V4 analytics emission surface (Phase 6 — SCRUM-259). Consumers thread
     * an `{analytics, orgcode, xstoreid}` instance through SearchProvider so
     * components like `SearchResults` can fire `Search Impression` /
     * `Object Clicked` via the search-sdk's framework-agnostic helpers.
     *
     * Optional — if not supplied, `useImpressionTracker` becomes a no-op and
     * the existing V3 `client.trackSearch` / `client.trackClick` path keeps
     * working unchanged.
     */
    trackContext: TrackContext | null;
}
export interface SearchProviderProps {
    client: SeekoraClient;
    theme?: ThemeConfig;
    enableAnalytics?: boolean;
    autoTrackSearch?: boolean;
    stateManager?: SearchStateManagerConfig;
    children: ReactNode;
    /** A/B test experiment ID to include in all analytics events */
    abTestId?: string;
    /** A/B test variant to include in all analytics events */
    abVariant?: string;
    /** Auto-fetch experiment assignments on mount (default: false) */
    experiments?: boolean;
    /**
     * V4 analytics emission context (Phase 6 — SCRUM-259). Pass an
     * `{ analytics, orgcode, xstoreid }` instance to enable V4 tracker
     * helpers (Search Impression, Object Clicked, etc.) inside descendant
     * components. Optional — V3 tracking via `client.trackSearch` / `client.trackClick`
     * continues to work unchanged when this is absent.
     */
    trackContext?: TrackContext | null;
    /**
     * Logged-in user identifier, when known. Threaded into the analytics
     * TrackContext so outgoing track events stamp `userId` for cross-surface
     * identity stitching. Format conventions match the search-sdk's
     * TrackContext.userId (e.g. `shopify:<shop>:<customer-id>` for Shopify
     * storefronts; opaque caller-defined IDs otherwise). Leave undefined
     * for guest sessions — events still emit with anonymousId only.
     */
    userId?: string;
    /**
     * A Promise already holding the first search response, server-rendered by
     * the boot.js proxy route before the React tree mounted (SCRUM-268
     * early-fire optimisation). When set alongside `initialQuery`, the
     * SearchStateManager consumes this promise on the very first `search()` call
     * whose query matches `initialQuery`, skipping one full backend RTT.
     *
     * Passed directly into the stateManager config so the SearchStateManager
     * foundation (066c126) handles the consumption logic.
     */
    initialResultsPromise?: Promise<import("@seekora-ai/search-sdk").SearchResponse | null> | null;
    /**
     * The query that was used when `initialResultsPromise` was pre-fired
     * server-side. Must match exactly for the optimisation to engage.
     * Defaults to "" (empty string) when absent — appropriate for
     * collection/featured surfaces where the initial search is query-less.
     */
    initialQuery?: string;
}
export declare const SearchProvider: React.FC<SearchProviderProps>;
export declare const useSearchContext: () => SearchContextValue;
/**
 * Convenience hook for components that emit V4 analytics events.
 *
 * Returns the `TrackContext` supplied to `SearchProvider`, or `null` if
 * the provider was rendered without one. Components like `useImpressionTracker`
 * are safe to call this — they treat `null` as a no-op, so a missing
 * trackContext doesn't crash the tree at SSR/first-paint time.
 *
 * Returns null (rather than throwing) when used outside SearchProvider so
 * a stray `useTrackContext()` in a deeply-nested component doesn't blow up
 * storybook / SSR previews. Components that NEED an active trackContext
 * should check the return and bail out (matches buildImpressionEffect's
 * null-guard contract).
 */
export declare const useTrackContext: () => TrackContext | null;
export {};
//# sourceMappingURL=SearchProvider.d.ts.map