diff --git a/packages/core/src/optional/mixin.ts b/packages/core/src/optional/mixin.ts index 152aba37..0fbd7fca 100644 --- a/packages/core/src/optional/mixin.ts +++ b/packages/core/src/optional/mixin.ts @@ -5,6 +5,7 @@ interface ComponentConstructor { } // mind = blown +// https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) @@ -15,10 +16,11 @@ type ExtractInstance = T extends (infer U)[] ? UnionToIntersection ? V : never> : never -function mixins>( - ...args: T -): ComponentConstructor -function mixins(...args: any[]): any { +export function mixins< + T extends ComponentConstructor[], + V = ExtractInstance +>(...args: T): ComponentConstructor +export function mixins(...args: any[]): any { // TODO }