import { StyleProp, ViewStyle, TextStyle } from 'react-native'; /** 标签位置 */ export type TagPosition = 'start' | 'end' | 'inline'; /** 标签配置 */ export interface TitleTagConfig { /** 标签文本 */ text: string; /** 标签颜色(用于边框和文字) */ color?: string; /** 背景色 */ backgroundColor?: string; /** 文字颜色(仅实体风格生效) */ textColor?: string; /** 边框色 */ borderColor?: string; /** 是否虚体风格(边框+透明背景) */ outline?: boolean; /** 自定义样式 */ style?: StyleProp; /** 自定义文字样式 */ textStyle?: StyleProp; } /** DbProductTitle 组件属性 */ export interface DbProductTitleProps { /** 商品标题文本 */ title: string; /** 最大行数(超出显示省略号) */ numberOfLines?: number; /** 前置标签列表(显示在标题前方) */ prefixTags?: TitleTagConfig[]; /** 后置标签列表(显示在标题后方) */ suffixTags?: TitleTagConfig[]; /** 标签与文字的间距 */ tagGap?: number; /** 标签之间的间距 */ tagSpacing?: number; /** 标题字号 */ fontSize?: number; /** 标题颜色 */ color?: string; /** 标题字重 */ fontWeight?: TextStyle['fontWeight']; /** 行高 */ lineHeight?: number; /** 容器样式 */ style?: StyleProp; /** 标题文字样式 */ titleStyle?: StyleProp; /** 标签容器样式 */ tagContainerStyle?: StyleProp; /** 是否高亮关键词 */ highlightKeywords?: string[]; /** 高亮颜色 */ highlightColor?: string; /** 点击回调 */ onPress?: () => void; /** 长按回调 */ onLongPress?: () => void; } /** DbProductTitleInline 组件属性(内联标签版本) */ export interface DbProductTitleInlineProps { /** 商品标题文本 */ title: string; /** 最大行数 */ numberOfLines?: number; /** 内联标签列表(与文字在同一行) */ inlineTags?: TitleTagConfig[]; /** 标签位置:start(标题前)或 end(标题后) */ tagPosition?: 'start' | 'end'; /** 标签与文字的间距 */ tagGap?: number; /** 标签之间的间距 */ tagSpacing?: number; /** 标题字号 */ fontSize?: number; /** 标题颜色 */ color?: string; /** 标题字重 */ fontWeight?: TextStyle['fontWeight']; /** 行高 */ lineHeight?: number; /** 容器样式 */ style?: StyleProp; /** 标题文字样式 */ titleStyle?: StyleProp; /** 点击回调 */ onPress?: () => void; }