01Intro
October 25, 2023We'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.
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.
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
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.
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.
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
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
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
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
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.
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.
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.