Presently, I have the code below which successfully works. X represents a union containing all the types defined within MyType. I am interested in finding out if TypeScript offers an alternative method or a utility function that can achieve the same outcome.
type MyType = {
name: string,
age: 15
}
type X = MyType[keyof MyType] // string | number