import React, { ReactNode } from "react"; export interface RadioBaseInterFace { /** * 是否禁用 */ disabled?: boolean; /** * √ * 监听数值变化 */ onChange?: (value: boolean, e: React.ChangeEvent) => void; /** * input属性 */ inputAttributes?: JSX.IntrinsicElements['input']; /** * 传入state变量则开启受控模式 */ checked?: boolean; /** * Radio值 */ value: string | number; /** * label * 没有children是则使用value作为label */ children?: ReactNode | ((checked: boolean) => ReactNode); } export declare type RadioPropsType = RadioBaseInterFace & Pick; export declare type RadioGroupType = { /** * Radio组内容 */ children?: ReactNode; defaultValue?: string | number; /** * RadioGroup值 * 传入state变量则开启受控模式 */ value?: string | number; /** * 单选组单选对象 */ options?: ((string | number) | { label: ReactNode; value: string; })[]; /** * 自定义Label */ customLabel?: (checked: boolean, label: ReactNode) => ReactNode; /** * 选择值变化触发 */ onCheckedChange?: (value: string | number) => void; } & Pick; export declare type RadioGroupContextType = { name: string; inRadioGroup: boolean; value?: string | number; } & Pick;