TypeScript Pro Essentials

TypeScript Pro Essentials

English | MP4 | AVC 1920×1080 | AAC 44KHz 2ch | 369 Lessons (11h 2m) | 3.42 GB

You’ve tested the waters with TypeScript, but deep down you know that you’re missing something.

You’ve heard that TypeScript is the answer to all the problems that come with JavaScript– things like clunky autocompletion, runtime errors, and scaling for large projects.

So why do you still feel like you’re not getting the most out of TypeScript?

You keep hitting type-related roadblocks, struggle with configuration, and feel limited by your understanding of the more advanced features. You know it’s time to push yourself further, but you’re not sure where to start.

What you’ve heard about TypeScript is true. It will help you catch errors before they happen, write cleaner code, and refactor with confidence. But to get there, you need a guide.

Total TypeScript Pro Essentials is what you’ve been looking for. This workshop is your map to becoming a TypeScript Wizard.

With over 200 lessons in 17 sections, this workshop will help you build a deep understanding of TypeScript at every level.

From configuration and IDE setup, to advanced type manipulation and best practices for application development, Total TypeScript Pro Essentials has it all. Whether you’re brand new to TypeScript or have been using it for years, you are sure to take away valuable knowledge and skills from this workshop.

Here’s what’s included:

Introduction to TypeScript
Kickstart your TypeScript setup with a refresher on the core benefits and concepts of TypeScript: initial configuration, the TypeScript compiler, and type inference.

Follow the recommended setup and extensions for your editor, with a focus on Visual Studio Code, and become familiar with features like navigation, autocompletion, refactoring, and writing self-documenting code.

Understand TypeScript’s role in the build process, and why browsers need help understanding the syntax. Structure your project to work nicely with the compiler, and configure for working with modern build tools like Vite and hot module replacement (HMR). Practice setting up type checking in a CI/CD pipeline, preventing errors from reaching production.

TypeScript Fundamentals
Reinforce your foundational skills by working with TypeScript’s essential types and annotations. You’ll work with function parameters and return types, and model data with object literal types, arrays, and tuples. Write reusable type aliases, correctly type async code, and handle data that comes from external sources. Create more flexible types by using unions, intersections, and interfaces.

Write more expressive code that refines types through several narrowing techniques, and recognize the role of any, never, and unknown in your codebase.

Objects, Classes, and Mutability
Types, interfaces, and classes all have their place in TypeScript. Learn the differences between them, and how to choose the right structure for your needs. Work with dynamic data in objects, and and overcome index signature limitations by using mapped types. Practice using essential type helpers like Pick, Omit, and Partial, and how to build your own helper when you need to.

Develop the mental model for how mutability affects type inference and safety. Recognize the benefits of immutable data structures, and how to work around their quirks.

Apply object-oriented programming principles to your TypeScript code. Understand the role of classes, constructors, and access modifiers, and how to use inheritance and composition to build complex systems that follow real-world design patterns.

Working with the Compiler
Harness the power of the TypeScript compiler to derive types from values, while furthering your understanding of type inference. Create new kinds of type aliases, and use indexed access types to target nested properties.

Recognize when TypeScript needs your help through type annotations and assertions, and the purpose of as, asserts, and satisfies. Apply these techniques to real-world scenarios like working with DOM APIs, parsing JSON, and creating configuration objects.

Understanding the Environment
Distinguish between TypeScript modules and scripts, and prevent global scope pollution. Provide types for JavaScript files and third-party libraries, and understand the role of ambient declarations.

Safely modify global interfaces like Window through declaration merging, work with namespaces like JSX, and understand when to use .d.ts type definition files vs. modules.

Learn best practices for configuring TypeScript’s behavior based on the type of project you’re working on. Adjust strictness levels, module resolution, and generate type declaration files. Use TypeScript as a linter, and optimize build performance for large projects.

Advanced Application Development
Understand the core differences between CommonJS (CJS) and ES Modules (ESM), and how TypeScript handles module syntax. Learn to use file extensions for guiding module resolution, and configure TypeScript settings for more consistent behavior. Make informed decisions about when to adopt ESM into your projects, and build libraries that support both CJS and ESM consumers for maximum compatibility.

