Loading topic
T extends U ? X : Y. TypeScript chooses X when T is assignable to U; otherwise, it chooses Y.2 min readkeyof, function signatures, and basic template literal types.1 min readT extends U ? X : Y chooses X when T is assignable to U; otherwise, it chooses Y.2 min readinfer variable receives more than one possible type.2 min readPromise types. This chapter focuses on the working model for recursive conditional types and the common mistakes that make them fail.2 min readkeyof, and basic mapped types. We will combine these features to make a type that recursively marks every property in a structure as readonly.2 min readinfer to split a string literal type into smaller parts, then recurse over those parts.2 min read...Rest, captures the remaining elements as another tuple.2 min read