Table of Contents
IntroductionMike North introduces the course by discussing goals of this course, prerequisites, and a brief workshop setup. A brief overview of other TypeScript courses on Frontend Masters and their relation to this course is also provided in this segment.
Declaration MergingMike discusses stacking types and values on an identifier, how to understand what is attached to an identifier, and what a namespace is. A walk through of applying type and value tests to a class and how classes relate to declaration merging is also provided in this segment.
Type QueriesMike discusses how to obtain a type from a value with the type queries keyof and typeof. The query keyof obtains the type representing all property keys on a given interface while typeof extracts a type from a value. An example for each of these type queries provided in this segment.
Conditional Types PracticeMike provides a short exercise to practice with the extends keyword by determining whether a conditional type will evaluate to true or false. A walk through of each example and a student question regarding the modern set theory limitations are also covered in this segment.
Extract & ExcludeMike discusses the built-in utility types Extract and Exclude, walks through an example of each utility type, and describes how each utility type works. Exclude is the opposite of Extract, in that it’s useful for obtaining the part of a type that’s not assignable to some other type.
Type Q&AMike answers student questions regarding if generics are more appropriately used in libraries compared to applications, if there is a standard for representing types in generics, and if Extract is an equivalent to the and operator.
Inference with Conditional TypesMike discusses using inference with conditional types to access sub-parts of type information within a larger type and walks through an example of using infer. The infer keyword can only be used within the condition expression of a conditional type.
Inference Q&AMike answers a student's question regarding if the TypeScript team plans on making the type ConstuctorArg a standard type and discusses the benefits of creating package libraries of useful custom types.
Indexed Access TypesMike discusses indexed access types which provide a mechanism for retrieving parts of an array or object type via indices, how they work, and provides a few use case examples. How to access a more specific type from an array or object is also covered in this segment.
Mapped TypesMike discusses where mapped types name originates, the basics of mapped type, mapped type compared to index signature, and demonstrates the built in utility type Record. Mapped allow types to be defined in other types through a much more flexible version of an index signature.
Advanced Mapped TypesMike discusses using mapped types with indexed access types, demonstrates generalizing using type params, and allowing the type to work on anything and not just Window. A student's question regarding if mapped types extend from dictionary is also covered in this segment.
Pick & Mapping ModifiersMike demonstrates using the built in utility type Pick and applying and removing modifiers with - and ?. A brief overview of modifying the built in utilities Partial, Required, and Readonly are also covered in this segment.
Template Literal Types & Key MappingMike discusses using the ECMAScript template literal syntax to create a template literal type, briefly discusses special types: UpperCase, LowerCase, Capitalize, and Uncapitalize, and walks through an example of key mapping to manipulate the keys as they are being mapped over. A brief demonstration of a package made using key mapping is also provided in this segment.
Filtering Out PropertiesMike demonstrates how to filter properties out using Extract and a template literal type, filtering based on the value, a flawed approach to filtering, and walks through a more refined example to filter values by filtering the keys first. An in depth walk through of filtering values based on keys and conditions is also provided in this segment.
Typing a Data LayerMike provides a practical exercise of properly typing a data layer with TypeScript to combine the topics discussed in this course and provides a walk through of the exercise.