Practice domain modeling by representing real-world concepts and encoding business logic within your types. Establish single sources of truth for type definitions, and create reusable generic type utilities. Enforce stricter type checking with well-placed constraints.

Combine generics and function overloads for maximum flexibility, and create custom type guards and predicates to enhance type inference. Create type-safe APIs with template literal types, mapped types, and custom error types.

Table of Contents

1 TypeScript’s Relationship with JavaScript
2 JavaScript vs. TypeScript in the Build Process
3 Essential Tools for TypeScript Development
4 Set up Node.js and VS Code
5 Installing pnpm for Package Management
6 Installing t
7 Unexpected Token Error in the Browser
8 Browsers Can’t Understand TypeScript Syntax
9 Convert a TypeScript File into a JavaScript File
10 Compile TypeScript to JavaScript with the TypeScript CLI
11 Automating TypeScript Compilation
12 Use tsc’s Watch Mode to Automatically Compile TypeScript Files
13 Compiling TypeScript Files to a Directory
14 Configure the Output Directory for Compiled Files
15 Use Vite for a Frontend App with TypeScript
16 Configure Vite for a Vanilla TypeScript Project
17 Comparing Vite with tsc
18 TypeScript as a Linter
19 TypeScript in a CI-CD System
20 Should TypeScript Block Your Dev Server_
21 Quickly Create Scripts with tsx
22 Understanding Function Errors
23 Fixing Errors in the
24 Annotating Empty Parameters
25 Annotating Function Parameters
26 Basic Types in TypeScript
27 TypeScript Basic Types
28 Optional Function Parameters
29 Optional Function Parameters in TypeScript
30 Default Parameters in JavaScript Functions
31 Add a Default Parameter
32 Typing Object Literals
33 Annotating with {}
34 Making Object Property Types Optional
35 Specifying Optional Properties
36 A Single Source of Truth for Type Definitions
37 Creating
38 Add an Array to an Object
39 Two Syntaxes for Arrays
40 Arrays of Objects in TypeScript
41 Representing an Array of Objects
42 Rest Parameters in TypeScript
43 Using Rest Parameters in TypeScript
44 Tuples for Precise Array Structures in TypeScript
45 Using Tuple Syntax in TypeScript
46 Using Optional Tuple Members in TypeScript
47 Working with Optional Tuple Members in TypeScript
48 The Controversial
49 The Dangers of Using _any_
50 Function Types
51 Function Types for Type Aliases in TypeScript
52 Typing an Event Listener
53 The
54 Restricting
55 Creating Typed Sets
56 Type Checking Maps
57 Adding Types to Maps
58 Debugging JSON Parsing
59 Decoding the JSON.parse Error
60 Typing Fetch API Responses in Async Functions
61 Adding Types to an Async Function
62 Understanding How TypeScript Works in Your IDE
63 Introspecting Variables and Declarations in TypeScript
64 Hovering Over a Function Call
65 Fixing Errors with Hovering
66 Adding Documentation for Hovers
67 TSDoc Comments
68 Manually Triggering Autocomplete
69 The Control + Space Shortcut
70 TypeScript’s Approach to Errors
71 Quick Renaming in VS Code
72 Navigating Code with _Go to Definition_
73 Fast Imports in VS Code
74 Using Autocomplete and Quick Fix to Import Variables
75 Organizing Imports in Large Files
76 The Organize Imports Hotkey in VS Code
77 Quick Fix Refactoring
78 Refactoring with Quick Fixes
79 Automatic Code Formatting with Prettier
80 Restarting the TypeScript Server in VS Code
81 Handling Null Values in TypeScript
82 Introducing Union Types in TypeScript
83 Diving Deeper into Unions and Assignability
84 Restricting Function Parameters
85 Combining Literal & Union Types
86 Literal Type Assignability
87 Combining Union Types in TypeScript
88 Create New Types By Combining Unions
89 How Big Can a Union Be_
90 Resolving Literal Types to Wider Types
91 Narrowing Unions with
92 Conditional Narrowing in TypeScript
93 Different Approaches for Narrowing Inputs
94 Narrowing with Boolean Won’t Work
95 Gotchas When Narrowing a Map in TypeScript
96 Correctly Narrowing a Map in TypeScript
97 Narrowing by Throwing Errors
98 Throwing Errors to Narrow
99 Narrowing with
100 Dynamically Handling Different API Responses in TypeScript
101 Introducing the Unknown Type in TypeScript
102 Dealing with Unknown Errors in TypeScript
103 Narrowing with
104 Narrowing Unknown in a Large Conditional Statement
105 Narrowing Unknown Types in TypeScript
106 Introducing the
107 Solving the Never Type in TypeScript
108 Empty Arrays and the Never Type in TypeScript
109 Narrowing Return Types with TypeScript
110 Returning
111 Narrowing in Different Scopes
112 Narrowing Behavior Across Scopes
113 Handling Separate But Related Types
114 Improving Type Safety with Discriminated Unions in TypeScript
115 Destructuring a Discriminated Union in TypeScript
116 Limitations of Destructuring Discriminated Unions
117 Narrowing a Discriminated Union with a Switch
118 Refactoring to a Switch Statement
119 The switch (true) Pattern in TypeScript
120 Refining Types with Discriminated Unions of Tuples
121 Handle Error and Success States by Narrowing
122 Discriminated Booleans
123 Discriminated Unions with Boolean Discriminators
124 Adding Defaults to a Discriminated Union
125 Handling Optional Parameters in Discriminated Unions
126 Should You Provide Function Return Types_
127 Extending Objects in TypeScript
128 Use the Intersection Operator to Extend an Object Type in TypeScript
129 Extend an Object Using Interfaces in TypeScript
130 Extending Interfaces to Create Hierarchies in TypeScript
131 Extending Incompatible Properties
132 Comparing Intersections and Interface Extends
133 Comparing Intersection and Interface Extends in TypeScript
134 Allow Dynamic Keys in TypeScript Types
135 Dynamic Keys with Index Signatures and Record Types
136 Allow Any String Key while Supporting Default Properties
137 Add an Index Signature to an Interface
138 Supporting Different Types of Keys in TypeScript
139 Using the PropertyKey Type in TypeScript
140 Restricting Object Keys in TypeScript
141 Records and Mapped Types in TypeScript
142 An Issue with Duplicate Interfaces
143 Declaration Merging in TypeScript Interfaces
144 Working with Partial Data from a Type
145 Manage Subtypes with the Pick Utility Type
146 Exclude a Property from an Interface
147 The Omit Utility Type in TypeScript
148 A Quirk of Omit in TypeScript
149 Understanding Distributive Omit and Pick in TypeScript
150 Excluding Fields from a TypeScript Type
151 The Partial Utility Type in TypeScript
152 Making Type Properties Required in TypeScript
153 Specifying a Type with Shared Properties in TypeScript
154 Common Keys of Unions of Objects in TypeScript
155 Fixing a Type Assignment Inference Error
156 Inference differences between let and const
157 Object Property Inference
158 Understanding Object Properties and Assignability in TypeScript
159 Creating Read-only Properties
160 Specifying Read-only Object Properties
161 Using a Type Helper to Create Read-only Properties
162 Use the Readonly Type Helper to Create Read-Only Objects in TypeScript
163 Deeply Apply Read-only Properties to an Object in TypeScript
164 Using as const to Deeply Apply Read-only Properties to an Object in TypeScript
165 Comparing Object.freeze with as const
166 Deeply Apply Read-only Properties with as const
167 Prevent Array Mutation in TypeScript
168 Two Ways to Create Read-Only Arrays in TypeScript
169 Distinguishing Assignability Between Read-Only and Mutable Arrays
170 Fixing Unsafe Tuples
171 Specifying a readonly Tuple
172 Use the ts-reset Library to Improve Readonly Array Handling in TypeScript
173 Improve Type Inference for an Async Function
174 Two Options for Improving Promise Return Types in TypeScript
175 Infer Strings as Their Literal Types in Objects with as const
176 Classes in TypeScript
177 Creating a Class with Default Properties
178 Implement Class Methods in TypeScript
179 Declaring Methods in TypeScript Classes
180 Creating Constructors for Classes in TypeScript
181 Receive Arguments in Class Constructors
182 Getter Methods in TypeScript
183 Adding a Getter to a Class in TypeScript
184 Public and Private Properties in TypeScript
185 Prevent Access to Private Properties in Classes
186 Setter Methods in TypeScript
187 Add a Setter to a TypeScript Class
188 Extending Classes in TypeScript
189 Inheriting Properties from Other Classes in TypeScript
190 Overriding Methods in TypeScript
191 Ensure a Class Adheres to a Contract
192 Implementing Interfaces in TypeScript with Classes
193 Using
194 Annotating
195 Intro to TypeScript-only Features
196 Parameter Properties in TypeScript
197 Working with Enums in TypeScript
198 Create an Enum in TypeScript
199 String Enums in TypeScript
200 Creating a String Enum in TypeScript
201 Const Enums in TypeScript
202 Namespaces in TypeScript
203 Merging Namespaces in TypeScript
204 Declaration Merging with Interfaces Inside of Namespaces
205 When to Prefer ES Features to TS Features
206 Introduction to Deriving Types in TypeScript
207 The keyof Operator
208 Flowing Types with the keyof Operator
209 The typeof Operator
210 Combine keyof and typeof to Derive Types
211 No Creating Runtime Values from Types
212 Deriving Types with Classes
213 Using typeof with Classes in TypeScript
214 Enums as Types and Values in TypeScript
215 The this Keyword in TypeScript
216 Using the Same Name for Values and Types in TypeScript
217 Creating Types from Complex Function Parameters
218 Use the Parameters Type to Extract Function Parameters
219 Extracting Return Types from Functions
220 Using the ReturnType Type Helper
221 Extract the Return Type from an Async Function
222 Unwrap Promises with the Awaited Type Helper
223 Access Specific Values in an as const Object
224 Use an Indexed Access Type to Access a Property
225 Pass a Union to an Indexed Access Type
226 Unions and Indexed Access Types in TypeScript
227 Extract a Union of All Values from an Object
228 Pass keyof into an Indexed Access Type
229 Create a Union from an as const Array
230 Pass a Primitive to an Indexed Access Type
231 Required vs Unnecessary Annotations
232 Simplifying TypeScript Annotations
233 Provide Additional Information to TypeScript
234 The _as_ and _as any_ Keywords in TypeScript
235 Global Typings use any
236 Preventing ‘any’ Type Issues from Global Typings
237 The Limits of as in TypeScript
238 Non-null Assertions
239 Adding a Non-null Assertion
240 The @ts-ignore Directive in TypeScript
241 The @ts-expect-error Directive in TypeScript
242 The @ts-nocheck Directive in TypeScript
243 Improve Type Annotations with the satisfies Operator
244 The satisfies Operator in TypeScript
245 Using satisfies with keyof and typeof in TypeScript
246 Specify Type Constraints with the satisfies Operator
247 Comparing as, satisfies, and Variable Annotations in TypeScript
248 When to Use as, satisfies, and Variable Annotations in TypeScript
249 The satisfies Keyword and Deeply Read-Only Objects in TypeScript
250 Combine as const with satisfies for Read-Only Objects
251 Accept Anything Except Null or Undefined
252 The Empty Object Type
253 Typing a Truly Empty Object
254 Handling a Truly Empty Object in TypeScript
255 Excess Property Warnings in TypeScript
256 Techniques for Triggering Excess Property Warnings in TypeScript
257 Excess Properties in Functions
258 Understanding Unexpected Properties in TypeScript
259 Object.keys and Object.entries in TypeScript
260 Iterating Over Object Keys in TypeScript
261 Techniques for Iterating Over Object Keys
262 Evolving Types using the
263 The Evolving
264 The Evolving
265 Function Parameter Comparisons in TypeScript
266 Understanding TypeScript’s Function Parameter Comparisons
267 Typing Functions with Object Params
268 Typing Arrays of Functions with Object Params
269 Properly Typing an Object of Functions
270 Handling Union of Functions with Incompatible Types in TypeScript
271 Unions of Function Return Types
272 Annotating the Errors Thrown by a Function
273 Techniques for Annotating Errors in TypeScript
274 Understanding Modules and Scripts in TypeScript
275 Enforcing Module Usage in TypeScript
276 Update tsconfig for Modules
277 Declaration Files in TypeScript
278 Declaration Files Can Be Modules or Scripts
279 Using Declaration Files with JavaScript in TypeScript
280 Typing a JavaScript Module
281 Type Variables Declared Elsewhere
282 Ambient Context and the declare Keyword in TypeScript
283 Global Scope Declarations in TypeScript
284 Understanding Global Declarations in TypeScript
285 Configuring the lib Compiler Option
286 Setting a Compiler Target in tsconfig.json
287 DOM Typing Configuration in TypeScript
288 Update tsconfig.json to include DOM typings
289 Update DOM Typing to Include Iterable
290 Configuring TypeScript for DOM Iteration
291 Modifying TypeScript Global Scope
292 Adding Types to the Global Scope
293 Adding Type Definitions for External Libraries
294 Install Type Definitions from DefinitelyTyped
295 Integrating TypeScript with Node
296 Modifying process.env Typing in TypeScript
297 Updating Node.ProcessEnv
298 Types that Ship With Libraries
299 Declaring Module Types in TypeScript
300 The declare module Syntax in TypeScript
301 Importing and Typing Non-Code Files in TypeScript
302 Use Wildcards in TypeScript Module Declarations
303 TSConfig Options and Declaration Files
304 Understanding skipLibCheck in TypeScript
305 Should You Use Declaration Files to Store Your Types_
306 Recommended Base Configuration
307 Understanding Isolated Modules in TypeScript
308 Index Access Settings
309 Making Code Safer with No Unchecked Indexed Access
310 Using TypeScript as a Linter
311 The noEmit Option in tsconfig.json
312 Module NodeNext with Extensions
313 The moduleResolution Option in tsconfig.json
314 Enforcing Import Syntax
315 The Verbatim Module Syntax in TSConfig
316 Verbatim Module Syntax Enforces Import Type
317 Understanding lib and target in TypeScript Configuration
318 Bundle Your Code for Library Use
319 Emitting TypeScript Declaration Files
320 Navigate to Source Files Instead of Declaration Files
321 Utilizing Declaration Maps in TypeScript
322 Configure JSX Support in TypeScript
323 Update tsconfig.json to Support JSX
324 Multiple TypeScript Configurations
325 Managing Multiple tsconfig Files
326 Globals are Tied to a Single Configuration
327 Share Configuration Across Multiple tsconfig Files
328 Extending a Base TypeScript Configuration
329 TypeScript Project References
330 Organizing TypeScript Configurations with Project References
331 Designing Your Types
332 Introduction to Generic Types
333 Implement a Generic Type
334 Generics with Multiple Type Parameters
335 Add Multiple Type Arguments to a Generic Type
336 Handle Errors with a Generic Result Type
337 Default Type Parameters in Generics
338 Specify a Default Type Parameter
339 Add Constraints to a Type Parameter
340 Constraining Type Parameters
341 Build a Stricter Omit Type
342 Constrain Keys in a StrictOmit Type Helper
343 Template Literal Types in TypeScript
344 Constrain Strings to Match a Pattern with Template Literal Types
345 Represent All Possible Type Combinations with Template Literals
346 Passing Unions to Template Literal Types
347 Derive Types with Mapped Types
348 Use a Mapped Type to Create a New Object Shape
349 Remapping Keys in TypeScript Map Types
350 Combine the
351 Introduction to the Utilities Folder
352 Generic Functions Without Inference
353 Make a Function Generic
354 Default Parameter Types for Generic Functions
355 Setting a Default Parameter Type for Generic Functions
356 Inference in Generic Functions
357 Enable Generic Functions to Better Infer Types
358 Type Parameter Constraints with Generic Functions
359 Add Constraints to Generic Functions with the extends Keyword
360 Combining Generic Types with Generic Functions
361 Refactoring for Generic Types and Functions
362 Multiple Type Arguments in Generic Functions
363 Type Inference in Function Parameters
364 Using Type Predicates to Create Reusable Type Guards
365 Annotate a Return Type with a Type Predicate
366 Understanding Assertion Functions in TypeScript
367 Asserting Types with Type Predicates
368 Adapt a Function to Handle Different Types of Arguments
369 Implement Function Overloads

Homepage