fix(types): fix tsx emit-mapped handler return type (#4290)

fix #4288
This commit is contained in:
webfansplz
2021-08-11 22:52:36 +08:00
committed by GitHub
parent 380608bd44
commit 1ce34e25d5
2 changed files with 32 additions and 1 deletions

View File

@@ -44,7 +44,11 @@ export type EmitsToProps<T extends EmitsOptions> = T extends string[]
`on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}`
? T[Uncapitalize<C>] extends null
? (...args: any[]) => any
: T[Uncapitalize<C>]
: (
...args: T[Uncapitalize<C>] extends (...args: infer P) => any
? P
: never
) => any
: never
}
: {}