import { CheckoutServiceConfig } from '../../services/checkout-service.js'; import { type LineItem } from '../../services/checkout-service.js'; /** * Props for the Root component */ export interface RootProps { children: React.ReactNode; checkoutServiceConfig?: CheckoutServiceConfig; } /** * Root component that provides the Checkout service context to its children. * This component sets up the necessary services for managing direct product checkout functionality. * * @order 1 * @component * @example * ```tsx * import { Checkout } from '@wix/ecom/react'; * * function ProductCheckout() { * const lineItems = [{ catalogReference: { productId: 'product-id', variantId: 'variant-id' }, quantity: 1 }]; * * return ( * *
* * {({ createCheckout, isLoading, error }) => ( * * )} * *
*
* ); * } * ``` */ export declare function Root(props: RootProps): React.ReactNode; /** * Props for the Trigger headless component */ export interface TriggerProps { /** Render prop function that receives checkout trigger data */ children: (props: TriggerRenderProps) => React.ReactNode; } /** * Render props for the Trigger component */ export interface TriggerRenderProps { /** Function to create checkout and redirect */ createCheckout: (lineItems: LineItem[]) => Promise; /** Whether checkout creation is in progress */ isLoading: boolean; /** Error message if checkout fails */ error: string | null; } /** * Headless component that provides checkout creation functionality. * Use this component to trigger direct checkout for a product. * * @component * @example * ```tsx * import { Checkout } from '@wix/ecom/react'; * * function BuyNowButton() { * const lineItems = [{ catalogReference: { productId: 'product-id' }, quantity: 1 }]; * * return ( * * {({ createCheckout, isLoading, error }) => ( *
* * {error && ( *

{error}

* )} *
* )} *
* ); * } * ``` */ export declare function Trigger(props: TriggerProps): import("react").ReactNode;