Creating Types from Types

TypeScript’s type system is very powerful because it allows expressing types in terms of other types.

The simplest form of this idea is generics. Additionally, we have a wide variety of type operators available to use. It’s also possible to express types in terms of values that we already have.

By combining various type operators, we can express complex operations and values in a succinct, maintainable way. In this section we’ll cover ways to express a new type in terms of an existing type or value.

The TypeScript docs are an open source project. Help us improve these pages by sending a Pull Request

Contributors to this page:
OTOrta Therox  (6)
GFGraham Fisher  (1)
APAlexander Pepper  (1)
PCPradeep Chauhan  (1)

Last updated: Mar 18, 2024