TypeScript Foundations
Use TypeScript to express contracts and catch mistakes without confusing compile-time types with runtime validation.
Lessons
Inference, Annotations, and Object Types
Let TypeScript infer obvious local values; annotate public boundaries where the contract is valuable documentation.
Lab — Inference, Annotations, and Object Types
Hands-on transfer lab for the preceding concept.
Unions, Literals, and Narrowing
Literal unions model closed domain choices more accurately than arbitrary string.
Lab — Unions, Literals, and Narrowing
Hands-on transfer lab for the preceding concept.
Interfaces, Type Aliases, and Generics
Interfaces and type aliases overlap for object modeling; choose consistency and clarity over ideology.
Lab — Interfaces, Type Aliases, and Generics
Hands-on transfer lab for the preceding concept.
Utility Types and Contract Transformation
Pick, Omit, Partial, Record, Awaited, and related utilities transform existing types.
Lab — Utility Types and Contract Transformation
Hands-on transfer lab for the preceding concept.
TypeScript vs Runtime Validation
TypeScript is erased before JavaScript executes, so external JSON can violate every declared type.
Lab — TypeScript vs Runtime Validation
Hands-on transfer lab for the preceding concept.