import { GatedLine } from './checkout-types'; /** * Integrator-supplied cart I/O for the recommended `gatedCheckout` path. `TCart` * is the integrator's own Storefront cart type — the SDK never inspects it except * through `readCart`. The adapter is passed to `useFanfareCheckout`, so the SDK * owns the create→claim→add-line ordering while the integrator owns the Shopify * Storefront calls (cart create / `cartLinesAdd`). */ export interface FanfareCartAdapter { /** * Create or locate an EMPTY cart. Takes NO line — there is deliberately nothing * to add the gated product with here, so it cannot precede the claim that writes * the gate token. */ createCart(): Promise; /** Add one line to the cart AFTER the gate token is written; returns the updated cart. */ addLine(cart: TCart, line: GatedLine): Promise; /** Extract the claim-target cart id and checkout URL. `gatedCheckout` needs both before claiming. */ readCart(cart: TCart): { id: string; checkoutUrl?: string; }; }