const X= "Hey"
const Y= "See ya"
const Z="Bar"
const myArray=[X,Y,Z]
type TransformArrayToUnion<myArrayOfConstants>
==> The expected type output should be: "Hey" | "See ya" | "Bar".
I attempted it with
type TransformArrayToUnion<T extends readonly string[]>= T[number]
However, in this scenario, I am not passing an array of strings, but the variable name of each constant (which seems to be a tupple), so it fails to function as intended.