Intermediate TypeScript

It's relatively easy to get started with TypeScript, but the learning curve becomes much steeper once things become more complex and abstract. This workshop teaches you how to 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

03Modules & 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

04Type Queries

Type queries allow us to obtain type information from values. As we work toward building our own "standard library" of utility types, we'll need this important tool in our toolbox

05Conditional 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

06Extract and Exclude

Now that we've learned about conditional types, let's study the built-in utility types Extract and Exclude, which are *implemented* with conditional types

07Inference 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

08Indexed Access Types

Indexed Access types provide a mechanism for retrieving part(s) of an array or object type via indices.

09Mapped Types

Mapped allow types to be defined in other types through a much more flexible version of an index signature. We'll study this type in detail, and demonstrate how it makes language features like indexed access types and conditional types even more powerful!

© 2021 All Rights Reserved.