View the Frontend Masters video course for Intermediate TypeScript v2 here

Intermediate TypeScript v2

Leverage TypeScript's strengths to provide clarity in the face of complexity, while protecting your codebase and team from it's weaknesses.

01Intro

We'll discuss the goals and agenda of this course, and how to get up and running with the workshop project in 2 minutes or less.

02Declaration Merging

In order to truly understand how types and values "stack" on each other, we'll first tackle the concept of declaration merging. Often when people grasp how TypeScript handles this, they never look at the language the same way again

03Top and bottom types

Top types can be anything, bottom types can't be anything. We will also look at three "extreme types" in TypeScript: any, unknown and never.

04Nullish values

There are situations where we have to plan for, and deal with the possibility that values are null or undefined. In this chapter, we will dive deep into null, undefined, definite assignment, and the non-null assertion operator.

05Modules & CJS interop

Although most of the code we write today is in the form of ES modules, plenty of dependencies are packaged in the CommonJS module format. In this chapter, we'll look at modules in depth so that you have all the tools you need in order to consume all the dependencies you care about, while keeping the TS compiler happy

06Generics Scopes and Constraints

In this chapter, we'll learn about scopes and constraints, as they pertain to type params, and what the language would look like if we didn't have these important tools

07Conditional Types

Conditional types can be thought of as "a ternary operator, for types". While there is no "control flow" in a world where we're describing constraints with types (instead of procedural steps to execute "in a flow"), this tool does provide an important foundation for switching logic based on type information

08Inference with conditional types

Conditional types are not just for switching behavior based on comparison -- they can be used with an 'infer' keyword to access sub-parts of type information within a larger type

09Mapped Types

Mapped types are a powerful feature in TypeScript that allows you to create new types based on existing ones by transforming properties in a controlled manner.

10Type registry: revisited

Unlock the mysteries of type relationships with a deep dive into covariance, contravariance, and invariance. Learn how these concepts shape type systems, enhance code safety, and influence design decisions in TypeScript projects.

11Variance over type params

Unlock the mysteries of type relationships with a deep dive into covariance, contravariance, and invariance. Learn how these concepts shape type systems, enhance code safety, and influence design decisions in TypeScript projects.

© 2023 All Rights Reserved.