Effective TypeScript › Using infer to unpack nested types
TypeScript's infer keyword can infer quite a bit more than you might expect. It's extremely effective at extracting types from the sort of nested structures that you might get from codegen or an API specification.