Let's consider a scenario where I have a tuple type structured like this:
type Data<T extends string, V> = { type: T, value: V };
type TupleExample = [
Data<'string', string>,
Data<'number', number>,
Data<'integer', number>
];
My goal is to transform the type TupleExample
into the following type:
type ObjectTuple = {
string: string,
number: number,
integer: number,
};
I'm wondering if there is a way to achieve this and if so, what steps do I need to take? Currently, I've been able to generate the type as shown below:
type ObjectTuple = {
string: string | number,
number: string | number,
integer: string | number,
};