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

fix #6899
This commit is contained in:
Johnson Chu 2022-11-08 23:37:37 +08:00 committed by GitHub
parent dd3354c4c7
commit bad3f3ce46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View 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