explaingit

gibbok/typescript-book

10,297JavaScriptAudience · developerComplexity · 1/5Setup · easy

TLDR

A free, open-source written guide to TypeScript covering everything from the basics through advanced type system features, available as a README, EPUB download, and website, with community translations in four languages.

Mindmap

mindmap
  root((TypeScript Book))
    Core concepts
      Type inference
      Type narrowing
      Union and intersection
    Advanced types
      Mapped types
      Conditional types
      Template literals
    Language features
      Interfaces and aliases
      Generics
      Decorators
      Enums
    Practical guides
      Project setup
      JS migration
      Declaration files
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Learn TypeScript from scratch with a single structured guide that builds from basics to advanced topics.

USE CASE 2

Look up a specific TypeScript feature like mapped types or conditional types as a reference while building a project.

USE CASE 3

Understand how to migrate an existing JavaScript project to TypeScript step by step.

USE CASE 4

Use the table of contents as a study path to fill gaps in TypeScript knowledge.

Tech stack

TypeScriptJavaScript

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

The Concise TypeScript Book is a free, open-source written guide that covers the TypeScript programming language from introduction through advanced topics. The entire book lives in this repository as a single README file, and is also available as a downloadable EPUB and as a website. Community members have translated it into Chinese, Italian, Portuguese, and Swedish. TypeScript is a language built on top of JavaScript that adds a type system: a way for developers to declare what kind of data a variable holds, and have the tooling check that those declarations are respected before the code runs. This book explains how that type system works, why it exists, and how to use it effectively. Coverage spans the full language. Early chapters explain what TypeScript is, how it relates to JavaScript, and how to configure a TypeScript project. The bulk of the book works through the type system in depth: primitive types, type inference, type narrowing, union and intersection types, mapped types, conditional types, template literal types, and the special types any, unknown, void, and never. There are also chapters on interfaces and type aliases, enums, classes with access modifiers, generics, decorators, modules, and utility types. Later sections address practical topics such as migrating an existing JavaScript project to TypeScript, working with declaration files, and handling common interop patterns with JavaScript libraries. The table of contents is extensive, making it useful as both a learning path for beginners and a reference for developers who already know the basics but need to look up a specific feature. The project is open to contributions and the author accepts optional donations. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Using the TypeScript Book's explanation of type narrowing, show me how to write a function that safely handles a value that could be either a string or a number.
Prompt 2
Based on the TypeScript Book's chapter on generics, write a generic function that accepts an array of any type and returns the first element with correct type inference.
Prompt 3
I'm migrating a JavaScript file to TypeScript. Walk me through adding types to a function that fetches user data from an API, following the patterns described in the TypeScript Book.
Prompt 4
Explain conditional types and mapped types with a concrete example I can use in a React component, using the TypeScript Book as the reference.
Open on GitHub → Explain another repo

← gibbok on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.