chore: comments, signature

This commit is contained in:
Evan You 2018-10-15 19:08:19 -04:00
parent 3a7d11ca15
commit be95ad00e9

View File

@ -5,6 +5,7 @@ interface ComponentConstructor<This = Component> {
} }
// mind = blown // mind = blown
// https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type
type UnionToIntersection<U> = (U extends any type UnionToIntersection<U> = (U extends any
? (k: U) => void ? (k: U) => void
: never) extends ((k: infer I) => void) : never) extends ((k: infer I) => void)
@ -15,10 +16,11 @@ type ExtractInstance<T> = T extends (infer U)[]
? UnionToIntersection<U extends ComponentConstructor<infer V> ? V : never> ? UnionToIntersection<U extends ComponentConstructor<infer V> ? V : never>
: never : never
function mixins<T extends ComponentConstructor[], V = ExtractInstance<T>>( export function mixins<
...args: T T extends ComponentConstructor[],
): ComponentConstructor<V> V = ExtractInstance<T>
function mixins(...args: any[]): any { >(...args: T): ComponentConstructor<V>
export function mixins(...args: any[]): any {
// TODO // TODO
} }