import { StyleProp, ViewStyle, TextStyle } from 'react-native'; import type { DbSearchBarProps } from '../DbSearchBar/DbSearchBar.types'; /** 搜索历史项 */ export interface SearchHistoryItem { /** 唯一标识 */ id: string; /** 搜索关键词 */ text: string; /** 搜索时间戳 */ timestamp?: number; /** 额外数据 */ extra?: Record; } /** 热门推荐项 */ export interface HotSearchItem { /** 唯一标识 */ id: string; /** 显示文本 */ text: string; /** 是否标记为热门 */ isHot?: boolean; /** 额外数据 */ extra?: Record; } /** DbSearchHistory 组件属性 */ export interface DbSearchHistoryProps { /** 搜索栏属性透传(继承 DbSearchBar 的所有属性) */ searchBarProps?: Partial; /** 搜索历史列表 */ historyList?: SearchHistoryItem[]; /** 历史记录最大数量 */ maxHistory?: number; /** 历史标题文案 */ historyTitle?: string; /** 点击历史项回调 */ onHistoryPress?: (item: SearchHistoryItem) => void; /** 删除单个历史记录回调 */ onHistoryDelete?: (item: SearchHistoryItem) => void; /** 清空全部历史记录回调 */ onHistoryClear?: () => void; /** 是否显示删除图标(单个删除模式) */ showDeleteIcon?: boolean; /** 是否显示清空按钮 */ showClearButton?: boolean; /** 热门搜索列表 */ hotList?: HotSearchItem[]; /** 热门搜索标题文案 */ hotTitle?: string; /** 点击热门搜索回调 */ onHotPress?: (item: HotSearchItem) => void; /** 是否显示刷新按钮 */ showRefreshButton?: boolean; /** 刷新热门搜索回调 */ onRefresh?: () => void; /** 是否显示查看更多按钮 */ showMoreButton?: boolean; /** 查看更多回调 */ onMore?: () => void; /** 是否显示左侧返回按钮 */ showBack?: boolean; /** 返回按钮回调 */ onBack?: () => void; /** 搜索回调 */ onSearch?: (keyword: string) => void; /** 容器样式 */ style?: StyleProp; /** 搜索栏区域样式 */ searchBarContainerStyle?: StyleProp; /** 标题样式 */ titleStyle?: StyleProp; /** 标签样式 */ tagStyle?: StyleProp; /** 标签文字样式 */ tagTextStyle?: StyleProp; /** 历史区域样式 */ historyContainerStyle?: StyleProp; /** 热门搜索区域样式 */ hotContainerStyle?: StyleProp; }