WANT SWEET DEALS? JOIN OUR MAILING LIST
Total Typescript

Total TypeScript

The Essentials
by Matt Pocock with Taylor Bell
April 2026, 432 pp.
ISBN-13: 
9781718504165

Download Chapter 4: Essential Types and Annotations

“An invaluable resource to countless developers.”
—Ryan Cavanaugh, Development Lead Microsoft TypeScript Team

TypeScript makes JavaScript safer and your editor smarter. Matt Pocock’s Total TypeScript courses have trained thousands of developers by putting the editor first: You learn types by watching what TypeScript tells you, not by memorizing rules. This book brings that method to print.

You’ll start by setting up a proper TypeScript environment, then immediately begin writing and annotating code. Each chapter builds on the last—primitive types to unions, objects to classes, basic generics to type transformations—with exercises woven throughout as checkpoints, not afterthoughts.

Later chapters tackle what takes longer to learn: deriving types from other types, writing type predicates and assertion functions, configuring the compiler for real projects, and building type architectures that don’t collapse under their own weight.

You’ll learn to:

  • Read TypeScript’s error messages and use your editor as a teaching tool
  • Write precise types for objects, functions, and classes
  • Use unions, narrowing, and generics to make types flexible without losing safety
  • Derive and transform types so you don’t repeat yourself
  • Configure tsconfig.json for React, Node, or library development

This is a workshop in print. The one Matt Pocock has been refining for years.

Author Bio 

Matt Pocock is a TypeScript educator and developer who has worked with Vercel and Stately.ai. He created TotalTypeScript.com, an online learning platform that has taught thousands of developers to master TypeScript.

Taylor Bell is a writer, developer, and researcher with a background in Communication Theory and Computer Science from Boise State University.

Table of contents 

Foreword
Introduction

PART I: Getting Started 
Chapter 1: Kickstart Your TypeScript Setup
Chapter 2: IDE Superpowers
Chapter 3: TypeScript in the Development Pipeline

PART II: Fundamentals
Chapter 4: Essential Types and Annotations
Chapter 5: Unions, Literals, and Narrowing

PART III: Objects, Classes, and Mutability
Chapter 6: Objects
Chapter 7: Mutability
Chapter 8: Classes
Chapter 9: TypeScript-Only Features

PART IV: Working with the Compiler
Chapter 10: Deriving Types
Chapter 11: Annotations and Assertions
Chapter 12: The Weird Parts

PART V: Understanding the Environment
Chapter 13: Modules, Scripts, and Declaration Files
Chapter 14: Configuring TypeScript

Part VI: Advanced Application Development
Chapter 15: Designing Your Types in TypeScript
Chapter 16: The /utils Folder

View the Copyright page
View the detailed Table of Contents
View the Index