TypeScript: Conditional Types Explained
Learn what conditionals are and how they are used in TypeScript
Conditionals in TypeScript, also introduced in the TypeScript handbook, allow us to deterministically define types depending on what parameterised types consist of. The general basic rule is:
type ConditionalType = T extends U ? X : Y