export interface CheckoutLineItem { externalProductId?: string | null; externalVariantId?: string | null; variantId?: string | null; priceId?: string | null; quantity: number; } export interface CheckoutInitParams { lineItems: CheckoutLineItem[]; cartToken?: string; promotionIds?: string[]; returnUrl?: string; draft?: boolean; useCustomDomain?: boolean; customerMetadata?: Record; metadata?: Record; storeId?: string; customer?: { currency?: string; locale?: string; }; enabledOrderBumpOfferIds?: string[]; } export interface CheckoutSession { id: string; checkoutToken: string; status: string; storeId: string; accountId: string; customerId: string; draft: boolean; createdAt: string; updatedAt: string; lastActiveDate: string; selectedPresentmentCurrency: string; shippingAddress?: any; billingAddress?: any; customer?: { id: string; email?: string; firstName?: string; lastName?: string; phone?: string; locale?: string; }; sessionLineItems: { id: string; quantity: number; priceId: string; variantId: string; productId: string; isOrderBump: boolean; orderBumpType?: string; price: { id: string; amount: number; currency: string; currencyOptions: any; variant: { id: string; name: string; description: string | null; sku: string | null; imageUrl: string | null; product: { id: string; name: string; description: string | null; imageUrl: string | null; }; }; }; }[]; store: { id: string; name: string; domain: string; currency: string; locale: string; presentmentCurrencies: string[]; chargeCurrencies: string[]; upsells: { id: string; type: string; enabled: boolean; orderBumpOffers: { id: string; type: string; precheck: boolean; variantId: string; productId: string; priceId: string; variant: { id: string; name: string; description: string | null; imageUrl: string | null; }; product: { id: string; name: string; description: string | null; imageUrl: string | null; }; price: { id: string; amount: number; currency: string; }; }[]; }[]; integrations: { id: string; type: string; enabled: boolean; config: any; }[]; }; shippingRate?: { id: string; shippingRateName: string; amount: number; isFree: boolean; }; orders: { id: string; status: string; }[]; orderSummaries: { id: string; currency: string; totalAmount: number; totalAdjustedAmount: number; totalPromotionAmount: number; items: any; adjustments: any; }[]; } export interface CheckoutSessionPreviewAdjustment { type: 'Promotion' | 'Tax' | 'Shipping'; description: string; level: 'Order' | 'LineItem'; sourceId: string; amount: number; currency: string; } export interface CheckoutSessionPreviewItem { id: string; productId: string; product: { name: string; description: string; }; variantId: string; variant: { name: string; description: string; imageUrl: string; grams: number; }; priceId: string; sku: string; unitAmount: number; quantity: number; amount: number; adjustedAmount: number; currency: string; adjustments: CheckoutSessionPreviewAdjustment[]; recurring?: boolean; rebillMode?: 'auth' | 'capture'; rebillStepIntervalMs?: number; interval?: 'day' | 'week' | 'month' | 'year'; intervalCount?: number; totalBillingCycles?: number; unitAmountAfterFirstCycle?: number; subscriptionSettings?: any; properties?: Record; orderLineItemProduct: { name: string | null; } | null; orderLineItemVariant: { name: string | null; imageUrl: string | null; } | null; } export interface CheckoutSessionPreview { items: CheckoutSessionPreviewItem[]; adjustments: CheckoutSessionPreviewAdjustment[]; totalAmount: number; totalAdjustedAmount: number; totalPromotionAmount: number; } export interface CheckoutSummaryItem { id: string; productId: string; variantId: string; priceId: string; product: { name: string; description: string; }; variant: { name: string; description: string; imageUrl: string; grams: number; }; sku: string; unitAmount: number; quantity: number; amount: number; adjustedAmount: number; currency: string; adjustments: any[]; recurring: boolean; interval?: 'day' | 'week' | 'month' | 'year'; intervalCount?: number; totalBillingCycles?: number; unitAmountAfterFirstCycle?: number; properties?: Record; orderLineItemProduct: { name: string; }; orderLineItemVariant: { name: string; imageUrl: string; }; metadata: { originalIds: string[]; isConsolidated: boolean; }; } export interface CheckoutSummary { currency: string; totalAmount: number; totalAdjustedAmount: number; totalPromotionAmount: number; items: CheckoutSummaryItem[]; adjustments: { type: string; description: string; amount: number; }[]; } export interface Promotion { id: string; name: string; description: string | null; type: string; rules: any[]; actions: any[]; } export interface CheckoutData { checkoutSession: CheckoutSession; customerIsClubMember: boolean; clubProductId?: string; summary: CheckoutSummary; availablePromotions: Promotion[]; } export interface UseCheckoutOptions { checkoutToken?: string; autoLoadFromToken?: boolean; } export interface UseCheckoutResult { checkout: CheckoutData | null; isLoading: boolean; error: Error | null; isInitialized: boolean; initialized: boolean; init: (params: CheckoutInitParams) => Promise<{ checkoutUrl: string; checkoutSession: CheckoutSession; checkoutToken: string; }>; getCheckout: (checkoutToken: string) => Promise; refresh: () => Promise; updateAddress: (data: { shippingAddress: any; billingAddress?: any; }) => Promise<{ success: boolean; shippingCountryChanged: boolean; billingCountryChanged: boolean; }>; setCheckoutInfo: (data: { shippingAddress: any; billingAddress?: any; differentBillingAddress?: boolean; }) => Promise<{ success: boolean; errors?: Record; shippingCountryChanged?: boolean; billingCountryChanged?: boolean; }>; applyPromotionCode: (code: string) => Promise<{ success: boolean; error?: any; }>; removePromotion: (promotionId: string) => Promise<{ success: boolean; error?: any; }>; getAppliedPromotions: () => Promise; updateLineItems: (lineItems: CheckoutLineItem[]) => Promise<{ success: boolean; error?: any; }>; addLineItems: (lineItems: CheckoutLineItem[]) => Promise<{ success: boolean; error?: any; }>; removeLineItems: (lineItems: { variantId: string; quantity?: number; }[]) => Promise<{ success: boolean; error?: any; }>; setItemQuantity: (variantId: string, quantity: number, priceId?: string) => Promise<{ success: boolean; error?: any; }>; toggleOrderBump: (orderBumpOfferId: string, selected: boolean) => Promise<{ success: boolean; error?: any; }>; updateCustomer: (data: { email: string; acceptsMarketing?: boolean; }) => Promise<{ success: boolean; error?: any; }>; updateCustomerAndSessionInfo: (data: { customerData: { email: string; acceptsMarketing?: boolean; }; shippingAddress: any; billingAddress?: any; differentBillingAddress?: boolean; }) => Promise<{ success: boolean; errors?: Record; shippingCountryChanged?: boolean; billingCountryChanged?: boolean; }>; previewOrderSummary: (orderBumpOfferIds: string[], orderBumpType?: 'primary' | 'secondary' | 'vip') => Promise<{ savings: number; savingsPct: number; currency: string; error?: any; }>; previewCheckoutSession: (lineItems: CheckoutLineItem[], promotionIds?: string[]) => Promise<{ success: boolean; preview: CheckoutSessionPreview; }>; clear: () => void; } export declare function useCheckout(options?: UseCheckoutOptions): UseCheckoutResult;