From 4309be7188032c5329df3fc32634019c634ccf08 Mon Sep 17 00:00:00 2001 From: chenminjie <943130926@qq.com> Date: Tue, 26 Nov 2024 20:39:03 +0800 Subject: [PATCH] =?UTF-8?q?types:=20=E6=9B=B4=E6=96=B0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@core/ui-kit/form-ui/src/types.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/@core/ui-kit/form-ui/src/types.ts b/packages/@core/ui-kit/form-ui/src/types.ts index cadf794c..f9bc9d29 100644 --- a/packages/@core/ui-kit/form-ui/src/types.ts +++ b/packages/@core/ui-kit/form-ui/src/types.ts @@ -60,6 +60,8 @@ export type MaybeComponentPropKey = | keyof HtmlHTMLAttributes | (Record & string); +export type MaybeComponentEvents = { [K in MaybeComponentPropKey]?: any }; + export type MaybeComponentProps = { [K in MaybeComponentPropKey]?: any }; export type FormActions = FormContext; @@ -128,9 +130,12 @@ export interface FormItemDependencies { triggerFields: string[]; } -type ComponentEvents = { - [K: string]: (...args: any[]) => void; -} & Record; +type ComponentEvents = + | (( + value: Partial>, + actions: FormActions, + ) => MaybeComponentEvents) + | MaybeComponentEvents; type ComponentProps = | ((