Day 11 of 14 35 minkeyof & typeofMapped typesConditional types
Write your own type transformations. Use keyof and typeof to get types from types and values, indexed access types, mapped types that transform every property, conditional types with infer, and template literal types for string patterns.
By the end of today you can
- Use keyof, typeof and indexed access types
- Write mapped types, including key remapping
- Write conditional types and use infer to extract types
- Build string patterns with template literal types
- Recognise when advanced types are worth the complexity
What's inside
- 5 sections
- 2 diagrams and mind maps
- 5 code examples you can run
- 5-question quiz
- 1typeof, keyof and indexed access
- 2Mapped types
- 3Conditional types
- 4Template literal types
- 5Putting it together: typed event emitter
Sign in free to read this lesson
Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.
Sign in free