浏览代码

fix(types): stricter type condition for `EventHandlers` (#6855)

fix #6899
Johnson Chu 3 年之前
父节点
当前提交
bad3f3ce46
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/runtime-dom/types/jsx.d.ts

+ 1 - 1
packages/runtime-dom/types/jsx.d.ts

@@ -1301,7 +1301,7 @@ export interface Events {
 }
 
 type EventHandlers<E> = {
-  [K in keyof E]?: E[K] extends Function ? E[K] : (payload: E[K]) => void
+  [K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void
 }
 
 // use namespace import to avoid collision with generated types which use