Chapter
sourceRoot and sourceMap and mapRoot
Files and include and exclude
Declaration and declarationdir
Module and ModuleResolution
StrictPropertyInitialization and StricNullChecks
Chapter 2: Onboarding Types with Primitive
The difference between var, let, and const
Enhancing primitives with TypeScript
The reasons to avoid using any type
Unknown type to have a stricter any type
Enforcing a type in a list
Defining a conscribed set of constants with enum
String literal and its difference compared to a string
Crafting a typed function
How to be strongly typed without specifying the type
Chapter 3: Unleashing the Power of Type with Objects
How to strongly type a set/dictionary with an index signature
The differences between index signature and a map
The differences between object and Object
When to use object, Object, or any
What is an object literal?
How to create a constructed object
The differences between an explicit type and a cast
Combining type with intersect
Intersecting with something other than a type
Intersecting with an optional type
Merge type with inheritance
The differences between type and interface
Destructuring a type and an array
The differences between declare and let/const/var
Chapter 4: Transforming Your Code into Object-Oriented
What is a class and how do we define one?
How type comes into play with a class's constructor
What is encapsulation using public, private, and protected
Reducing the definition of a field with a value set at construction time
Use cases for a non-public constructor
Using an object from a class versus an object literal
How an interface can be useful in object-oriented
Bringing abstraction with an abstract class
How to have a property that is read-only
Enforcing a specific constructor from an interface
Chapter 5: Scoping Variables with Different Patterns
Comparing at runtime and design time with typeof
Differentiating undefined from null
Getting the type of element in a union
The limitations of instanceof
Using of a discriminator for type identification
The user-defined guard pattern
The reason to cast a type
What is a type assertion?
Narrowing type for function with a union in signatures
Chapter 6: Reusing Code Through Generic
Generic code to increase reusability
Accepted kinds of data structure for generic type
Constaining a generic type
Generic constraints with a union type
Restricting string choices with keyof
Limiting the access to members of a generic type
Reducing your type creation with mapped type
Chapter 7: Mastering the Art of Defining Types
How to use a third-party library definition file
How typescript can generate a definition file
How to manually add a definition file for a JavaScript project
How to merge types into an existing definition file
Creating a definition file for a JavaScript project
Definition file for global structure library
Definition file for module library
JavaScript library without a definition file
Using another module from a definition file
Adding a definition file to an extension of an existing module
Other Books You May Enjoy