Skip to content

Commit

Permalink
fix(runtime-core): correct type inference for PascalCase emits
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Aug 10, 2024
1 parent 28db2e6 commit fd3e9c9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/runtime-core/src/componentEmits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ export type EmitsToProps<T extends EmitsOptions> = T extends string[]
}
: T extends ObjectEmitsOptions
? {
[K in `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}`
? (
...args: T[Uncapitalize<C>] extends (...args: infer P) => any
? P
: T[Uncapitalize<C>] extends null
? any[]
: never
) => any
: never
[K in keyof T as `on${Capitalize<string & K>}`]?: (
...args: T[K] extends (...args: infer P) => any
? P
: T[K] extends null
? any[]
: never
) => any
}
: {}

Expand Down

0 comments on commit fd3e9c9

Please sign in to comment.