Skip to content

Commit

Permalink
again...
Browse files Browse the repository at this point in the history
  • Loading branch information
pikax committed Nov 16, 2023
1 parent 86b0d67 commit 87802d7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/vueWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ function createVMProxy<T extends ComponentPublicInstance>(

type ResolveComponentEmitKeys<T> = keyof ResolveEmitRecord<T>

type ExtractArgType<T extends Array<any>> = T extends { length: 0 }
? void
: T extends { length: 1 }
? T[0]
: T

type ExtractEmitType<T> = T extends (...args: infer Args) => any
? Args extends { length: 0 }
? void
: Args extends { length: 1 }
? Args[0]
: Args
? ExtractArgType<Args>
: void

type ResolveEmitRecord<T> = ExtractComponentEmits<T> extends infer E
Expand Down

0 comments on commit 87802d7

Please sign in to comment.