TypeScript Documentation
Guides
Sections
- /// <amd-dependency /> - Triple-Slash Directives
- /// <amd-module /> - Triple-Slash Directives
- /// <reference lib="..." /> - Triple-Slash Directives
- /// <reference no-default-lib="true"/> - Triple-Slash Directives
- /// <reference path="..." /> - Triple-Slash Directives
- /// <reference types="..." /> - Triple-Slash Directives
- @ts-check - JS Projects Utilizing TypeScript
- A Note on Soundness - Type Compatibility
- About this Handbook - The TypeScript Handbook
- Accessor Decorators - Decorators
- Add TypeScript - ASP.NET Core
- Add TypeScript code - ASP.NET Core
- Add modules to the code - Gulp
- Advanced Combinations - Deep Dive
- Advanced Topics - Type Compatibility
- Aliases - Namespaces
- Alternative Pattern - Mixins
- Ambient Namespaces - Namespaces
- Ambient enums - Enums
- An Example Project - Project References
- Arrays - Everyday Types
- Assertion functions - Narrowing
- Assignability of Functions - More on Functions
- Assignments - Narrowing
- Awaited<Type> - Utility Types
- Babel - Integrating with Build Tools
- Babel for transpiling, tsc for types - Using Babel with TypeScript
- Babel vs tsc for TypeScript - Using Babel with TypeScript
- Background - Configuring Watch
- Basic Concepts - Declaration Merging
- Basic Example - DOM Manipulation
- Basic usage - JSX
- Best common type - Type Inference
- Browserify - Gulp
- Browserify - Integrating with Build Tools
- Build Mode for TypeScript - Project References
- Building your first TypeScript file - TypeScript Tooling in 5 minutes
- Call Signatures - More on Functions
- Callback Types - Do's and Don'ts
- Caveats - Project References
- Caveats for Project References - Project References
- Class Decorators - Decorators
- Class Expressions - Classes
- Class Heritage - Classes
- Class Members - Classes
- Classes - Declaration Reference
- Classes - JSDoc Reference
- Classes - Type Compatibility
- Classes - TypeScript Tooling in 5 minutes
- Classes, functions, and object literals are namespaces - Type Checking JavaScript Files
- Co-learning JavaScript - TypeScript for Java/C# Programmers
- Common CommonJS Patterns - Modules .d.ts
- CommonJS Syntax - Modules
- CommonJS modules are supported - Type Checking JavaScript Files
- Comparing JavaScript to an example DTS - Modules .d.ts
- Comparing two functions - Type Compatibility
- Compiler Options - tsc CLI Options
- Compiling your code - TypeScript Tooling in 5 minutes
- Composing Types - TypeScript for JavaScript Programmers
- Computed and constant members - Enums
- Concepts not in Haskell - TypeScript for Functional Programmers
- Concepts similar to Haskell - TypeScript for Functional Programmers
- Conclusions - Modules - ESM/CJS Interoperability
- Configuring directory watching using environment variable TSC_WATCHDIRECTORY - Configuring Watch
- Configuring file watching using a tsconfig.json - Configuring Watch
- Configuring file watching using environment variable TSC_WATCHFILE - Configuring Watch
- Constrained Mixins - Mixins
- Constraints - Mixins
- Construct Signatures - More on Functions
- Constructor Signatures - Classes
- Constructor functions are equivalent to classes - Type Checking JavaScript Files
- ConstructorParameters<Type> - Utility Types
- Consuming - Consumption
- Consuming Dependencies - Global: Plugin
- Consuming Dependencies - Library Structures
- Contextual Typing - Type Inference
- Control flow analysis - Narrowing
- Create a new project - ASP.NET Core
- DOM Manipulation - DOM Manipulation
- Debug - ASP.NET Core
- Declaration File Theory: A Deep Dive - Deep Dive
- Declaration Reference - Introduction
- Declaring this in a Function - More on Functions
- Decorator Composition - Decorators
- Decorator Evaluation - Decorators
- Decorator Factories - Decorators
- Decorators - Decorators
- Deep Dive - Introduction
- Defining Types - TypeScript for JavaScript Programmers
- Dependencies - Publishing
- Destructuring - Variable Declaration
- Details - What is a tsconfig.json
- Difference between children and childNodes - DOM Manipulation
- Disallowed Merges - Declaration Merging
- Distributive Conditional Types - Conditional Types
- Documentation - JSDoc Reference
- Downleveling - The Basics
- Downloading - Consumption
- Do’s and Don’ts - Introduction
- Early Benefits - Migrating from JavaScript
- Editing the package.json - Creating .d.ts Files from .js files
- Embedding Expressions - JSX
- Emitting with Errors - The Basics
- Enums - Everyday Types
- Enums - Type Compatibility
- Enums at compile time - Enums
- Enums at runtime - Enums
- Equality narrowing - Narrowing
- Erased Types - The Basics
- Examples - What is a tsconfig.json
- Examples of Global Libraries - Global .d.ts
- Excess Property Checks - Object Types
- Exclude<UnionType, ExcludedMembers> - Utility Types
- Explicit Types - The Basics
- Extending Types - Object Types
- Extract<Type, Union> - Utility Types
- Find and Install Declaration Files - Introduction
- First steps - Namespaces
- Footnotes - Global: Plugin
- Footnotes - Library Structures
- Function Overloads - Do's and Don'ts
- Function Overloads - More on Functions
- Function Type Expressions - More on Functions
- Function declarations - Variable Declaration
- Function parameters are optional by default - Type Checking JavaScript Files
- Functions - Everyday Types
- General Types - Do's and Don'ts
- Generic Classes - Classes
- Generic Classes - Generics
- Generic Constraints - Generics
- Generic Functions - More on Functions
- Generic Object Types - Object Types
- Generic Parameter Defaults - Generics
- Generic Types - Generics
- Generics - Type Compatibility
- Get Started - The TypeScript Handbook
- Global Functions - Declaration Reference
- Global Libraries - Global .d.ts
- Global Library Template - Global .d.ts
- Global Plugin - Global: Plugin
- Global Variables - Declaration Reference
- Global-modifying Modules - Global: Modifying Module
- Global-modifying Modules - Global: Plugin
- Grunt - Integrating with Build Tools
- Guidance - Project References
- Gulp - Integrating with Build Tools
- Handling Many Consuming Import - Modules .d.ts
- Hello World of Generics - Generics
- Heterogeneous enums - Enums
- How Does A Mixin Work? - Mixins
- How JavaScript Modules are Defined - Modules
- How is this Handbook Structured - The TypeScript Handbook
- Identifying Kinds of Libraries - Library Structures
- Identifying a Global Library from Code - Global .d.ts
- Identifying global-modifying modules - Global: Modifying Module
- Including declarations in your npm package - Publishing
- Install ASP.NET Core and TypeScript - ASP.NET Core
- Installing TypeScript - TypeScript Tooling in 5 minutes
- InstanceType<Type> - Utility Types
- Integrating with Build Tools - Migrating from JavaScript
- Interested in learning more? - DOM Manipulation
- Interface Extension vs. Intersection - Object Types
- Interfaces - Everyday Types
- Interfaces - TypeScript Tooling in 5 minutes
- Interop in Node.js - Modules - ESM/CJS Interoperability
- Intersection Types - Object Types
- Intrinsic String Manipulation Types - Template Literal Types
- Intrinsic String Manipulation Types - Utility Types
- Introduction - Declaration Merging
- Introduction - Decorators
- Iterables - Iterators and Generators
- I’m writing a library - Modules - Choosing Compiler Options
- I’m writing an app - Modules - Choosing Compiler Options
- Jspm - Integrating with Build Tools
- Key Concepts - Deep Dive
- Key Remapping via as - Mapped Types
- Learning JavaScript and TypeScript - TypeScript for the New Programmer
- Less Common Primitives - Everyday Types
- Library Structures - Introduction
- Literal Types - Everyday Types
- MSBuild - Integrating with Build Tools
- MSBuild - Project References
- Matching behavior - Publishing
- Member Visibility - Classes
- Merging Interfaces - Declaration Merging
- Merging Namespaces - Declaration Merging
- Merging Namespaces with Classes, Functions, and Enums - Declaration Merging
- Metadata - Decorators
- Method Decorators - Decorators
- Minimal project - Gulp
- Module Augmentation - Declaration Merging
- Module Plugin or UMD Plugin - Global: Plugin
- Module resolution - Modules - Theory
- Module syntax - Modules - Reference
- Modules in TypeScript - Modules
- Moving to TypeScript Files - Migrating from JavaScript
- Multi-file namespaces - Namespaces
- Multiple fields - Publishing
- Namespaced Validators - Namespaces
- Namespacing - Namespaces
- Next Steps - TypeScript for Java/C# Programmers
- Next Steps - TypeScript for JavaScript Programmers
- Next Steps - TypeScript for the New Programmer
- NoInfer<Type> - Utility Types
- Non-exception Failures - The Basics
- Non-modules - Modules
- NonNullable<Type> - Utility Types
- NuGet - Integrating with Build Tools
- Numeric enums - Enums
- OOP in TypeScript - TypeScript for Java/C# Programmers
- Object Types - Everyday Types
- Object literals are open-ended - Type Checking JavaScript Files
- Objects vs Enums - Enums
- Objects with Properties - Declaration Reference
- Omit<Type, Keys> - Utility Types
- OmitThisParameter<Type> - Utility Types
- Optional Parameters - More on Functions
- Organizing Types - Declaration Reference
- Other - JSDoc Reference
- Other Types to Know About - More on Functions
- Overloaded Functions - Declaration Reference
- Overview - Compiler Options in MSBuild
- Overview - What is a tsconfig.json
- Parameter Decorators - Decorators
- Parameter Destructuring - More on Functions
- Parameter Properties - Classes
- Parameters<Type> - Utility Types
- Partial<Type> - Utility Types
- Pick<Type, Keys> - Utility Types
- Pitfalls of Namespaces and Modules - Namespaces and Modules
- Prerequisites - TypeScript for Functional Programmers
- Properties are inferred from assignments in class bodies - Type Checking JavaScript Files
- Property Decorators - Decorators
- Property Modifiers - Object Types
- Providing Type Hints in JS via JSDoc - JS Projects Utilizing TypeScript
- Publish to @types - Publishing
- Publish to npm - Introduction
- Quick Reference - Object Types
- React integration - JSX
- Readonly<Type> - Utility Types
- Record<Keys, Type> - Utility Types
- Red flags - Publishing
- Reference Example - Modules .d.ts
- Related - tsc CLI Options
- Relationships Between Classes - Classes
- Required<Type> - Utility Types
- Rest Parameters and Arguments - More on Functions
- Rethinking Types - TypeScript for Java/C# Programmers
- Rethinking the Class - TypeScript for Java/C# Programmers
- ReturnType<Type> - Utility Types
- Reusable Types (Interfaces) - Declaration Reference
- Reusable Types (Type Aliases) - Declaration Reference
- Rollup - Integrating with Build Tools
- Run the compiler - Creating .d.ts Files from .js files
- Running your TypeScript web app - TypeScript Tooling in 5 minutes
- Schema - What is a tsconfig.json
- Scripts and modules in JavaScript - Modules - Theory
- Searching - Consumption
- Set up the build - ASP.NET Core
- Setting up your Directories - Migrating from JavaScript
- Setting up your Project to emit .d.ts files - Creating .d.ts Files from .js files
- Simple Combinations: One name, multiple meanings - Deep Dive
- Splitting Across Files - Namespaces
- Spread - Variable Declaration
- Starting out - Type Compatibility
- Static Members - Classes
- Static type-checking - The Basics
- Strictness - The Basics
- String enums - Enums
- Structural Type System - TypeScript for JavaScript Programmers
- Svelte Compiler - Integrating with Build Tools
- TSConfig Bases - What is a tsconfig.json
- TSConfig Reference - What is a tsconfig.json
- Test - ASP.NET Core
- The Document Interface - DOM Manipulation
- The Node interface - DOM Manipulation
- The as operator - JSX
- The in operator narrowing - Narrowing
- The keyof type operator - Keyof Type Operator
- The module compiler option - Modules - Reference
- The moduleResolution compiler option - Modules - Reference
- The querySelector and querySelectorAll methods - DOM Manipulation
- The typeof type operator - Typeof Type Operator
- The Impact of ES6 on Module Plugins - Module: Plugin
- The JSX function return type - JSX
- The JSX result type - JSX
- The module output format - Modules - Theory
- The primitives: string , number , and boolean - Everyday Types
- ThisParameterType<Type> - Utility Types
- ThisType<Type> - Utility Types
- Tips - Creating .d.ts Files from .js files
- Type Aliases - Everyday Types
- Type Annotations on Variables - Everyday Types
- Type Assertions - Everyday Types
- Type Checking - JSX
- Type annotations - TypeScript Tooling in 5 minutes
- TypeScript namespaces - Modules
- TypeScript with JavaScript - JS Projects Utilizing TypeScript
- TypeScript: A Static Type Checker - TypeScript for the New Programmer
- TypeScript’s Module Output Options - Modules
- TypeScript’s Module Resolution Options - Modules
- TypeScript’s job concerning modules - Modules - Theory
- Types - JSDoc Reference
- Types by Inference - TypeScript for JavaScript Programmers
- Types for Tooling - The Basics
- Types in Modules - Modules .d.ts
- UMD - Global: Plugin
- Union Types - Everyday Types
- Union enums and enum member types - Enums
- Unspecified type parameters default to any - Type Checking JavaScript Files
- Updating your IDE to use the nightly builds - Nightly Builds
- Using tsconfig.json or jsconfig.json - What is a tsconfig.json
- Using Class Types in Generics - Generics
- Using Modules - Namespaces and Modules
- Using Namespaces - Namespaces and Modules
- Using Project Settings - Compiler Options in MSBuild
- Using Type Parameters in Generic Constraints - Generics
- Using a tsconfig.json - Compiler Options in MSBuild
- Using npm - Nightly Builds
- Using the CLI - tsc CLI Options
- Using type predicates - Narrowing
- Validators in a single file - Namespaces
- Var-args parameter declaration inferred from use of arguments - Type Checking JavaScript Files
- Variance Annotations - Generics
- Version selection with typesVersions - Publishing
- Vite - Integrating with Build Tools
- Watchify, Babel, and Terser - Gulp
- Webpack - Integrating with Build Tools
- Well-known Symbols - Symbols
- What is JavaScript? A Brief History - TypeScript for the New Programmer
- What is a Project Reference? - Project References
- Who is the host? - Modules - Theory
- Working with Generic Type Variables - Generics
- Working with Other JavaScript Libraries - Namespaces
- Write a HTML page - ASP.NET Core
- Writing a Configuration File - Migrating from JavaScript
- abstract Classes and Members - Classes
- allowSyntheticDefaultImports and esModuleInterop - Modules - ESM/CJS Interoperability
- any , unknown , object , void , undefined , null , and never assignability - Type Compatibility
- any - Everyday Types
- await using declarations - Variable Declaration
- composite - Project References
- const declarations - Variable Declaration
- declarationMap - Project References
- instanceof narrowing - Narrowing
- let declarations - Variable Declaration
- let vs. const - Variable Declaration
- noImplicitAny - The Basics
- null and undefined - Everyday Types
- null, undefined, and empty array initializers are of type any or any[] - Type Checking JavaScript Files
- preserve="true" - Triple-Slash Directives
- static Blocks in Classes - Classes
- strictNullChecks - The Basics
- this Types - Classes
- this at Runtime in Classes - Classes
- tsc , the TypeScript compiler - The Basics
- typeof type guards - Narrowing
- unique symbol - Symbols
- using and await using in for and for..of statements - Variable Declaration
- using and await using in older runtimes - Variable Declaration
- using declarations - Variable Declaration
- var declarations - Variable Declaration