It is easy to create a type like that:
type Foo = { a: 1; b: 2 }
I am searching for a way to map such a type to its corresponding list of of key/value pairs - the same thing one gets from Object.entries. But I neither would like to end up with [string, number][], nor ['a'|'b', 1 | 2] ([keyof Foo, Foo[keyof Foo]][]), I am searching for a result that is: [a,1] | [b,2] .
Is something like that possible?