import { CurrentCartServiceConfig } from '../../services/current-cart-service.js'; import { type LineItem } from '../../services/common-types.js'; import * as currentCart from '@wix/auto_sdk_ecom_current-cart'; export interface RootProps { children: React.ReactNode; currentCartServiceConfig: CurrentCartServiceConfig; } /** * Root component that provides the CurrentCart service context to its children. * This component sets up the necessary services for managing current cart functionality. * * @order 1 * @component * @example * ```tsx * import { CurrentCart } from '@wix/ecom/components'; * * function CartProvider() { * return ( * *
* * {({ totalItems, open }) => ( * * )} * * * * {({ cart, isLoading }) => ( *
* {isLoading ? 'Loading...' : 'Cart loaded'} *
* )} *
*
*
* ); * } * ``` */ export declare function Root(props: RootProps): React.ReactNode; /** * Props for EmptyState headless component */ export interface EmptyStateProps { /** Content to display when cart is empty (can be a render function or ReactNode) */ children: ((props: EmptyStateRenderProps) => React.ReactNode) | React.ReactNode; } /** * Render props for EmptyState component */ export interface EmptyStateRenderProps { } /** * Component that renders content when the cart is empty. * Only displays its children when there are no items in cart, no loading state, and no errors. * * @component * @example * ```tsx * import { CurrentCart } from '@wix/ecom/components'; * * function EmptyCartMessage() { * return ( * * {() => ( *
*

No items in cart

*

Items will appear here once they are added

*
* )} *
* ); * } * ``` */ export declare function EmptyState(props: EmptyStateProps): import("react").ReactNode; /** * Props for Content headless component */ export interface ContentProps { /** Render prop function that receives content data */ children: (props: ContentRenderProps) => React.ReactNode; } /** * Render props for Content component */ export interface ContentRenderProps { /** Cart data */ cart: currentCart.Cart | null; /** Whether cart is loading */ isLoading: boolean; /** Error message if any */ error: string | null; } /** * Headless component for cart content/modal * * @example * // Complete cart implementation with essential headless features * * {({ cart, isLoading }) => ( *
* * {({ totalItems }) =>

Cart ({totalItems} items)

} *
* * {isLoading &&

Loading cart...

} * * * {({ items, totalItems }) => ( * <> * {items.length === 0 ? ( *

Your cart is empty

* ) : ( * <> * * {({ clear, totalItems, isLoading }) => ( * totalItems > 0 && ( * * ) * )} * * * {items.map((item) => ( * * {({ * title, * image, * price, * quantity, * selectedOptions, * increaseQuantity, * decreaseQuantity, * remove, * isLoading: itemLoading * }) => ( *
*

{title}

*

{price}

* * {selectedOptions.map((option, index) => ( * * {option.name}: {typeof option.value === 'object' ? option.value.name : option.value} * * ))} * * * {quantity} * * * *
* )} *
* ))} * * * {({ notes, updateNotes }) => ( *