I have tuple of Maybe
types:
class Maybe<T>{ }
type MaybeTuple = [Maybe<string>, Maybe<number>, Maybe<boolean>];
and I want to turn this into a tuple of types:
type TupleIWant = [string, number, boolean];
so I tried this:
type ExtractTypes<T> = T extends Maybe<infer MaybeTypes>[] ? MaybeTypes : never;
type TypesArray = ExtractTypes<MaybeTuple>; // string | number | boolean NOT [string, number, boolean]
Which doesn't work :-(
I get (string | number | boolean)[]
rather than the tuple I want: [string, number, boolean]
Is what I want to do currently possible?