TypeScript

Definition

TypeScript is a statically typed superset of Javascript

  • License: Apache 2.0
  • Runtime: Compiles to JavaScript; runs on any JS engine (V8, SpiderMonkey, JavaScriptCore)
  • Creator: Anders Hejlsberg (also created C Sharp)
  • First released: 2012

Language Features

  • Static typing: Optional type annotations with type inference
  • Interfaces: Structural typing for object shapes
  • Generics: Type-safe reusable components
  • Enums: Named constants (numeric and string-based)
  • Decorators: Metadata and meta-programming (experimental/stable depending on version)
  • Utility types: Partial, Pick, Omit, Record, etc.
  • Type guards: typeof, instanceof, user-defined-type-guards

Major Versions

Version Year Key Features
TypeScript 1.0 2014 First stable release, type annotations
TypeScript 1.5 2015 Modules, enum, target
TypeScript 2.0 2016 Union-types, intersection-types, literal-types
TypeScript 2.4 2017 string-literal-types
TypeScript 2.8 2018 string-literal-types, const-assertions
TypeScript 3.0 2018 tuple-types, declaration-files
TypeScript 3.7 2019 optional-chaining, nullish-coalescing
TypeScript 4.0 2020 type-narrowing, satisfies-operator
TypeScript 4.7 2022 satisfies-operator, const-type-parameters
TypeScript 5.0 2023 declaration-files, const-type-parameters
TypeScript 5.4 2024 path-mapping, isolated-modules

Tooling

Tool Purpose
tsc TypeScript compiler
ts-node Run TypeScript directly
ESLint + typescript-eslint Linting
Prettier Code formatting
Jest / Vitest Testing

Ecosystem

Framework/Library Description
Angular Google’s full-stack framework (written in TypeScript)
NestJS Server-side framework inspired by Angular
React + TypeScript React with type-safe props and hooks
Vue 3 Composition API with TypeScript support
Svelte Compile-time framework with TS support

Use Cases

  • Large-scale web applications (type safety at scale)
  • Enterprise applications (Angular, NestJS)
  • Library development (published to npm with types)
  • API development (type-safe endpoints)
  • Codebases migrating from JavaScript