import * as React from 'react'; import 'swiper/css'; import 'swiper/css/navigation'; import type { ButtonFunctionType, CopyConfig, ProductCardData, ProductTab, StockDisplayMode, MediaShelfSemanticName } from './types.js'; import ProductCard from './ProductCard.js'; /** * Code Channel 配置 - 折扣前缀 */ export type CodeChannelConfig = string; /** * MediaShelf Context 配置接口 */ export interface MediaShelfContextConfig { /** Code Channel 配置 - 折扣前缀 */ codeChannel?: CodeChannelConfig; /** 是否展示会员价格 */ showMemberPrice?: boolean; /** 是否展示折扣标签 */ showDiscount?: boolean; /** 是否展示标签系统 */ showTags?: boolean; /** 库存展示模式 */ stockDisplayMode?: StockDisplayMode; /** 库存阈值(当模式为 below-quantity 或 below-percentage 时使用) */ stockThresholdValue?: number; /** 是否展示原价(删除线价格) */ showOriginalPrice?: boolean; } /** * MediaShelf Context 值接口 */ interface MediaShelfContextValue extends MediaShelfContextConfig { /** 点击了解更多回调 */ onLearnMore?: (product: ProductCardData) => void; /** 点击立即购买回调 */ onShopNow?: (product: ProductCardData) => void; /** 点击加入购物车回调 */ onAddToCart?: (product: ProductCardData) => void; /** 语义化类名 */ classNames?: Partial>; /** 了解更多按钮文本 */ secondaryButtonText?: string; secondaryButtonFun?: ButtonFunctionType; /** 立即购买按钮文本 */ primaryButtonText?: string; primaryButtonFun?: ButtonFunctionType; /** 文案配置 */ copy: CopyConfig; } /** * 使用 MediaShelf Context 的 Hook */ export declare const useMediaShelfContext: () => MediaShelfContextValue; /** * MediaShelf 业务组件数据接口 */ export interface MediaShelfData { theme?: 'light' | 'dark'; /** 组件标题 */ title?: string; /** 组件描述 */ description?: string; /** 分组产品Tab列表 */ productsTab?: ProductTab[]; /** 是否显示 Tab(默认:true) */ isShowTab?: boolean; /** 了解更多按钮文本 */ secondaryButtonText?: string; secondaryButtonFun: ButtonFunctionType; /** 立即购买按钮文本 */ primaryButtonText?: string; primaryButtonFun: ButtonFunctionType; /** Code Channel 配置 - 折扣前缀 */ codeChannel?: CodeChannelConfig; /** 是否展示会员价格 */ showMemberPrice?: boolean; /** 是否展示折扣标签 */ showDiscount?: boolean; /** 是否展示标签系统 */ showTags?: boolean; /** 库存展示模式 */ stockDisplayMode?: StockDisplayMode; /** 库存阈值(当模式为 below-quantity 或 below-percentage 时使用) */ stockThresholdValue?: number; /** * 库存文本模板,支持 {count} 占位符 */ stockDisplayText?: string; /** 是否展示原价(删除线价格) */ showOriginalPrice?: boolean; /** 文案配置 */ copy?: CopyConfig; /** * 产品列表(当不使用 Tab 分组时可直接传入产品列表) */ productsCard: ProductCardData[]; } export interface MediaShelfProps extends React.HTMLAttributes { /** 业务数据 */ data: MediaShelfData; /** 点击了解更多回调 */ onLearnMore?: (product: ProductCardData) => void; /** 点击立即购买回调 */ onShopNow?: (product: ProductCardData) => void; /** 点击加入购物车回调 */ onAddToCart?: (product: ProductCardData) => void; /** 语义化类名 */ classNames?: Partial>; } /** * MediaShelf 复合组件类型定义 */ export interface MediaShelfComponent extends React.ForwardRefExoticComponent> { /** 独立的 ProductCard 组件 */ ProductCard: typeof ProductCard; } declare const MediaShelfWrapped: any; export default MediaShelfWrapped;