Mapped types + template literal types allow you to do some incredibly cool things.
Had someone at work ask how they can take an existing type, and slam a dollar sign in front of each property to make styled components happy—preferably without manually changing everything.
Boom
Had someone at work ask how they can take an existing type, and slam a dollar sign in front of each property to make styled components happy—preferably without manually changing everything.
Boom
Comments
The object with keys then picked by its own keys trick is highly unintuitive!
All the edge cases make implicit distribution really unintuitive and you end up wanting to opt-out fairly often with the tuple wrapping trick, i.e. `[t] extends [string]`.
Not sure if it’s correct but I always read distribution as “over”
Another case of explicit > implicit.
Type-level logic would feel so much more predictable if it didn't try so hard to guess what you want.