import { StyleProp, ViewStyle, TextStyle, TouchableOpacityProps } from 'react-native'; /** 图标位置 */ export type IconPosition = 'left' | 'right'; /** 图标库类型 */ export type IconFamily = 'Ionicons' | 'FontAwesome' | 'MaterialIcons' | 'Entypo' | 'AntDesign'; /** 按钮图标配置 */ export interface ButtonIconConfig { /** 图标名称 */ name: string; /** 图标库 */ family?: IconFamily; /** 图标大小 */ size?: number; /** 图标颜色 */ color?: string; /** 图标位置 */ position?: IconPosition; /** 图标与文字的间距 */ spacing?: number; } export interface DbButtonProps extends Omit { /** 按钮文字 */ title?: string; /** 点击事件 */ onPress?: () => void; /** 是否加载中 */ loading?: boolean; /** 是否禁用 */ disabled?: boolean; /** 按钮样式变体 */ variant?: 'primary' | 'secondary' | 'outline' | 'ghost'; /** 按钮尺寸 */ size?: 'small' | 'medium' | 'large'; /** 自定义容器样式 */ style?: StyleProp; /** 自定义文字样式 */ textStyle?: StyleProp; /** 图标配置 */ icon?: ButtonIconConfig | React.ReactNode; /** 左侧图标(快捷方式) */ leftIcon?: ButtonIconConfig | React.ReactNode; /** 右侧图标(快捷方式) */ rightIcon?: ButtonIconConfig | React.ReactNode; /** 防抖延迟时间(毫秒),设置后启用防抖 */ debounce?: number; /** 节流延迟时间(毫秒),设置后启用节流 */ throttle?: number; /** 是否只显示图标(无文字) */ iconOnly?: boolean; /** 加载中的文字 */ loadingText?: string; } export type ButtonProps = DbButtonProps;