import { StyleProp, ViewStyle, TextStyle } from 'react-native'; /** 选择模式 */ export type SelectionMode = 'single' | 'multiple'; /** 选项状态 */ export type OptionStatus = 'normal' | 'selected' | 'disabled'; /** 选项配置 */ export interface SelectionOption { /** 选项值 */ value: T; /** 显示文本 */ label: string; /** 是否禁用 */ disabled?: boolean; /** 自定义渲染内容(优先于 label) */ renderContent?: (selected: boolean) => React.ReactNode; } /** 单选按钮组属性 */ export interface DbSelectionButtonProps { /** 选择模式:单选 / 多选 */ mode?: SelectionMode; /** 选项列表 */ options: SelectionOption[]; /** 当前选中值(受控,单选为 T,多选为 T[]) */ value?: T | T[]; /** 默认选中值(非受控) */ defaultValue?: T | T[]; /** 选中值变化回调 */ onChange?: (value: T | T[]) => void; /** 多选模式下的最大选择数 */ max?: number; /** 多选模式下的最小选择数 */ min?: number; /** 是否允许取消选择(单选模式) */ deselectable?: boolean; /** 是否禁用全部 */ disabled?: boolean; /** 选中时的主色 */ activeColor?: string; /** 选中时的文字颜色 */ activeTextColor?: string; /** 选中时的背景色 */ activeBackgroundColor?: string; /** 未选中时的边框颜色 */ borderColor?: string; /** 未选中时的背景色 */ backgroundColor?: string; /** 未选中时的文字颜色 */ textColor?: string; /** 禁用时的文字颜色 */ disabledTextColor?: string; /** 禁用时的背景色 */ disabledBackgroundColor?: string; /** 圆角大小 */ borderRadius?: number; /** 边框宽度 */ borderWidth?: number; /** 字体大小 */ fontSize?: number; /** 选项内边距 */ itemPadding?: { horizontal?: number; vertical?: number; }; /** 选项间距 */ gap?: number; /** 每行最大数量(0 或 undefined 表示自动换行) */ columns?: number; /** 容器样式 */ style?: StyleProp; /** 选项样式 */ itemStyle?: StyleProp; /** 文字样式 */ textStyle?: StyleProp; /** 选中时选项样式 */ activeItemStyle?: StyleProp; /** 选中时文字样式 */ activeTextStyle?: StyleProp; /** 禁用时选项样式 */ disabledItemStyle?: StyleProp; /** 禁用时文字样式 */ disabledTextStyle?: StyleProp; }