/**
 * AddToCartButton – primitive that fires V4 `Product Added` on click.
 *
 * The cart-side action is the consumer's responsibility (they pass
 * `onAddToCart`); this primitive owns the V4 emission so every
 * consumer storefront — cartello, demo-stores, future templates —
 * inherits Product Added tracking for free.
 *
 * Algolia hybrid pattern (spec Section 6G — "Cart and conversion event
 * ownership"): cart APIs live in the consumer storefront, but the
 * tracking shim sits in ui-sdk so the Seekora SDK is the canonical
 * emission seam for the entire 17-event V4 taxonomy.
 *
 * Behaviour on click:
 *   1. Fire `Product Added` (event 7) with the product fields the
 *      Segment Spec requires (object_id, product_id, price, quantity,
 *      currency, search_id?, surface).
 *   2. Invoke the consumer's `onAddToCart` callback (the cart-side
 *      action). Fired AFTER analytics so navigation/side-effects in
 *      the callback don't race the emission.
 *
 * search_id resolution: pass NOTHING for `search_id` to let the SDK's
 * 3-layer fallback (in-memory → sessionStorage → URL) attribute the
 * event. Passing `search_id: undefined` explicitly would defeat the
 * resolver — the SDK's track() wrapper now treats `undefined` as
 * unsupplied and runs the resolver, but it's still cleaner to omit
 * the key entirely.
 *
 * SCRUM-259 Phase 4c — task #74.
 */
import React from "react";
import type { CardSurface } from "../../hooks/useCardAnalytics";
/**
 * Loose product shape — accepts the canonical Seekora `ResultItem` /
 * `ProductItem` AND any consumer's hand-rolled product object. We pluck
 * only the V4 fields we need; everything else is ignored.
 */
export interface AddToCartButtonProductLike {
    id?: string | number;
    product_id?: string | number;
    variant_id?: string | number;
    /** Display name. Falls back to title / name / primaryText. */
    title?: string;
    name?: string;
    primaryText?: string;
    /**
     * Price as a number OR a string ("$19.99"). When string, the
     * non-numeric chars are stripped before emission so the wire shape
     * stays Segment-spec compliant.
     */
    price?: number | string;
    /** ISO 4217 currency code. Defaults to "USD" when omitted. */
    currency?: string;
    /** Optional SKU passthrough. */
    sku?: string;
    /** Optional category for funnel grouping. */
    category?: string;
    /** Catch-all so consumer's extras don't break the type. */
    [key: string]: unknown;
}
export interface AddToCartButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
    /** Product being added — id + price + currency are the load-bearing fields. */
    product: AddToCartButtonProductLike;
    /** Quantity. Defaults to 1. */
    quantity?: number;
    /**
     * Consumer-supplied cart-side action. Receives the product +
     * quantity. May be async; awaited so analytics fires before any
     * navigation the consumer triggers afterwards.
     */
    onAddToCart?: (product: AddToCartButtonProductLike, quantity: number) => void | Promise<void>;
    /**
     * Surface attribution. Defaults to "results_page" (the most common
     * case — an Add-to-Cart on a search result card). Surfaces other
     * than `"results_page"` / `"dropdown"` are still allowed; Product
     * Added is the same event regardless, but the surface helps funnel
     * analysis.
     */
    surface?: CardSurface;
    /**
     * Explicit search_id override. Almost always omit this — the SDK's
     * resolveSearchId() will pick the right value from the 3-layer
     * chain. Pass explicitly only when the caller has the search_id in
     * hand AND wants to bypass the resolver (e.g. attributing a Buy Now
     * to a search that has since rolled over in the user's session).
     */
    searchId?: string;
    /**
     * Master enable flag. When false, click invokes onAddToCart but
     * Product Added does NOT fire. Defaults to true.
     */
    trackingEnabled?: boolean;
    /** Button label override; defaults to "Add to Cart". */
    children?: React.ReactNode;
}
export declare function AddToCartButton({ product, quantity, onAddToCart, surface, searchId, trackingEnabled, children, className, style, disabled, ...buttonRest }: AddToCartButtonProps): React.ReactElement;
//# sourceMappingURL=AddToCartButton.d.ts.map