1 / 11
A complete, practical guide to TypeScript: from your first type annotation to type-safe Node.js APIs, React front ends, testing, and production deployments. 28 chapters, 4 appendices, 520 pages (PDF).
The Complete Practical Guide
Read before you buy: the PDF here is a free sample — the first 20 pages of the 520-page book (payments, sales and reviews on this demo site are sample data). Get the full e-book at thenexbooks on Gumroad.
Learn TypeScript the way production teams use it — from zero to a shipped, type-safe system.
Getting started with TypeScript is easy. Using it well on a real codebase is not. You need to understand how the type checker reasons, when to trust inference, how to model a domain so invalid states cannot exist, how to validate data from the outside world, how to tame tsconfig and the module system, and how to keep a large project fast. Then you still have to ship: an API, a front end, background jobs, tests, CI, and a deployment you can observe.
This book takes you through the whole journey. No prior TypeScript required — just basic JavaScript.
What's inside
- How the compiler thinks: structural typing, inference, narrowing, and type erasure
- The type system in depth: unions, discriminated unions, generics, keyof, mapped and conditional types, infer, template literal types, branded types, satisfies, and as const
- tsconfig with confidence: strictness flags, targets, nodenext vs bundler module resolution, ESM vs CommonJS, and declaration files
- Error handling with Result types and runtime validation with Zod
- Async TypeScript: promises, concurrency, async iterators, AbortController, and using declarations
- Tooling: ESLint with typescript-eslint, Prettier, bundlers, and pnpm monorepos
- A type-safe Node.js API with Fastify, typed SQL with Kysely (compared with Prisma and Drizzle), authentication, and authorization
- End-to-end type safety with shared packages, OpenAPI, and tRPC; background jobs and signed webhooks
- React with TypeScript, typed data fetching with TanStack Query, and forms with shared schemas
- Testing with Vitest, including type tests; scaling type-checking with project references
- Migrating JavaScript incrementally, publishing libraries, and deploying with Docker, CI/CD, and observability
One running example, start to finish. You build PawPath, a fictional veterinary clinic platform: appointment state machines, branded IDs, money in integer cents, payment webhooks, and one data model shared by the server, the browser, and a worker.
Practical and honest. Every chapter includes realistic code, Tips, Notes, and Warnings, and ends with Key Takeaways. No invented benchmarks; version-specific features are labeled.
Format: PDF, 520 pages (A4), linked table of contents and bookmarks. English. First Edition, 2026. Published by thenexbooks.
Table of Contents
Part I — Foundations
- Ch 1 · Why TypeScript: The Big Picture and How the Compiler Thinks
- Ch 2 · Setting Up: Node.js, the TypeScript Compiler, tsconfig, and Your Editor
- Ch 3 · Basic Types, Type Inference, and Annotations
- Ch 4 · Functions, Objects, Interfaces, and Type Aliases
- Ch 5 · Unions, Literal Types, Narrowing, and Discriminated Unions
Part II — The Type System in Depth
- Ch 6 · Classes, Access Modifiers, and Object-Oriented Patterns
- Ch 7 · Generics from First Principles
- Ch 8 · Type Operators: keyof, typeof, Indexed Access, and Mapped Types
- Ch 9 · Conditional Types, infer, and Template Literal Types
- Ch 10 · Utility Types and Type-Level Design: Branded Types, satisfies, and as const
Part III — Engineering with TypeScript
- Ch 11 · Mastering tsconfig: Strictness Flags, Targets, and Module Resolution
- Ch 12 · Modules, ESM and CommonJS, and Declaration Files
- Ch 13 · Error Handling, Result Types, and Runtime Validation with Zod
- Ch 14 · Asynchronous TypeScript: Promises, async/await, Iterators, and Cancellation
- Ch 15 · Tooling: ESLint, Prettier, Bundlers, and pnpm Monorepos
Part IV — TypeScript on the Server
- Ch 16 · Building a Type-Safe HTTP API with Node.js and Fastify
- Ch 17 · Typed Data Access: SQL, Kysely, Prisma, Drizzle, and Migrations
- Ch 18 · Authentication, Authorization, and Secure Input Handling
- Ch 19 · End-to-End Type Safety: Shared Packages, OpenAPI, and tRPC
- Ch 20 · Background Jobs, Events, Webhooks, and Integrations
Part V — Front End, Testing, and Scale
- Ch 21 · TypeScript with React: Components, Props, Hooks, and Events
- Ch 22 · Typed Data Fetching, State Management, and Forms
- Ch 23 · Testing TypeScript: Vitest, Mocks, Type Tests, and Integration Tests
- Ch 24 · Performance at Scale: Type-Checking Speed, Project References, and Large Codebases
Part VI — Shipping to Production
- Ch 25 · Migrating a JavaScript Codebase to TypeScript Incrementally
- Ch 26 · Building and Publishing TypeScript Libraries
- Ch 27 · Deployment: Docker, CI/CD, Configuration, and Observability
- Ch 28 · Case Study: Taking PawPath to Production
Appendices
A · TypeScript Cheat Sheet
B · Templates and tsconfig Reference
C · Production Checklist
D · Glossary
Book details
| Detail | |
|---|---|
| Pages | 520 |
| Format | PDF (A4) |
| Language | English |
| Level | Beginner to Advanced |
| Edition | 1st Edition (2026) |
| Download on this site | Free sample, first 20 pages (PDF) |
| Publisher | thenexbooks |
Files you get
No reviews yet. Only buyers can review.
More from thenexbooks