import { giftVoucherProducts } from '@wix/gift-vouchers'; import { type Signal } from '@wix/services-definitions/core-services/signals'; /** * Gift card product type from the Wix Gift Vouchers API */ export type GiftCardProduct = giftVoucherProducts.GiftCardProduct; /** * API interface for the GiftCard service. * Provides reactive gift card product data management. */ export interface GiftCardServiceAPI { /** Reactive signal containing the gift card product data */ product: Signal; /** Reactive signal indicating if the product is currently being loaded */ isLoading: Signal; /** Reactive signal containing any error message, or null if no error */ error: Signal; /** Reactive signal containing the currency code (e.g., "EUR", "USD") */ currencyCode: Signal; /** Reactive signal containing the locale code (e.g., "en-US", "he-IL") */ locale: Signal; /** Function to load the gift card product */ loadProduct: () => Promise; } /** * Service definition for the GiftCard service. */ export declare const GiftCardServiceDefinition: string & { __api: GiftCardServiceAPI; __config: {}; isServiceDefinition?: boolean; } & GiftCardServiceAPI; /** * Configuration interface for the GiftCardService. * Either provide a product directly (SSR) or leave undefined to auto-fetch. */ export interface GiftCardServiceConfig { /** The gift card product data (optional - if not provided, will be fetched) */ product?: GiftCardProduct; /** ISO currency code (e.g., "EUR", "USD"). If not provided, resolved internally from site settings */ currencyCode?: string; } export declare const GiftCardService: import("@wix/services-definitions").ServiceFactory; /** * Success result interface for gift card service configuration loading. */ export interface SuccessGiftCardServiceConfigResult { type: 'success'; config: GiftCardServiceConfig; } /** * Not found result interface for gift card service configuration loading. */ export interface NotFoundGiftCardServiceConfigResult { type: 'notFound'; } /** * Options for loading gift card service configuration. */ export interface LoadGiftCardServiceConfigOptions { /** ISO currency code (e.g., "EUR", "USD") to use for price formatting. * If not provided, it will be fetched from site settings. */ currency?: string; } /** * Loads gift card service configuration for SSR. * Fetches the first gift card product from the API and optionally * fetches the site currency from Wix site settings. * * @param options - Optional configuration for loading * @returns Promise that resolves to GiftCardServiceConfigResult (success with config or notFound) * * @example * ```astro * --- * import { loadGiftCardServiceConfig } from '@wix/headless-gift-voucher/services'; * import { GiftCard } from '@wix/headless-gift-voucher/react'; * * // Option 1: Auto-fetch currency from site settings (default) * const result = await loadGiftCardServiceConfig(); * * // Option 2: Provide explicit currency (skips site settings fetch) * const result = await loadGiftCardServiceConfig({ * currency: 'EUR' * }); * * if (result.type === 'notFound') { * return Astro.redirect('/404'); * } * --- * * * * * ``` */ export declare function loadGiftCardServiceConfig(options?: LoadGiftCardServiceConfigOptions): Promise;