/// import { FieldPath, FieldValues, UseControllerProps, UseFormReturn } from "react-hook-form"; /** 工具 取函数第0个参数 */ export type FunctionsProp0 any> = Parameters[0]; /** 工具 把类型的属性指定为为某个类型 * @description 把 T 的所有属性置为 V */ export type TypeConversion = { [P in keyof T]?: V; }; /** value必须和onChange保持一致 */ export type IChange = ((value: T) => void); /** Form表单组件入参基本参数 * @param TValue 组件绑定的数据类型 */ export type IFormComponentPropsBase = { /** 错误状态 */ error?: boolean; /** 组件下提示文本 */ helperText?: string | JSX.Element; /** 组件内提示 */ label?: string | JSX.Element; /** 表单值 */ value?: TValue; /** 更新值 */ onChange?: IChange; /** 用于Select同时绑定多个Form属性 * @description 如果需要使用otherNames属性绑定多个属性, 请实现该方法 */ onItemChange?: IChange; }; /** Form表单组件 */ export type IFormComponentBase = (props: IFormComponentPropsBase) => JSX.Element; /** Form表单组件入参 * @description 剔除原始组件的同名参数 */ export type IFormComponentProps = IFormComponentPropsBase & Partial>; /** Form表单内容Store */ export type IFormReturnProps = UseFormReturn; /** Form 单项可注入参数 */ export type IFormItemProps = FieldPath> = UseControllerProps; /** 返回组件入参 */ export type ReturnComponentProps = FieldPath, TValue = TForm[TName], TItem = null, /** 组件原始入参 */ TFormComponentProps extends IFormComponentPropsBase = IFormComponentPropsBase> = IFormItemProps & Omit & { defaultErrorMessage?: string | JSX.Element; /** 同时绑定多个Form属性 * @description 如果需要使用otherNames属性绑定多个属性, 请在原始组件中实现onItemChange方法 */ otherNames?: TypeConversion; }; /** 返回组件 */ export type ReturnComponent = FieldPath, TIFormComponentBase extends IFormComponentBase = IFormComponentBase> = (props: Omit[0], keyof IFormItemProps> & IFormItemProps & { defaultErrorMessage?: string | JSX.Element; /** 同时绑定多个Form属性 * @description 如果需要使用otherNames属性绑定多个属性, 请在原始组件中实现onItemChange方法 */ otherNames?: TypeConversion[0]["onItemChange"] extends IChange ? Parameters[0]["onItemChange"]>[0] : { [props: string]: any; }, TName>; }) => JSX.Element; //# sourceMappingURL=type.d.ts.map