feat(types): mixins/extends support in TypeScript (#626)
This commit is contained in:
@@ -12,6 +12,7 @@ import { ComponentInternalInstance } from './component'
|
||||
import { callWithAsyncErrorHandling, ErrorCodes } from './errorHandling'
|
||||
import { warn } from './warning'
|
||||
import { normalizePropsOptions } from './componentProps'
|
||||
import { UnionToIntersection } from './helpers/typeUtils'
|
||||
|
||||
export type ObjectEmitsOptions = Record<
|
||||
string,
|
||||
@@ -19,12 +20,6 @@ export type ObjectEmitsOptions = Record<
|
||||
>
|
||||
export type EmitsOptions = ObjectEmitsOptions | string[]
|
||||
|
||||
type UnionToIntersection<U> = (U extends any
|
||||
? (k: U) => void
|
||||
: never) extends ((k: infer I) => void)
|
||||
? I
|
||||
: never
|
||||
|
||||
export type EmitFn<
|
||||
Options = ObjectEmitsOptions,
|
||||
Event extends keyof Options = keyof Options
|
||||
|
||||
Reference in New Issue
Block a user