types: 更新组件事件类型定义

pull/50/head^2
chenminjie 2024-11-26 20:39:03 +08:00
parent 73e1ae0a4e
commit 4309be7188
1 changed files with 8 additions and 3 deletions

View File

@ -60,6 +60,8 @@ export type MaybeComponentPropKey =
| keyof HtmlHTMLAttributes
| (Record<never, never> & string);
export type MaybeComponentEvents = { [K in MaybeComponentPropKey]?: any };
export type MaybeComponentProps = { [K in MaybeComponentPropKey]?: any };
export type FormActions = FormContext<GenericObject>;
@ -128,9 +130,12 @@ export interface FormItemDependencies {
triggerFields: string[];
}
type ComponentEvents = {
[K: string]: (...args: any[]) => void;
} & Record<string, any>;
type ComponentEvents =
| ((
value: Partial<Record<string, any>>,
actions: FormActions,
) => MaybeComponentEvents)
| MaybeComponentEvents;
type ComponentProps =
| ((