TypeScript Roadmap

This TypeScript Roadmap is a free, full-text syllabus of 93 lessons in 15 stages, starting with Introduction to TypeScript and ending with Ecosystem. It suits anyone who wants to learn TypeScript, whether new to it or filling gaps. There is no fixed length: every lesson is open from the start, so you go at your own pace and skip what you already know.

Last updated

Getting Started0%
Halfway
Almost There
Complete

Reading is open to everyone. Sign in to join this roadmap and track what you finish.

Continue learning

1. Introduction to TypeScriptIntroduction to TypeScript

0%

Introduction to TypeScript

10 topics · 6 sub-topics · 0 completed

0%

The last 3 topics are drawn beside this stage on the original roadmap. Which stage they belong to is not recorded, so they are listed here rather than filed under one.

Full syllabus: every lesson in the TypeScript roadmap

15 stages and 93 lessons, in the order the roadmap suggests. Every lesson is free to read and open from the start.

  1. Stage 1: Introduction to TypeScript

    • Introduction to TypeScript

      TypeScript is a programming language that builds on JavaScript by adding static types. It essentially acts as a superset of JavaScript, meaning that all valid JavaScript code is also valid TypeScript code. The key addition of static typing allows developers to define the expected data types of variables, function…

    • TypeScript vs JavaScript

      TypeScript and JavaScript are both programming languages used for web development. JavaScript is a dynamic language that is interpreted at runtime by the browser, meaning that type errors are only caught when the code is executed. TypeScript, on the other hand, is a superset of JavaScript that adds optional static…

    • TS and JS Interoperability

      TypeScript and JavaScript interoperability refers to the ability of TypeScript code to work seamlessly with existing JavaScript code and vice versa. This means you can use JavaScript libraries in your TypeScript projects and gradually migrate JavaScript code to TypeScript without rewriting everything at once. It…

    • Installation and Configuration

      The installation process of TypeScript generally includes installing the TypeScript compiler, which translates TypeScript code into JavaScript, and configuring your project with a tsconfig.json file to manage compiler options and project settings. This setup enables you to write, compile, and run TypeScript code…

    • tsconfig.json

      tsconfig.json is a configuration file that specifies how the TypeScript compiler should transpile your TypeScript code into JavaScript. It controls various compilation options such as target ECMAScript version, module system, and source maps. This file lives at the root of a TypeScript project and allows you to…

    • Compiler Options

      Compiler options in TypeScript provide fine-grained control over how the TypeScript compiler (tsc) transforms .ts files into JavaScript. These options are typically configured within a tsconfig.json file or passed directly via the command line. They dictate aspects like target ECMAScript version, module system,…

    • Running TypeScript

      Running TypeScript involves converting your .ts files into JavaScript files that can be executed by a JavaScript runtime environment, such as a web browser or Node.js. This conversion, known as compilation or transpilation, is performed by the TypeScript compiler (tsc). After compilation, the resulting JavaScript…

    • TS Playground

      The TS Playground is an online, interactive environment that allows you to write, compile, and share TypeScript code directly in your web browser. It provides immediate feedback on your code, showing compilation errors and the resulting JavaScript output in real-time. This makes it a convenient tool for…

    • tsc

      tsc is the command-line compiler for TypeScript. It takes TypeScript code as input and transforms it into JavaScript code that can be executed by browsers or other JavaScript runtimes like Node.js. You use tsc to check for type errors, enforce coding standards, and ultimately prepare your TypeScript code for…

    • ts-node

      ts-node is a package that lets you directly run TypeScript code without needing to pre-compile it into JavaScript. It does this by providing a TypeScript execution environment for Node.js, allowing you to execute .ts files directly from the command line or by using it as a Node.js module. Essentially, it combines…

  2. Stage 2: Type Inference

    • Type Inference

      Type inference is the automatic deduction of the data type of an expression in a programming language. Instead of explicitly declaring the type of a variable, the compiler or interpreter can infer it based on the value assigned to it or how it's used within the code. This reduces the need for verbose type…

  3. Stage 3: TypeScript Types

    • TypeScript Types

      TypeScript Types define the kind of values a variable can hold. They essentially act as labels that specify the allowed data types, like numbers, strings, or more complex objects. By assigning types, TypeScript can perform static type checking, catching potential errors during development before the code is even…

  4. Stage 4: Type Compatibility

    • Type Compatibility

      TypeScript uses structural typing to determine type compatibility. This means that two types are considered compatible if they have the same structure, regardless of their names.

    • boolean

      A boolean type represents a logical value that can be either true or false. It is commonly used in programming to control the flow of execution based on certain conditions, allowing programs to make decisions and execute different code blocks depending on whether a condition is met. Boolean values are fundamental…

    • Interface

      An interface in TypeScript is a way to define a contract for the shape of an object. It names a set of properties and their types that an object must have. Think of it as a blueprint that specifies the properties (and optionally, methods) that an object should possess, allowing you to ensure that different parts of…

    • number

      The number type in TypeScript represents numeric values. This includes integers (whole numbers like 1, 42, -10) and floating-point numbers (numbers with decimal points like 3.14, -0.5). TypeScript uses double-precision 64-bit floating point format (IEEE 754) to represent all numbers.

    • Class

      A class is a blueprint for creating objects (instances) that share similar characteristics. It defines the properties (data) and methods (functions) that the objects will possess. Classes allow you to create reusable code structures by defining a template that you can then use to instantiate multiple objects with…

    • string

      A string represents a sequence of characters. It's used to store and manipulate textual data, like words, sentences, or any sequence of symbols. Strings are typically enclosed in single quotes ('...'), double quotes ("..."), or backticks ( ... ).

    • Enum

      An "enum" (short for enumeration) is a way to define a set of named constants. It provides a way to give more friendly names to sets of numeric values, making code more readable and maintainable. Enums allow you to define a type by enumerating its possible values, which can represent options, states, or any other…

    • void

      The void type in TypeScript represents the absence of a value. It is commonly used as the return type of functions that do not return any value, essentially indicating that the function performs an action but doesn't produce a result. A function declared with a void return type is not expected to return any data…

    • Array

      An array is a data structure that stores an ordered collection of elements, where each element is accessed using its numerical index. Arrays are fundamental for managing lists of items, and in TypeScript, you define the types of elements that an array can hold, enforcing consistency and preventing errors. An…

    • undefined

      JavaScript has two primitive values used to signal absent or uninitialized value: null (absent) and undefined (uninitialized).

    • Tuple

      A tuple is a typed array with a pre-defined length and types for each index. Each position in the tuple can have its own specific type, allowing you to create arrays with a known structure where the type of element is known at each index. Tuples ensure that the number of elements matches the defined length and that…

    • null

      The null type represents the intentional absence of a value. It's a primitive data type that has only one possible value: null. It signifies that a variable or property has no value assigned to it, or that a value has been explicitly removed.

    • Object

      In TypeScript, an object type defines the structure of a JavaScript object. It specifies the names, types, and optionality of the properties an object should have. You can define object types using curly braces {} and listing the properties with their corresponding types, separated by semicolons or commas. This…

  5. Stage 5: Combining Types

    • Combining Types

      Combining types in TypeScript allows you to create new, more complex types from existing ones. This is achieved through features like unions and intersections. A union type lets a variable hold values of different types, while an intersection type combines multiple types into a single type that has all the…

    • as [type]

      Type assertions in TypeScript are a way to tell the compiler the specific type of a variable. They allow you to override TypeScript's type inference when you know more about the type of a value than the compiler does. Using as [type] is one syntax for type assertions, allowing you to explicitly cast a variable to a…

    • as any

      any is a special type in TypeScript that represents a value of any type. When a value is declared with the any type, the compiler will not perform any type checks or type inference on that value.

    • as const

      as const is a TypeScript feature that allows you to tell the compiler to infer the narrowest or most specific type possible for an expression. Instead of the compiler widening the type of a value to its general type (like inferring a string variable as string), as const makes the compiler infer the value as a…

    • Non-null Assertion

      The non-null assertion operator in TypeScript is a way to tell the compiler that you are certain a value is not null or undefined, even if the TypeScript's type checker thinks it could be. It is denoted by an exclamation mark (!) placed after a variable or expression. Using this operator effectively tells the…

    • satisfies keyword

      The satisfies keyword in TypeScript is used to ensure that a value conforms to a specific type without explicitly declaring that type. This is particularly useful when you want to check that an object's structure matches a type definition but still allow TypeScript to infer a more specific type for the object's…

    • Union Types

      Union types allow a variable to hold values of different types. This means you can specify that a variable can be, for example, either a string or a number. You define a union type using the pipe (|) symbol to separate the possible types. This provides flexibility in situations where a variable might accept…

    • Intersection Types

      Intersection types in TypeScript allow you to combine multiple types into a single type. The resulting type has all the features (properties, methods, etc.) of all the constituent types. This is particularly useful when you want to create a type that represents an object that must satisfy multiple type constraints…

    • Type Aliases

      Type aliases in TypeScript create a new name for an existing type. This new name can then be used anywhere you would normally use the original type. They don't create a new type; instead, they offer a more readable and convenient way to refer to potentially complex or frequently used types, such as unions,…

    • keyof Operator

      The keyof operator in TypeScript creates a union of all the keys (property names) of a given object type. It essentially extracts the names of the properties as string literal types. This allows you to work with the properties of an object type in a type-safe way, especially when dealing with generic functions or…

    • unknown

      The unknown type in TypeScript represents a value that can be anything. Unlike any, which essentially disables type checking, unknown forces you to perform type checks or type assertions before you can perform operations on a value declared as unknown. This helps prevent unexpected errors at runtime by ensuring…

    • never

      The never type in TypeScript represents the type of values that will never occur. This means a function that always throws an error or runs forever (infinite loop) implicitly returns never. It is also useful for exhaustive checking in discriminated unions, ensuring that all possible cases are handled. Essentially,…

    • any

      TypeScript has a special type, any, that you can use whenever you don’t want a particular value to cause typechecking errors.

  6. Stage 6: TypeScript Interfaces

    • TypeScript Interfaces

      Interfaces in TypeScript are a way to define a contract for the structure of an object. They describe the shape that an object should have, specifying the names, types, and optionality of its properties. Essentially, an interface names a specific combination of fields and their types. These interfaces don't compile…

    • Types vs Interfaces

      In TypeScript, both types and interfaces are ways to define the shape of an object. They specify what properties an object should have and the data type of those properties. Types can describe simple types like primitives (string, number, boolean) or more complex structures like unions and intersections, while…

    • Extending Interfaces

      Extending interfaces in TypeScript allows you to create new interfaces based on existing ones. This means a new interface can inherit all the properties and methods of a parent interface and add its own unique members, promoting code reuse and establishing a clear hierarchy of types. Think of it like inheritance in…

    • Interface Declaration

      An interface declaration introduces a new named type into the TypeScript type system. It specifies a contract that an object (or other type) can adhere to, defining the names and types of properties and methods that implementing objects must possess. Interfaces do not produce JavaScript code; they exist purely for…

    • Hybrid Types

      Hybrid types describe objects that act as both an object and a function. In essence, they possess properties and methods like a regular object, but they can also be invoked or called directly like a function. This unusual structure is often used when a function needs to maintain state or have additional properties…

  7. Stage 7: Type Guards / Narrowing

    • Type Guards / Narrowing

      Type guards and narrowing are techniques in TypeScript used to refine the type of a variable within a specific scope. They allow you to tell the TypeScript compiler that a variable is more specific than its declared type, enabling you to safely perform operations that would otherwise result in type errors. This is…

    • instanceof

      The instanceof operator checks if an object is an instance of a specific class or constructor function. It determines if the prototype property of a constructor appears anywhere in the prototype chain of an object. The result of this check is a boolean value, indicating whether the object is considered an instance…

    • typeof

      typeof in TypeScript is a way to narrow down the type of a variable based on its JavaScript typeof operator result. This allows you to write more precise code by checking the type of a variable (like string, number, boolean, symbol, or object) and then treating it accordingly within a specific block of code. By…

    • Equality

      Equality in the context of type guards and narrowing refers to using comparison operators (like ===, !==, ==, !=) to refine the type of a variable within a TypeScript program. By comparing a variable against a specific value (or another variable), TypeScript can infer a more specific type for that variable within a…

    • Truthiness

      Truthiness in TypeScript, as in JavaScript, refers to the concept of a value evaluating to true when encountered in a Boolean context. Certain values are inherently "truthy" while others are "falsy." TypeScript uses this understanding to refine the type of a variable based on the outcome of a truthiness check,…

    • Type Predicates

      Type predicates are a way to refine the type of a variable within a TypeScript function. They're used to tell the TypeScript compiler that a specific condition guarantees a variable is of a certain type. Instead of the compiler inferring the type based on basic checks, a type predicate explicitly asserts that if a…

  8. Stage 8: TypeScript Functions

    • TypeScript Functions

      Functions in TypeScript are reusable blocks of code designed to perform specific tasks. They can accept inputs (parameters), process them, and return a result. TypeScript enhances JavaScript functions by adding type annotations to parameters and return values, enabling better code clarity and error checking during…

  9. Stage 9: Classes

    • Classes

      Classes are blueprints for creating objects, encapsulating data (properties) and behavior (methods) into a single unit. They provide a structured way to define the characteristics and actions that an object of that class can possess. This allows for creating multiple instances of the same object type with…

  10. Stage 10: Generics

    • Generics

      Generics are a way to write code that can work with a variety of types without knowing those types ahead of time. They allow you to define type variables that can be used to represent the specific type that will be used when the code is actually executed. This makes your code more reusable and type-safe by…

    • Generic Types

      Generic types allow you to write code that can work with a variety of types without sacrificing type safety. Think of them as placeholders for types that you specify later when you use the code. To create a generic type, you use angle brackets < to define type parameters. These parameters act as variables that…

    • Generic Constraints

      Generic constraints in TypeScript allow you to limit the types that can be used as type arguments for a generic type or function. They ensure that the type argument satisfies a specific requirement, like having certain properties or methods. This provides more type safety and enables you to work with specific…

  11. Stage 11: Utility Types

    • Utility Types

      Utility Types in TypeScript are built-in generic types that perform common type transformations. They allow you to create new types based on existing ones by applying operations like making properties optional, required, readonly, or picking specific properties. These utilities enhance type safety and code…

    • Typing Functions

      Functions in programming are reusable blocks of code that perform specific tasks. Typing functions in TypeScript means defining the types of the parameters a function accepts and the type of value it returns. This allows the TypeScript compiler to verify that functions are used correctly, preventing type-related…

    • Function Overloading

      Function overloading allows you to define multiple function signatures with the same name but different parameter types or numbers of parameters. This lets you provide specific type information based on how the function is called, enhancing type safety and code clarity. When you call an overloaded function,…

    • Partial

      The Partial<Type utility type in TypeScript constructs a type where all properties of the original Type are set to optional. This means that when you use Partial<Type, you can create objects that only include a subset of the properties defined in the original Type, or even have no properties at all. Essentially, it…

    • Pick

      Pick is a utility type that constructs a new type by selecting a set of properties from an existing type. You specify which properties you want to include in the new type using their keys. This is useful when you need a subset of properties from a larger type definition.

    • Omit

      Omit is a utility type in TypeScript that constructs a new type by picking all properties from an existing type and then removing the specified properties (keys). Essentially, it creates a subset of the original type by excluding certain keys you define. The resulting type will only contain the properties that were…

    • Readonly

      The Readonly utility type in TypeScript constructs a new type where all properties of the original type are set as read-only. This means that once a property is initialized, its value cannot be changed later. This is useful for creating immutable objects and ensuring that data is not accidentally modified.

    • Record

      The Record utility type in TypeScript is used to construct a new type where the keys are of a specific type (typically a string, number, or symbol) and the values are of another specified type. This is useful when you want to define an object structure with a predefined set of keys and a consistent type for the…

    • Exclude

      Exclude is a utility type in TypeScript that constructs a new type by removing types from a union type. Given two types, Type and ExcludedUnion, Exclude<Type, ExcludedUnion creates a type that includes all members of Type that are not assignable to ExcludedUnion. This is useful for filtering out specific types from…

    • Extract

      Extract allows you to create a new type by picking out specific types from a union based on a condition. Essentially, it filters a union type, keeping only those members that are assignable to a specified type. This is useful when you need to narrow down the possible types in a union to only those that meet a…

    • Awaited

      Awaited is a utility type in TypeScript that is used to recursively unwrap the Promise type. It simulates the await operator's behavior in JavaScript. If you have a type that represents a Promise, Awaited can extract the underlying type that the Promise resolves to. It handles nested Promise types and other…

    • Parameters

      The Parameters utility type in TypeScript extracts the parameter types of a function type into a tuple. This allows you to programmatically determine the expected arguments of a function and use them in other type definitions, providing type safety and flexibility when working with function signatures. The result…

    • NonNullable

      NonNullable is a utility type that removes null and undefined from a type. If you have a type that could potentially be null or undefined, applying NonNullable ensures that the resulting type will only consist of the original type's other possible values, effectively guaranteeing that null and undefined are excluded.

    • ReturnType

      ReturnType is a utility type that extracts the return type of a function. Given a function type, ReturnType<Type produces a new type that represents the type of value that the function returns. This is useful when you need to work with the output of a function without knowing its exact return type beforehand.

    • InstanceType

      InstanceType is a conditional type in TypeScript that extracts the instance type of a constructor function type. In simpler terms, given a type that represents a class or a constructor function, InstanceType determines the type of the object that would be created when you use the new keyword with that constructor.…

    • Constructor Params

      In TypeScript classes, constructor parameters provide a concise way to define and initialize class properties directly within the constructor's parameter list. By using access modifiers like public, private, or protected before a constructor parameter, TypeScript automatically creates a corresponding class property…

    • Access Modifiers

      Access modifiers in object-oriented programming control the visibility of class members (properties and methods). They determine which parts of your code, or even external code, can access and modify those members. Common access modifiers include public, private, and protected, each offering different levels of…

    • Abstract Classes

      An abstract class is a class that cannot be instantiated directly. Its primary purpose is to define a blueprint for other classes. It can contain abstract methods (methods without implementation) and concrete methods (methods with implementation). Subclasses must provide concrete implementations for all abstract…

    • Inheritance vs Polymorphism

      Inheritance is a mechanism where a class (the subclass or derived class) acquires the properties and methods of another class (the superclass or base class), establishing an "is-a" relationship. Polymorphism, meaning "many forms," allows objects of different classes to be treated as objects of a common type,…

    • Method Overriding

      Method overriding allows a subclass to provide a specific implementation for a method that is already defined in its superclass. When a method in a subclass has the same name, same parameters, and same return type (or a more specific return type, known as covariant return type) as a method in its superclass, the…

    • Constructor Overloading

      Constructor overloading allows a class to have multiple constructors with different parameter lists. This enables you to create objects of the class in different ways, providing flexibility in initialization based on the provided arguments. Each constructor variation handles the object's initialization differently…

  12. Stage 12: Decorators

    • Decorators

      Decorators are a special kind of declaration that can be attached to a class declaration, method, accessor, property, or parameter. They use the form @expression, where expression must evaluate to a function that will be called at runtime with information about the decorated declaration. Decorators provide a way to…

  13. Stage 13: Advanced Types

    • Advanced Types

      TypeScript's advanced types allow for more precise and flexible type definitions beyond basic primitives. Intersection types combine multiple types into one, requiring a value to satisfy all combined types. Union types allow a value to be one of several specified types. Type aliases create a name for a type, making…

    • Mapped Types

      Mapped types in TypeScript allow you to create new types based on existing ones by transforming each property. They iterate over the keys of an existing type and apply a transformation to each key and/or value, effectively mapping the original type to a new type structure. This provides a concise and powerful way…

    • Conditional Types

      Conditional types in TypeScript allow you to define types that depend on other types, similar to a ternary operator in JavaScript. They enable you to express type relationships that change based on whether a specific type condition is met. This feature makes your type definitions more flexible and capable of…

    • Literal Types

      Literal types are a feature that allows you to specify the exact value a variable can hold. Instead of just saying a variable is a string or a number, you can specify that it can only be a particular string like "hello" or a particular number like 42. This enables more precise type checking and helps catch errors…

    • Template Literal Types

      Template literal types in TypeScript are a way to create new string literal types by combining existing string literal types, much like template literals in JavaScript. They allow you to define string types that are composed of other string types with specific patterns or structures. This is done by embedding other…

    • Recursive Types

      Recursive types in TypeScript allow you to define types that refer to themselves. This is especially useful for representing data structures that have a nested or hierarchical structure, like trees or linked lists. By using recursion in type definitions, you can ensure that the type system accurately reflects the…

  14. Stage 14: TypeScript Modules

    • TypeScript Modules

      Modules in TypeScript (and JavaScript) are a way to organize code into reusable and manageable blocks. Each module encapsulates its own variables, functions, classes, and interfaces, preventing naming collisions and promoting code modularity. Modules explicitly export parts that other code can use and import…

    • Namespaces

      Namespaces in TypeScript are a way to organize code into logical groups, preventing naming collisions and improving code maintainability. They create a named container where you can define variables, functions, classes, and interfaces. By using namespaces, you can encapsulate related functionality under a specific…

    • Ambient Modules

      Ambient modules in TypeScript are used to describe the shape of existing JavaScript code when you don't have the TypeScript declaration files (.d.ts) readily available. They essentially allow you to tell the TypeScript compiler about the existence and structure of a JavaScript module, so you can import and use it…

    • External Modules

      External modules in TypeScript are files containing code that can be imported and used in other files. They help organize and structure your project by dividing code into logical units, improving maintainability and reusability. Each external module has its own scope, preventing naming conflicts and allowing you to…

    • Namespace Augmentation

      Namespace augmentation in TypeScript allows you to add new properties or methods to an existing namespace, even if that namespace is defined in a separate file or module. This feature is particularly useful for extending namespaces declared in external libraries or modules without directly modifying the original…

    • Global Augmentation

      Global augmentation in TypeScript lets you add or modify existing global types and interfaces. This is particularly useful when working with JavaScript libraries that don't have TypeScript definitions or when you want to extend existing TypeScript definitions to suit your specific project needs. It essentially…

  15. Stage 15: Ecosystem

    • Ecosystem

      The TypeScript ecosystem refers to the collection of tools, libraries, frameworks, and resources that support and enhance TypeScript development. It includes everything from build tools and linters to UI libraries and server-side frameworks that have TypeScript definitions available or are specifically designed to…

    • Formatting

      Formatting tools automatically adjust the way your code looks, making it consistent and easier to read. These tools can handle things like spacing, indentation, and line breaks. This makes your code cleaner and helps everyone on a team follow the same style. A popular tool for formatting code is Prettier. It…

    • Linting

      Linting is the process of running a program that analyzes code for potential errors, stylistic issues, and code quality problems. It helps developers identify and fix issues early in the development cycle, leading to more maintainable and consistent codebases. ESLint is a popular linting tool for JavaScript and…

    • Useful Packages

      TypeScript has a large ecosystem of packages that can be used to extend the language or to add functionality to your project.

    • Build Tools

      Task runners automatically execute commands and carry out processes behind the scenes. This helps automate your workflow by performing mundane, repetitive tasks that you would otherwise waste an egregious amount of time repeating. Common usages of task runners include numerous development tasks such as: spinning up…

Questions about the TypeScript Roadmap

Is the TypeScript Roadmap free?

Yes. All 93 lessons in this roadmap are free to read on Bibha AI Learning Labs, with no account and no payment. Signing in is optional: it lets you mark lessons as done and keep your progress, and it opens the AI tutor, which runs on your own API key.

How long does the TypeScript Roadmap take?

There is no fixed duration. It has 93 lessons in 15 stages, and the time it takes depends on how many hours you give it each week. Nothing is locked, so you can skip what you already know, and your progress is saved once you sign in.

Where should I start the TypeScript Roadmap?

Start with stage 1, Introduction to TypeScript, and work down in order. The stages are numbered in the order the roadmap suggests, but every lesson is open, so if you already know Introduction to TypeScript you can go straight to Type Inference or anything after it. Each lesson links to free resources for going deeper.

Can I learn TypeScript in Hindi?

The lessons are written in English. Once you sign in, you can ask the AI tutor on any lesson to explain it in Hindi or Hinglish. It answers from that lesson’s own text, so the explanation stays on the syllabus. The tutor runs on your own Google, OpenAI or Anthropic key.

Still confused? Ask me