import type { BadgeProps } from '../../components/badge.js'; /** * 按钮功能类型 */ export type ButtonFunctionType = 'buyNow' | 'addCart' | 'learnMore'; /** * CreditShelf 文案配置接口 */ export interface CopyConfig { /** 积分兑换标签文本 */ redeemLabel?: string; /** 积分抵现提示文本模板,支持 {amount} 占位符 */ creditsSavingLabel?: string; /** 上一页滑动按钮的无障碍标签 */ previousSlideLabel?: string; /** 下一页滑动按钮的无障碍标签 */ nextSlideLabel?: string; /** 售罄标签文本 */ outOfStockLabel?: string; } /** * 语义化类名 */ export type CreditsShelfSemanticName = 'root' | 'header' | 'title' | 'subtitle' | 'description' | 'productCard' | 'productTitle' | 'productDescription' | 'productPriceLabel' | 'productPrice' | 'buttonGroup' | 'secondaryButton' | 'primaryButton' | 'creditTip'; /** * 组件布局模式 */ export type CreditsShelfLayoutMode = 'flex' | 'horizontal'; /** * 基础产品数据接口(来自外部数据源) */ export interface BaseProductData { sku: string; name: string; image: string; value: string; handle: string; shopify_id: string; custom_name?: string; custom_description?: string; } /** * Shopify 变体数据接口 */ export interface VariantData { /** 产品描述 */ description?: string; /** 变体id */ variantId: string; /** 产品链接, 点击图片的时候跳转到该链接 */ listingLink: string; /** 原价 */ originalPrice?: string; /** 现价 */ price: string; /** 价格上面展示的标签文本(如 Redeem Credits) */ priceLabel?: string; /** 是否可售 */ availableForSale: boolean; /** 积分抵现金额(用于底部提示) */ creditSavingAmount?: string; /** tags 列表(会员价,折扣,new, hot等标签信息) */ tags: Array<{ label: string; variant: BadgeProps['variant']; promotionalType?: BadgeProps['promotionalType']; } | React.ReactNode>; } /** * 完整的产品卡片数据接口 */ export interface CreditsProductCardData extends BaseProductData, VariantData { }