diff --git a/src/components/Form/src/types/index.ts b/src/components/Form/src/types/index.ts index 53faae4f..58cd9bc9 100644 --- a/src/components/Form/src/types/index.ts +++ b/src/components/Form/src/types/index.ts @@ -1,4 +1,4 @@ -import type { Component, VNodeProps } from 'vue' +import type { Component, Ref, VNodeProps } from 'vue' type ColSpanType = number | string export interface ColEx { @@ -92,7 +92,7 @@ type MethodsNameToCamelCase< : `${M}${T}` type MethodsNameTransform = { - [K in keyof T as K extends `on${string}` ? MethodsNameToCamelCase : never]: T[K]; + [K in keyof T as K extends `on${string}` ? MethodsNameToCamelCase : never]: T[K] } type ExtractPropTypes = T extends new (...args: any) => any @@ -119,10 +119,10 @@ interface _CustomComponents { } type CustomComponents = { - [K in keyof T]: T[K] & MethodsNameTransform; + [K in keyof T]: T[K] & MethodsNameTransform } -export interface ComponentProps { +interface _ComponentProps { Input: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['default']> InputGroup: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['InputGroup']> InputPassword: ExtractPropTypes<(typeof import('ant-design-vue/es/input'))['InputPassword']> @@ -164,3 +164,11 @@ export interface ComponentProps { CronTab: CustomComponents['CronTab'] ApiCheckboxGroup: CustomComponents['ApiCheckboxGroup'] & ComponentProps['CheckboxGroup'] } + +type ExtendRefTypes = T extends any ? Ref : never + +export type ComponentProps = { + [K in keyof _ComponentProps]: { + [Key in keyof _ComponentProps[K]]: _ComponentProps[K][Key] | ExtendRefTypes<_ComponentProps[K][Key]> + } +}