import { UIDLEcommerceGiftCards, UIDLEcommerceSettings } from '@teleporthq/teleport-types'; /** * The storefront half of gift cards redeemed at checkout as a TENDER, as the * source fragments `ecommerce-context-generator.ts` splices into * `EcommerceProvider`. * * The provider never reads a gift card from the database. The Apply Gift Card * workflow (server-side data nodes, the only lookup) leaves what the shopper * may see — `{ id, last4, balance, currency, checkedAt }` — in localStorage, * and this code only displays how much of the order that balance would pay. * The place-order workflow re-reads the row and debits it; nothing here is * trusted for money. * * A tender is never a discount: the order total is unchanged, and the six * `Cart` keys this feeds (`giftCardApplied`, `giftCardLast4`, `giftCardAmount`, * `giftCardAmountPickup`, `amountDue`, `amountDuePickup`) exist on every store * so a page can bind them regardless — a store without the feature reports no * card and an amount due equal to the total. */ /** * The feature's baked settings when this store takes gift cards, or null. * * Needs a Postgres datasource: balances live in the store's own ledger tables, * which the Apply Gift Card and place-order workflows read and debit through * SQL only that family of datasources can run. */ export declare const resolveGiftCards: (ecommerceSettings: UIDLEcommerceSettings, dataSourceId: string | null | undefined, dataSourceType: string | null | undefined) => UIDLEcommerceGiftCards | null; /** * Module-scope declarations: the baked currency, the storage contract shared * with the checkout workflows, and the projection from a stored card to what * the summary rows bind. */ export declare const generateGiftCardModuleCode: (giftCards: UIDLEcommerceGiftCards) => string; /** * Provider-body state and effects: the applied card, re-read on the checkout * workflows' signal and on another tab's change, and the feature's mirror into * `workflow_cart_settings` for `cart-get-total`. * * Emitted after the provider's own `workflow_cart_settings` writer, whose * whole-key write this MERGES into. */ export declare const generateGiftCardProviderCode: () => string; /** * The `giftCardMeta` memo the `Cart` keys read, in its two shapes: priced * from the stored card when the feature is on, or the "no card" constants * with an amount due equal to each total when it is off. Emitted after * `effectiveTotal` and `pickupTotal` exist. */ export declare const generateGiftCardMetaCode: (giftCardsEnabled: boolean) => string; //# sourceMappingURL=ecommerce-gift-card-code.d.ts.map