Closed whitetrefoil closed 6 years ago
Thanks! I'll update it when I have time!
I think there is an inherent problem in TypeScript to support this: we cannot manipulate tuples in TS3.0.
Think about this: given a tuple type T
, return a intersection type of which the components are elements in the tuple type T
.
Naively we would write something like:
type TupleToIntersection<T extends any[]> = T extends [any] ? T[0] : T[0] & TupleToIntersection<Tail<T>>
Sadly, TS3.0 doesn't allow recursive conditional type, such construction will trigger a compiler error.
The same rule applies to Mixin
function.
So sad... I feel this will not be a soon coming feature in the next TS releases...
I just saw TS3.0 introduced generic rest parameters, will this bring the possibility of a better
Mixin
?