diff --git a/src/util.ts b/src/util.ts index 40ae747..ff61202 100644 --- a/src/util.ts +++ b/src/util.ts @@ -32,12 +32,21 @@ export function createDecorator (factory: (options: ComponentOptions, key: } } -export function mixins (CtorA: VueClass): VueClass -export function mixins (CtorA: VueClass, CtorB: VueClass): VueClass -export function mixins (CtorA: VueClass, CtorB: VueClass, CtorC: VueClass): VueClass -export function mixins (CtorA: VueClass, CtorB: VueClass, CtorC: VueClass, CtorD: VueClass): VueClass -export function mixins (CtorA: VueClass, CtorB: VueClass, CtorC: VueClass, CtorD: VueClass, CtorE: VueClass): VueClass -export function mixins (...Ctors: VueClass[]): VueClass +export type UnionToIntersection = (U extends any +? (k: U) => void +: never) extends (k: infer I) => void + ? I + : never + +export type ExtractInstance = T extends VueClass ? V : never + +export type MixedVueClass< + Mixins extends VueClass[] +> = Mixins extends (infer T)[] + ? VueClass>> + : never + +export function mixins[]>(...Ctors: T): MixedVueClass export function mixins (...Ctors: VueClass[]): VueClass { return Vue.extend({ mixins: Ctors }) }