/** * DbCityPicker 类型定义 */ import { ViewStyle } from 'react-native'; /** 省份/城市/区县数据结构 */ export interface CityArea { /** 区域编码 */ code: string; /** 区域名称 */ name: string; /** 子级区域 */ children?: CityArea[]; } /** 选中的城市数据 */ export interface SelectedCity { /** 省份 */ province: CityArea; /** 城市 */ city: CityArea; /** 区县 */ district: CityArea; /** 完整地址(拼接) */ fullAddress: string; } /** DbCityPicker Props */ export interface DbCityPickerProps { /** 省市区数据源(树形结构) */ data: CityArea[]; /** 是否可见 */ visible: boolean; /** 关闭回调 */ onClose: () => void; /** 确认回调 */ onConfirm: (selected: SelectedCity) => void; /** 标题 */ title?: string; /** 默认选中的省份编码 */ defaultProvinceCode?: string; /** 默认选中的城市编码 */ defaultCityCode?: string; /** 默认选中的区县编码 */ defaultDistrictCode?: string; /** 确认按钮文字 */ confirmText?: string; /** 取消按钮文字 */ cancelText?: string; /** 确认按钮颜色 */ confirmColor?: string; /** 取消按钮颜色 */ cancelColor?: string; /** 容器样式 */ style?: ViewStyle; } /** DbCityPickerRef */ export interface DbCityPickerRef { /** 重置选择 */ reset: () => void; /** 获取当前选中 */ getSelected: () => SelectedCity | null; }