import type { Catalog, CatalogCollection, ResolvedCatalogListing } from "./catalog"; import type { CheckoutResult, PaymentProvider } from "./payment"; export type PublishedStorefront = { catalog: Catalog; collections: CatalogCollection[]; listings: ResolvedCatalogListing[]; memberships: Array<{ collectionId: string; listingId: string; position: number; }>; }; export type StorefrontCartCustomization = { approvedArtworkId?: string; artworkAssetId?: string; buyerFields?: Record; placement?: string; }; export type StorefrontCartLineInput = { customization?: StorefrontCartCustomization; listingId: string; quantity: number; variantId: string; }; export type ResolvedStorefrontCartLine = { amountCents: number; customization: StorefrontCartCustomization; description?: string; listingId: string; name: string; quantity: number; unitAmountCents: number; variantId: string; }; export type StorefrontCartQuote = { catalogId: string; currency: string; lines: ResolvedStorefrontCartLine[]; storefrontSlug: string; subtotalCents: number; }; export type StorefrontCartErrorCode = "cart_empty" | "cart_too_large" | "customization_invalid" | "listing_unavailable" | "price_unavailable" | "quantity_invalid" | "storefront_unavailable" | "variant_unavailable"; export declare class StorefrontCartError extends Error { readonly code: StorefrontCartErrorCode; constructor(code: StorefrontCartErrorCode); } export declare const normalizeStorefrontCart: (raw: unknown) => StorefrontCartLineInput[]; export declare const storefrontCartLineKey: (line: StorefrontCartLineInput) => string; export declare const upsertStorefrontCartLine: (lines: StorefrontCartLineInput[], line: StorefrontCartLineInput) => StorefrontCartLineInput[]; export declare const removeStorefrontCartLine: (lines: StorefrontCartLineInput[], key: string) => StorefrontCartLineInput[]; export declare const resolveStorefrontCart: (storefront: PublishedStorefront, input: StorefrontCartLineInput[]) => StorefrontCartQuote; export declare const createStorefrontCheckout: (options: { cancelUrl: string; idempotencyKey: string; input: StorefrontCartLineInput[]; metadata?: Record; payment: Pick; storefront: PublishedStorefront; successUrl: string; }) => Promise<{ checkout: CheckoutResult; quote: StorefrontCartQuote; }>;