import type { giftVoucherProducts } from '@wix/gift-vouchers'; import * as checkout from '@wix/auto_sdk_ecom_checkout'; import { type Signal, type ReadOnlySignal } from '@wix/services-definitions/core-services/signals'; export type LineItem = checkout.LineItem; /** * Gift card catalog options for cart line items */ export interface GiftCardCatalogOptions { quantity: number; currency: string; variantId?: string; customAmount?: number; giftingInfo?: { recipientInfo: { firstName: string; lastName: string; email: string; }; greetingMessage?: string; deliverAt?: Date; }; wixGiftCardsAppNewCatalog: true; } /** * MultiCurrencyPrice type from the Wix Gift Vouchers API */ export type MultiCurrencyPrice = giftVoucherProducts.MultiCurrencyPrice; /** * Current price data based on selected variant. * Contains raw numeric amounts - use Money component for formatting. */ export interface CurrentPriceData { /** Price amount as number (what the customer pays) */ price: number; /** Original value as number (what the gift card is worth) */ value: number; /** Whether current selection has a discount (price < value) */ hasDiscount: boolean; } /** * Custom amount input data for min/max validation */ export interface CustomAmountData { /** Minimum allowed custom amount */ min: number | null; /** Maximum allowed custom amount */ max: number | null; } /** * API interface for the GiftCardCheckout service. * Manages variant selection state and computed values based on selection. */ export interface GiftCardCheckoutServiceAPI { /** Currently selected variant ID (preset variant _id or 'custom') */ selectedVariantId: Signal; /** Current image based on selection (selectedVariant.image ?? product.image) */ currentImage: ReadOnlySignal; /** Current price data based on selection (price, value, discount info) */ currentPriceData: ReadOnlySignal; /** User-entered custom amount (defaults to 0) */ customAmount: Signal; /** Whether the custom amount is valid (within min/max range) */ isCustomAmountValid: ReadOnlySignal; /** Custom amount validation data (min/max values) */ customAmountData: ReadOnlySignal; /** Current quantity of gift cards to purchase (default: 1) */ quantity: Signal; /** Whether this is a gift purchase (for someone else) or self-purchase */ isGift: Signal; /** Recipient email address */ recipientEmail: Signal; /** Whether the recipient email is valid */ isRecipientEmailValid: ReadOnlySignal; /** Recipient name (optional) */ recipientName: Signal; /** Delivery date for the gift card (default: immediate delivery) */ deliverAt: Signal; /** Personal message to include with the gift card (optional) */ recipientMessage: Signal; /** Whether the form has been submitted */ isFormSubmitted: Signal; /** Whether the form is valid and can add to cart */ canAddToCart: ReadOnlySignal; /** Computed line items ready for cart API */ lineItems: ReadOnlySignal; /** Set the selected variant by ID */ setVariant: (variantId: string | null) => void; /** Set the custom amount value */ setCustomAmount: (amount: number) => void; /** Set the quantity value */ setQuantity: (quantity: number) => void; /** Set whether this is a gift purchase */ setIsGift: (value: boolean) => void; /** Set the recipient email */ setRecipientEmail: (email: string) => void; /** Set the recipient name */ setRecipientName: (name: string) => void; /** Set the delivery date */ setDeliverAt: (date: Date) => void; /** Set the recipient message */ setRecipientMessage: (message: string) => void; /** Set whether the form has been submitted */ setIsFormSubmitted: (submitted: boolean) => void; /** Validates the form and sets the submitted state to true. */ validateAndSetFormSubmitted: () => boolean; } /** * Service definition for the GiftCardCheckout service. */ export declare const GiftCardCheckoutServiceDefinition: string & { __api: GiftCardCheckoutServiceAPI; __config: {}; isServiceDefinition?: boolean; } & GiftCardCheckoutServiceAPI; /** * Configuration interface for the GiftCardCheckoutService. * Currently empty, but can be extended for initial state. */ export interface GiftCardCheckoutServiceConfig { } /** * Implementation of the GiftCardCheckout service. * Manages variant selection and provides computed values based on selection. * * Dependencies: * - GiftCardServiceDefinition: to get product data */ export declare const GiftCardCheckoutService: import("@wix/services-definitions").ServiceFactory;