export interface OfferItem { id: string; product: { name: string; description: string; }; variant: { name: string; imageUrl: string; }; quantity: number; unitAmount: number; amount: number; adjustedAmount: number; currency: string; } export interface OfferSummary { items: OfferItem[]; totalAmount: number; totalAdjustedAmount: number; totalPromotionAmount: number; currency: string; adjustments: { type: string; description: string; amount: number; }[]; } export interface Offer { id: string; titleTrans: Record; summaries: OfferSummary[]; } export interface UseOffersOptions { /** * Array of offer IDs to fetch */ offerIds: string[]; /** * Whether to fetch offers automatically on mount * @default true */ enabled?: boolean; /** * Return URL for checkout sessions */ returnUrl?: string; } export interface UseOffersResult { /** * Array of fetched offers */ offers: Offer[]; /** * Loading state */ isLoading: boolean; /** * Error state */ error: Error | null; /** * Refetch offers */ refetch: () => Promise; /** * Generate checkout session for a specific offer */ createCheckoutSession: (offerId: string, options?: { returnUrl?: string; }) => Promise<{ checkoutUrl: string; }>; /** * Pay for an offer directly */ payOffer: (offerId: string) => Promise; /** * Transform offer to checkout session with dynamic variant selection */ transformToCheckout: (offerId: string, options?: { returnUrl?: string; }) => Promise<{ checkoutUrl: string; }>; /** * Get offer by ID from the loaded offers */ getOffer: (offerId: string) => Offer | undefined; /** * Get total value of all offers */ getTotalValue: () => number; /** * Get total savings across all offers */ getTotalSavings: () => number; /** * Pay for an offer with a checkout session */ payWithCheckoutSession: (checkoutSessionId: string, orderId?: string) => Promise; /** * Initialize a checkout session */ initCheckoutSession: (offerId: string, orderId: string) => Promise<{ checkoutSessionId: string; }>; } export declare function useOffers(options: UseOffersOptions): UseOffersResult;