5 Best TypeScript Books for Beginners in 2023
TypeScript is perhaps one of the trickiest languages to pick up and learn because TypeScript lives co-dependently with other frameworks and concepts. To learn TypeScript is to learn theory and practical application at the same time.
So how do you begin?
Getting Started With TypeScript
There are not very many books on TypeScript for a couple of reasons:
The language is relatively young, which means that it’s turbulent and changes often, which makes writing a book on the topic difficult.
Learning TypeScript with a book is a journey, and this article aims to make your journey a little bit easier by recommending three solid TypeScript books.
If you understand the relationship between CSS and Sass, for example, you have a sense of what this means.
What makes the Best TypeScript Books?
Teaching TypeScript can go in infinite directions. For a great TypeScript book to teach effectively, it must be opinionated.
The best TypeScript books for beginners are opinionated in order to make the best use of TypeScript’s features.
This can be tricky to maneuver, which is why an opinionated book on not just the functionality, but using TypeScript well, is vital to your success as a TypeScript web developer.
For this article, I prioritized books that truly look out to building your skills as a developer — and not just giving you glossary definitions.
A TypeScript book would be best paired with the classic industry book, The Pragmatic Programmer. You want a TypeScript book that is opinionated, but you must also be equipped to think for yourself. The Pragmatic Programmer is one of the best TypeScript books to cultivate that skill.
Best TypeScript Books
See below for the top 5 best TypeScript books for beginners.
Book 1: TypeScript Quickly
— TypeScript Quickly
TypeScript Quickly by Yakov Fain and Anton Moiseev is a February 2020 Manning publication that is one of the most well-organized, clear, and practical books I have seen on TypeScript. Every chapter is clear and concise, and you know where you are going every step of the way.
A challenge of teaching TypeScript is that TypeScript often doesn’t function alone. The language is often paired with another frontend framework like React or Angular. Like with other books, TypeScript Quickly decides to be opinionated by diving into frameworks as well.
As far as organization goes, TypeScript Quickly is one of the best. Its structure is clean and you know exactly what you are getting into every step of the way.
TypeScript Quickly includes the following sections:
Part 1: Mastering the TypeScript syntax, which includes:
Chapter 2: Basic and custom types, which includes declaring variables with types and using types in function declarations, declaring type aliases with the type keyword, and declaring custom types with classes and interfaces.
Chapter 3: Object-oriented programming with classes and interfaces, which includes how class inheritance works, why and when to use abstract classes, how interfaces can force a class to have methods with known signatures without worry about implementation details, and what programming to interfaces means.
Chapter 4: Using enums and generics, which includes the benefits of using enums, the syntax for numeric and string enums, what generic types are for, and how to write classes, interfaces, and functions that support generics.
Chapter 5: Decorators and advanced types, which includes what the TypeScript decorators are for, how to create a new type based on an existing one using mapped types, how conditional types work, and combining mapped and conditional types.
Chapter 6: Tooling, which includes debugging TypeScript code with the help of source maps, the role of linters, compiling and bundling TypeScript apps with Webpack, compiling TypeScript apps with Babel, and how to compile TypeScript with Babel and bundle it with Webpack.
Part 2: Applying TypeScript in a blockchain app, which includes:
Chapter 8: Developing your own blockchain app, which includes the principles of blockchain apps, what the hashing functions are for, what block mining is, and developing a simple blockchain-based app.
Chapter 9: Developing a browser-based blockchain node, which includes creating a web client for a blockchain, creating a small library for hash generation, running the blockchain web app, and debugging TypeScript in the browser.
Chapter 10: Client-server communications using Node.js, TypeScript, and WebSockets, which includes why a blockchain may need a server, the longest chain rule, how to create a Node.js WebSocket server in TypeScript, and practical uses of TypeScript interfaces, abstract classes, access qualifiers, enums, and generics.
Chapter 11: Developing Angular apps with TypeScript, which includes a quick intro to the Angular framework, how to generate, build, and serve a web app written in Angular and TypeScript, and how Angular implements dependency injection.
Chapter 12: Developing the blockchain client in Angular, which includes reviewing the code of the blockchain web client in Angular and how to run an Angular client that communicates with a WebSocket server.
Chapter 13: Developing React.js apps with TypeScript, which includes a quick intro to the React.js library, how React components use props and state, and how React components communicate with each other.
Chapter 14: Developing a blockchain client in React.js, which includes reviewing a blockchain web client written with React.js, how the React.js web client communicates with the WebSocket server, running a React app that works with two servers in dev mode, and splitting the UI of a blockchain client into components and arranging their communications.
Chapter 15: Developing Vue.js apps with TypeScript, which includes a quick introduction to the Vue.js framework, how to jumpstart a new project with Vue CLI, how to work with class-based components, and how to arrange client-side navigation using the Vue Router.
Chapter 16: Developing the blockchain client in Vue.js, which includes reviewing the Vue.js version of the blockchain web client, running a Vue app that works with two servers in dev move, the flow of data, from entering a transaction to generating a block, and arranging communications between the blockchain’s client components.
Book 2: Effective TypeScript: 62 Specific Ways to Improve Your TypeScript
TypeScript has evolved rapidly over the past few years, but my hope is that it has stabilized enough that the content in this book will remain valid for years to come. This book focuses primarily on the language itself, rather than any frameworks or build tools.
You won’t find any examples of how to use React or Angular with TypeScript, or how to configure TypeScript to work with webpack, Babel, or Rollup. The advice in this book should be relevant to all TypeScript users.
— Effective TypeScript
Effective TypeScript: 62 Specific Ways to Improve Your TypeScript by Dan Vanderkam is a 2020 O’Reilly publication designed specifically to improve your skills as a TypeScript developer.
The beauty of this book is in how opinionated it is, creating rules and preferences to follow all throughout the book. Yet, unlike the other books on this list, it remains isolated from other tools like React or Angular. This book is unique in that it self-purports to be your “second book on TypeScript,” but this book is on the list because of its great quality and value to all learners of TypeScript.
This TypeScript book can be paired with another TypeScript book on this list because the value of this book is unique.
This book is actionable, easy to apply, and helps you become a better TypeScript developer right away.
Effective Typescript includes the following sections:
Chapter 2: TypeScript’s Type System, which includes using your editor to interrogate the type system, thinking of types as sets of values, knowing how to tell the type of a symbol, preferring type declarations to type assertions, avoiding object wrapper types, recognizing the limits of excess property checking, applying types to entire function expressions, knowing the difference between type and inheritance, and more.
Chapter 3: Type Interference, which includes avoiding cluttering your code with inferable types, using different variables for different types, understanding type widening, understanding type narrowing, creating objects all at once, being consistent with aliases, using async functions instead of callbacks for asynchronous code, and more.
Chapter 4: Type Design, which includes preferring types that always represent valid states, avoiding repeating type information in documentation, pushing null values to the perimeter of your types, and more.
Chapter 5: Working with any, which includes using the narrowest possible scope for any type, preferring more precise variants of any to plain any, hiding unsafe type assertions, and more.
Chapter 6: Types Declarations and @types, which includes putting TypeScript and @types in devDependencies, understanding the three versions involved in type declarations, exporting all types that appear in public APIs, and more.
Chapter 7: Writing and Running Your Code, which includes preferring ECMAScript features to TypeScript features, knowing how to iterate over objects, understanding the DOM hierarchy, and more.
This book has two aims: to give you the deep understanding of how the TypeScript language works (theory) and provide bucketfuls of pragmatic advice about how to write production TypeScript code (practice).
Because TypeScript is such a practical language, theory quickly turns to practice, and most of this books ends up being a mix of the two[.]
— Programming TypeScript
Programming TypeScript includes the following sections:
Chapter 1: Introduction, which includes a brief description of why you may want to learn TypeScript and unpacks the value of TypeScript type safety.
Chapter 3: All About Types, which includes “The ABCs of Types,” listing types order from any to void.
Chapter 4: Functions, which includes information about declaring and invoking functions, polymorphism as it relates to functions, type-driven development, and more.
Chapter 5: Classes and Interfaces, which includes information about classes and inheritance, super, using this as a return type, interfaces, polymorphism as it relates to classes, mixins, and more.
Chapter 6: Advanced Types, which includes information about relationships between types (including subtypes and supertypes), totality, advanced object types, conditional types, and “escape hatches” such as type assertion, non-null assertions, and more.
Chapter 7: Handling Errors, which includes information about returning null, throwing exceptions, returning exceptions, the option type, and more.
Chapter 9: Frontend and Backend Frameworks, which includes frontend frameworks like React and Angular as well as type safety to your APIs with tools like Swagger, gRPC, and GraphQL. This section also talks about using TypeORM for safe interaction with your database.
Chapter 12: Building and Running TypeScript, which includes information about building your typescript project with layout, artifacts, source maps, error monitoring, and more. This section also talks about running TypeScript on the server or in the browser as well as publishing to NPM.
Chapter 13: Conclusion
Book 4: Essential Typescript 4: From Beginner to Pro
You will then become more familiar with TypeScript for front-end and back-end development, customizing TypeScript, and testing TypeScript code.
— Essential Typescript 4
Freeman provides real-world examples of how TypeScript can be used, including development with the DOM API and popular frameworks like Angular and React. He starts with the basics and moves up to more advanced features. Readers will find that each topic is covered in its entirety while being clear and concise.
With this book, you can gain a better understanding of TypeScript language and tools, use it for client and server-side development, extend and customize it, test your code, and then apply it.
Essential TypeScript 4 includes the following sections:
Introduction: Getting Started with TypeScript
Chapter One: Your First TypeScript Application, which includes installation, initializing the project, using a third-party package, adding commands, and persistently storing data
Chapter Two: Understanding TypeScript, which includes information on how TypeScript should be used, what you need to know, finding errors, and also offers examples.
Chapter Five: Using the TypeScript Compiler, which includes information regarding project structure and how to use the node package manager. You will also learn to compile TypeScript code and use the version targeting feature.
Chapter Six: Testing and Debugging TypeScript, which includes debugging TypeScript code, using the TypeScript Linter, and testing.
Chapter Seven: Understanding Static Types, which includes creating and using static types, and using type unions, type assertions, and type guards.
Chapter Eight: Using Functions, which includes redefining functions, understanding function parameters, function results, overloading function types, and assert functions.
Chapter Nine: Using Arrays, Tuples, and Enums, which includes working with these and how to use each type.
Chapter Ten: Working with Objects, which includes information on how you can use type aliases for shape types, how to deal with excess properties, and how to use type intersections.
Chapter Eleven: Working with Classes and Interfaces, which includes using constructor functions, classes, interfaces, and dynamically creating properties.
Chapter Twelve: Using Generic Types, which includes how to create generic classes and define generic interfaces.
Chapter Thirteen: Advanced Generic Types, which includes more detailed information regarding generic collections and iterators, index types, type mapping, and conditional types.
Chapter Fifteen: Creating a Standalone Web App, Part One, which includes how to create the toolchain, add a bundler, render HTML content using the DOM API, using JSX to create HTML content, and how to add features to the application.
Chapter Sixteen: Creating a Standalone Web App, Part Two, which includes information on how to add web services, use decorators, and complete the application.
Chapter Seventeen: Creating an Angular App, Part One, which covers how to configure web service, how to create the data model, and how to display a filtered list of products.
Chapter Eighteen: Creating an Angular App, Part Two, which includes information on completing the application features and deploying the app.
Chapter Nineteen: Creating a React App, Part One, this shows you how to define entity types and create the data store.
Chapter Twenty: Creating a React App, Part Two, teaches configuring example application features, how to deploy the application, and containerizing the app.
Chapter Twenty One: Creating a Vue.js App, Part One teaches TypeScript in Vue.js development, how to create entity classes, and how to add support for the web service.
Chapter Twenty Two: Creating a Vue.js App, Part Two covers how to complete, deploy, and containerize the application.
Book 5: Mastering Typescript, 4th Edition
It is a TypeScript deep dive into the basics and gives you detailed information and practical examples as you work your way up to more advanced topics and features.
— Mastering Typescript
Mastering TypeScript by Nathan Rozentals helps you understand serverless techniques, micro frontend development, and the best practices so you can create high quality apps.
Mastering TypeScript includes the following sections:
Up and Running Quickly
Exploring the Type System
Interfaces, Classes, Inheritance, and Modules
Generics and Advanced Type Inference
Asynchronous Language Features
Strict Compiler Options
Using Observables to Trasform Data
Node and Express
An AWS Serverless API
More Ways to Learn TypeScript
TypeScript is a challenging programming language to learn because it is not TypeScript alone that you are learning.
With any challenge, it’s best to have multiple forms of input so that you are retaining as much as possible. That’s why I recommend pairing a book with an inexpensive (or sometimes free) online course.
Courses You Can Take to Learn TypeScript
Understanding TypeScript - 2021 Edition has over 1,000 five-star reviews and over 15 hours of video content, detailing everything you need to understand and work with TypeScript
React and Typescript: Build a Portfolio Project is a brand new tutorial to help you build an impressive portfolio piece to get you the job.
Learn TypeScript is a free step-by-step tutorial that teaches how to apply TypeScript syntax to the language you already know. This course is quick and a great help for getting started.
Build a simple company expense tracker with Typescript is a guided exercise to get you coded and familiar with TypeScript.