/**
 * SearchResults Component
 *
 * Displays search results with customizable rendering
 * Includes keyboard navigation support (arrow keys, Enter to select)
 */
import React from "react";
import type { SearchResponse } from "@seekora-ai/search-sdk";
import type { ResultItem, FieldMapping, ViewMode } from "@seekora-ai/ui-sdk-types";
import { type FieldMappingPresetName } from "../utils/field-mapping-presets";
import type { SwapMap } from "../theme-cards/swap";
export interface SearchResultsTheme {
    container?: string;
    header?: string;
    resultsList?: string;
    resultItem?: string;
    resultItemHover?: string;
    resultTitle?: string;
    resultDescription?: string;
    resultImage?: string;
    resultPrice?: string;
    emptyState?: string;
    errorState?: string;
    pagination?: string;
    /** Custom min-height class override */
    minHeight?: string;
    /** Custom min-width class override */
    minWidth?: string;
}
export interface SearchResultsProps {
    results?: SearchResponse | null;
    loading?: boolean;
    error?: Error | null;
    onResultClick?: (result: ResultItem, index: number) => void;
    renderResult?: (result: ResultItem, index: number, isActive?: boolean) => React.ReactNode;
    renderEmpty?: () => React.ReactNode;
    renderError?: (error: Error) => React.ReactNode;
    className?: string;
    style?: React.CSSProperties;
    theme?: SearchResultsTheme;
    itemsPerPage?: number;
    showPagination?: boolean;
    /** Display mode: 'list' (default), 'card', or 'grid' */
    viewMode?: ViewMode;
    /** Field mapping configuration for extracting data from results.
     *  Accepts a preset name (`"shopify"`, `"woocommerce"`, `"seekora_legacy"`)
     *  or a custom `FieldMapping` object. Defaults to the `"shopify"` preset
     *  when omitted. SCRUM-268. */
    fieldMapping?: FieldMapping | FieldMappingPresetName;
    /** When false (default), description is HTML-stripped to plain text before
     *  rendering. When true, rendered as raw HTML — caller must sanitise. */
    descriptionAsHtml?: boolean;
    /** Function to extract results array from the response (if custom structure) */
    extractResults?: (response: any) => any[];
    /** Enable keyboard navigation (arrow keys, Enter to select) */
    enableKeyboardNavigation?: boolean;
    /** Auto-focus the results container */
    autoFocus?: boolean;
    /** Minimum height to prevent container collapse when empty (default: '400px') */
    minHeight?: string;
    /** Minimum width to prevent container shrinking (default: '100%') */
    minWidth?: string;
    /** When true, renders the internal "Found N result(s)" header. Default false —
     *  storefront layouts already show Stats in their header slot so the built-in
     *  header would duplicate the count. SCRUM-268. */
    showHeader?: boolean;
    /**
     * When false, hides the product description in result cards entirely.
     * Default true (back-compat). Set to false for compact card layouts.
     * SCRUM-268.
     */
    showDescription?: boolean;
    /**
     * Clamps the description to this many lines via -webkit-line-clamp.
     * Only effective when showDescription is true (or unset). SCRUM-268.
     */
    descriptionLines?: number;
    /**
     * Card rendering mode.
     * - "seekora" (default): React-rendered cards using field mapping
     * - "theme_section": Fetch each card from Shopify Section Rendering API
     *   so cards match the theme pixel-for-pixel. Requires cardSectionId.
     * - "theme_native": Render the merchant theme's own card markup via the
     *   theme card registry (keyed on window.Shopify.theme.theme_store_id),
     *   with hydrogen-react primitives for data. Requires a mounted
     *   ShopifyProvider; falls back to "seekora" when unavailable.
     */
    cardMode?: "seekora" | "theme_section" | "theme_native";
    /**
     * Shopify section ID for theme_section card mode. The section must
     * render a single product card template. Used to fetch
     * /products/<handle>?section_id=<id>
     */
    cardSectionId?: string;
    /**
     * Harvested card template HTML from the server (themeHarvest.cardTemplateHtml).
     * Used when cardMode is "theme_native" and the server has returned a real
     * theme card. If absent, the existing React-replica path is used. SCRUM-267.
     */
    themeHarvestTemplate?: string;
    /**
     * Swap map produced by the server's per-family adapter
     * (themeHarvest.swapMap). Describes which CSS selectors inside the
     * harvested card hold image, title, links, price, and form fields.
     * Required alongside themeHarvestTemplate. SCRUM-267.
     */
    themeHarvestSwapMap?: SwapMap;
    /**
     * Merchant's Shopify money_format template (e.g. "₹{{amount}}",
     * "${{amount_no_decimals}}"). When provided, price rendering inside the
     * harvested card uses the merchant's exact format instead of Intl.
     * Sourced from themeHarvest.moneyFormat in boot config. SCRUM-267.
     */
    themeHarvestMoneyFormat?: string;
}
/**
 * `SearchResults` — public entrypoint. Wraps `SearchResultsInner` with
 * `<BufferProvider>` so the V4 batched-event buffers (Search Impression,
 * Object Clicked, Object Viewed) are available to every descendant card.
 *
 * Consumers don't need to wrap SearchResults in BufferProvider themselves —
 * the provider lives here at the component boundary. Advanced setups
 * that want a shared buffer across multiple SearchResults instances on
 * the same page can render their own `<BufferProvider>` above and
 * SearchResults' inner provider will just install a nested no-op
 * (each provider has its own buffer trio; nested providers do NOT share
 * — they are independent. That's the desired behaviour for now: one
 * `Search Impression` batch per SearchResults instance keeps the
 * search_id -> arrays correlation clean).
 */
export declare const SearchResults: React.FC<SearchResultsProps>;
//# sourceMappingURL=SearchResults.d.ts.map