TypeScript allows C#-like generics and generic types. More specifically, the user may define generic functions, interfaces, and classes. Constraints on generics are defined with the extends keyword followed by a type expression made of both ground types and other generic types. Variable types are manipulated either with the help of functions whose implementations will be furnished after the variable type instantiation is known, or by constraining the variable type with an interface, thus enabling all interface operations on the variable type.
The keyof and T[] operators, together with generic types, allow the explicit manipulation of type properties, and the definition of mapped types such as interface<T>, Partial<T>, Readonly<T>, Pick<K extends string, T>, and Record<T>.
The next chapter discusses how to design large code bases, keeping them...