How do I get the type of values from an object as a tuple of those types?
type Obj = { a: true, b: 1 }
type ValueTuple<T extends object> = ???
type Test = ValueTuple<Obj> // [true, 1]
How do I get the type of values from an object as a tuple of those types?
type Obj = { a: true, b: 1 }
type ValueTuple<T extends object> = ???
type Test = ValueTuple<Obj> // [true, 1]
I don't think that you can get values as types. Even if you could, this is a bad idea. This previously answered question, How to transform union type to tuple type is a far better answer than I could give :)