Declaration 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
Top and bottom types
Top types ca...
Declaration 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
Top 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.
Nullish 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.
Modules & 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
Generics 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
Conditional 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
Inference 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
Mapped 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.
Type 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.
Variance 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.
Size: 309.24 KB
Language: en
Added: Sep 14, 2024
Slides: 1 pages
Slide Content
CERTIFICATE OF COMPLETION
Check out my profile!
Ronny Freites
has successfully completed
Intermediate TypeScript, v2
5 hours, 3 minutes
Mike North
Teacher
Frontend Masters Marc Grabanski
CEO Frontend Masters
Completed: Jul 24, 2024