import { StyleProp, ViewStyle, TextStyle } from 'react-native'; /** 布局方向 */ export type RadioLayout = 'left' | 'right'; /** Radio 样式配置 */ export interface RadioStyleConfig { /** Radio 圆圈大小(直径) */ radioSize?: number; /** Radio 内部圆点大小 */ innerSize?: number; /** 边框宽度 */ borderWidth?: number; /** 未选中时边框颜色 */ borderColor?: string; /** 选中时边框颜色(默认使用 activeColor) */ activeBorderColor?: string; /** 内部圆点颜色(默认使用 activeColor) */ innerColor?: string; /** Radio 圆圈样式 */ radioStyle?: StyleProp; /** 选项项的水平内边距(默认 16),设为 0 可移除 */ itemPadding?: number; /** 选项项的垂直内边距(默认 12) */ itemPaddingVertical?: number; } /** 单个 Radio 选项 */ export interface RadioOption { /** 选项值 */ value: T; /** 显示标签(文本) */ label?: string; /** 自定义标签内容(ReactNode,优先于 label) */ labelContent?: React.ReactNode; /** 是否禁用 */ disabled?: boolean; /** 副标题/描述 */ description?: string; /** 自定义描述内容(ReactNode,优先于 description) */ descriptionContent?: React.ReactNode; } /** DbRadio 组件属性 */ export interface DbRadioProps { /** 当前选中值 */ value?: T; /** 默认选中值(非受控) */ defaultValue?: T; /** 值改变回调 */ onChange?: (value: T) => void; /** 选项列表 */ options?: RadioOption[]; /** 是否禁用全部 */ disabled?: boolean; /** 布局方向:left=左侧选择框右侧文字,right=左侧文字右侧选择框 */ layout?: RadioLayout; /** 尺寸 */ size?: 'small' | 'medium' | 'large'; /** 主题色(选中状态颜色) */ activeColor?: string; /** 未选中时的颜色 */ inactiveColor?: string; /** Radio 样式配置(包含 itemPadding 等选项) */ radioConfig?: RadioStyleConfig; /** 选项间距 */ spacing?: number; /** 容器样式 */ style?: StyleProp; /** 选项行样式 */ itemStyle?: StyleProp; /** 标签文字样式 */ labelStyle?: StyleProp; /** 描述文字样式 */ descriptionStyle?: StyleProp; /** 标签文字颜色 */ labelColor?: string; /** 描述文字颜色 */ descriptionColor?: string; /** 自定义渲染选中图标 */ renderChecked?: () => React.ReactNode; /** 自定义渲染未选中图标 */ renderUnchecked?: () => React.ReactNode; } /** 单个 RadioItem 组件属性 */ export interface DbRadioItemProps { /** 选项值 */ value: T; /** 显示标签(文本) */ label?: string; /** 自定义标签内容(ReactNode,优先于 label) */ labelContent?: React.ReactNode; /** 是否选中 */ checked?: boolean; /** 是否禁用 */ disabled?: boolean; /** 副标题/描述 */ description?: string; /** 自定义描述内容(ReactNode,优先于 description) */ descriptionContent?: React.ReactNode; /** 布局方向 */ layout?: RadioLayout; /** 尺寸 */ size?: 'small' | 'medium' | 'large'; /** 主题色 */ activeColor?: string; /** 未选中时的颜色 */ inactiveColor?: string; /** Radio 样式配置 */ radioConfig?: RadioStyleConfig; /** 点击回调 */ onPress?: (value: T) => void; /** 选项行样式 */ style?: StyleProp; /** 标签文字样式 */ labelStyle?: StyleProp; /** 描述文字样式 */ descriptionStyle?: StyleProp; /** 标签文字颜色 */ labelColor?: string; /** 描述文字颜色 */ descriptionColor?: string; /** 自定义渲染选中图标 */ renderChecked?: () => React.ReactNode; /** 自定义渲染未选中图标 */ renderUnchecked?: () => React.ReactNode; } /** RadioGroup 组件属性 */ export interface DbRadioGroupProps extends DbRadioProps { /** 子元素(DbRadioItem) */ children?: React.ReactNode; }