import * as React from 'react'; import type { BadgeProps } from '../../components/badge.js'; /** * 按钮功能类型 */ export type ButtonFunctionType = 'buyNow' | 'addCart' | 'learnMore'; /** * 库存展示模式 */ export type StockDisplayMode = 'always' | 'never' | 'below-quantity' | 'below-percentage'; /** * 语义化类名 */ export type MediaShelfSemanticName = 'root' | 'title' | 'description' | 'productCard' | 'productCardImageBg' | 'productCardImageWrapper' | 'productCardImage' | 'productTitle' | 'productDescription' | 'productPriceLabel' | 'productPrice' | 'buttonGroup' | 'secondaryButton' | 'primaryButton' | 'stockBar'; /** * 基础产品数据接口(来自外部数据源) */ export interface BaseProductData { sku: string; name: string; image: string; value: string; handle: string; shopify_id: string; custom_name?: string; custom_description?: string; custom_image?: string; custom_link?: string; } /** * Shopify 变体数据接口 */ export interface VariantData { /** * 产品描述 */ description?: string; /** * 变体id */ variantId: string; /** * 产品链接, 点击图片的时候跳转到该链接 */ listingLink: string; /** * 原价 */ originalPrice: string; /** * 现价 */ price: string; /** * 价格上面展示的标签文本 */ priceLabel?: string; /** * 总库存 */ totalInventory: number; /** * 可用库存数量 */ quantityAvailable: number; /** * 是否可售 */ availableForSale: boolean; /** * tags 列表(会员价,折扣,new, hot等标签信息) */ tags: Array<{ label: string; variant: BadgeProps['variant']; promotionalType?: BadgeProps['promotionalType']; } | React.ReactNode>; /** * 通用折扣数据,包括折扣title, 类型和值 */ coupon: any; } /** * 完整的产品卡片数据接口 */ export interface ProductCardData extends BaseProductData, VariantData { } /** * 产品分组Tab数据接口 */ export interface ProductTab { /** Tab ID */ id: string; /** Tab 标题 */ tab: string; /** 该分组下的产品数据 */ data: ProductCardData[]; } /** * MediaShelf 文案配置接口 * 注意:secondaryButtonText 和 shopNowText 作为高频属性保持在 data 的直接属性中 */ export interface CopyConfig { /** Plus会员价格标签文本 */ plusMemberPriceLabel?: string; /** 会员价格标签文本 */ memberPriceLabel?: string; /** 库存显示文案模板,支持 {count} 占位符 */ stockDisplayText?: string; /** 上一页滑动按钮的无障碍标签(MediaShelf 专用) */ previousSlideLabel?: string; /** 下一页滑动按钮的无障碍标签(MediaShelf 专用) */ nextSlideLabel?: string; discountLabel?: string; outOfStockLabel?: string; limitedStock?: string; couponTag?: string; }