]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(types): stricter type condition for `EventHandlers` (#6855)
authorJohnson Chu <johnsoncodehk@gmail.com>
Tue, 8 Nov 2022 15:37:37 +0000 (23:37 +0800)
committerGitHub <noreply@github.com>
Tue, 8 Nov 2022 15:37:37 +0000 (10:37 -0500)
fix #6899

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

index 6120f77715adf19d3df8f5e1959bf0e0c9137948..5898b5e0d5f6c8c98a323e9fb6e7ae2fdafeb6b5 100644 (file)
@@ -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