import { ChangeEvent, ReactText, ReactNode } from 'react'; import Radio from "./Radio"; export interface RadioEvent extends Omit, 'target'> { target: { checked: boolean; value?: ReactText; }; } export interface RadioProps { /** 表单项名称 */ name?: string; /** 是否选中 */ checked?: boolean; /** 默认是否选中 */ defaultChecked?: boolean; /** * 切换选中状态的回调函数 * * @param {RadioEvent} e 事件 * @return {void} */ onChange?(e: RadioEvent): void; /** 是否禁用 */ disabled?: boolean; /** value 值 */ value?: ReactText; children?: ReactNode; className?: string; } export interface RadioGroupProps { /** 默认选中的值 */ defaultValue?: ReactText; /** 选中的值 */ value?: ReactText; /** 是否禁用 */ disabled?: boolean; /** 变更选中项的回调函数 */ onChange?: (e: RadioEvent) => void; children: Array>; }