How can I reverse the keys and values of a record literal in typescript?
For example:
type Foo = { x: "a", y: "b", z: "c" };
I want to create a type Flip<X>
where:
type Bar = Flip<Foo>; // should result in { a: "x", b: "y", c: "z" };
This is purely a theoretical exercise with types and not related to actual runtime values.