How to map a tuple generic type to a union type?
type NeededUnionType<T> = T[keyof T]; // Includes all the Array properties values
const value: NeededUnionType<[7, string]> = 2; // This should not be allowed (2 is the tuple length)
Expected type: 7 | string