Engrain by ByteRush

TS.05.04 Mid-level

Template literal types

Comes up in: Coding

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • string unions combined
  • Uppercase/Capitalize intrinsics
  • parsing strings with infer (route params "/users/:id" → { id: string })

Words you will know

template literal typeintrinsic string type

What you will practise

  • typed event names on${Capitalize<E>}
  • route param extraction

Interview questions this answers

  • Extract route parameters from "/users/:id/posts/:postId" as a type.