import React from 'react'; import Options from '../../Options'; import withFormItem, { FormComponentProps } from '../withFormItem'; import { FieldValues } from 'react-hook-form'; import { OptionsProps } from 'src/components/Options/interface'; // 使用 withFormItem 创建 FormSingleCheckOptions,通过封装的类型简化 as 断言 const FormSingleCheckOptions = withFormItem( Options, 'FormSingleCheckOptions', { single: true, }, { triggerValidationOnChange: true, } ) as ( props: FormComponentProps> ) => React.ReactElement; // 导出支持泛型的类型定义 export type FormSingleCheckOptionsProps< TFieldValues extends FieldValues = FieldValues, V = unknown > = FormComponentProps>; export default FormSingleCheckOptions;