TypeScript is a typed superset of JavaScript that adds a static type system and compile-time checks while still running as plain JavaScript after compilation. It matters because it lets teams model data shapes, APIs, and module boundaries explicitly, catching many bugs before runtime and improving editor tooling (navigation, refactors, autocomplete). The key mental model is that TypeScript's checking is mostly structural and happens at compile time — your types don't exist at runtime unless you write runtime validation. TypeScript 5.x has added significant capabilities including Stage 3 decorators, explicit resource management (using/await using), the NoInfer<T> utility type, inferred type predicates, and --erasableSyntaxOnly for Node.js type-stripping workflows.
15 tables, 160 concepts. Select a concept node to jump to its table row.
Table 1: Type Annotations & Primitive Types
| Concept | Example | Description |
|---|---|---|
let n: number = 42 | Explicitly assigns a static type to a variable, parameter, or return value. | |
const s = "hello" | Compiler infers a type from an initializer or usage without an annotation. | |
let name: string = "Ada" | Primitive text type. | |
let pi: number = 3.14159 | Primitive floating-point numeric type (JS number). | |
let ok: boolean = true | Primitive true/false type. | |
const id: bigint = 123n | Primitive for arbitrary-size integers (JS bigint). | |
const key: unique symbol = Symbol("k") | • Primitive for unique identifiers • unique symbol supports nominal-like keys. | |
let x: string | undefined | • Represent absence • require explicit handling under strictNullChecks. | |
let data: any = JSON.parse(text) | • Disables type checking for the value — escape hatch • avoid in new code. | |
let data: unknown = JSON.parse(text) | • Safer top type than any• must be narrowed before property access or calls. | |
function log(msg: string): void { console.log(msg) } | Indicates a function returns no useful value. | |
function fail(msg: string): never { throw new Error(msg) } | Indicates no possible value — unreachable code, always-throws, or exhausted union. |
Table 2: Object Shapes (Interfaces, Aliases, Properties)
| Pattern | Example | Description |
|---|---|---|
interface User { id: string; name: string } | • Named object shape • supports extension and declaration merging. | |
type User = { id: string; name: string } | Gives a name to any type expression — primitives, unions, tuples, objects. | |
const u: { id: string; name: string } = { id: "1", name: "Ada" } | Inline property names and types without naming the type. | |
type User = { name: string; email?: string } | Marks a property as possibly absent. | |
type User = { readonly id: string; name: string } | Prevents assignment after initialization at the type-checking level. | |
interface Admin extends User { role: "admin" } | Builds larger shapes from smaller ones via extends. | |
type Headers = { [name: string]: string } | Types objects with unknown keys by specifying key/value types. | |
type Fn = { (x: number): string } | Describes a callable object that may also carry properties. | |
type Ctor = { new (s: string): Date } | Describes a new-able constructor type. | |
const u: User = { id: "1", name: "Ada", extra: 1 } | Object literals checked for unknown properties when directly assigned to a type. |
Table 3: Type Composition (Unions, Intersections, Literals, Enums)
| Type | Example | Description |
|---|---|---|
type ID = string | number | Value can be one of multiple types. | |
type WithId = { id: string } & { createdAt: Date } | Value must satisfy all combined types simultaneously. | |
const roles = ["admin", "user"] as const | Infers the narrowest literal and readonly types for an expression. | |
type Role = "admin" | "user" | Restricts values to specific string constants. | |
type Dice = 1 | 2 | 3 | 4 | 5 | 6 | Restricts values to specific numeric constants. | |
const pair: [string, number] = ["a", 1] | Fixed-length array with positional element types. | |
user!.id | Asserts a value is not null/undefined for type checking (erased at runtime). | |
enum Role { Admin = "admin", User = "user" } | • Members have explicit string values at runtime • more debuggable than numeric enums. | |
enum Status { Pending, Done } | • Named constants that emit a runtime JS object • auto-increments from 0. | |
const enum Dir { Up, Down } | • Inlines enum values at emit time — no runtime object • avoid in public declaration files. |
Table 4: Functions (Signatures, Generics, Overloads)
| Pattern | Example | Description |
|---|---|---|
type Mapper = (x: number) => string | Describes a function's parameter and return types as a type alias. | |
function first<T>(xs: T[]): T { return xs[0] } | Parameterizes types with <T> for reusable, type-safe logic. | |
function len<T extends { length: number }>(x: T) { return x.length } | Restricts a type parameter with extends so required members can be accessed. | |
function parse(x: string): number;<br> function parse(x: number): string;<br> function parse(x: string | number) { return typeof x === "string" ? +x : String(x) } | Multiple call signatures with one implementation below them. | |
function greet(name?: string) {} | • Parameter may be omitted • typed as possibly undefined inside the function. | |
function inc(n: number = 1) { return n + 1 } | Supplies a default value when the argument is missing or undefined. | |
function sum(...ns: number[]) { return ns.reduce((a,b)=>a+b, 0) } | Collects remaining arguments into a typed array. | |
function identity<const T>(val: T): T { return val }identity(["a","b"]) // T inferred as ["a","b"] not string[] | Infers the narrowest literal type from a call-site argument (TS 5.0+). | |
type ApiResult<T = unknown> = { data: T } | Provides a fallback when type arguments are not supplied or inferred. | |
function f(this: Date) { return this.getTime() } | Fake first parameter to type this (erased in output). | |
type Fn = { (x: string): string; tag: string } | Models callable values that also carry properties. |
Table 5: Classes (Members, Modifiers, Inheritance)
| Concept | Example | Description |
|---|---|---|
class User { constructor(public id: string) {} } | • Defines fields/methods with type annotations • emits a JS class. | |
class User { constructor(public readonly id: string) {} } | Shorthand that declares and initializes a member from a constructor parameter. | |
class A { private secret = 1; protected n = 2; public id = "x" } | • Controls member visibility in type checking • use # for hard JS private fields. | |
class A { readonly id = "x" } | Prevents reassignment after construction at the type-checking level. | |
class Repo implements Iterable<string> { [Symbol.iterator]() { return [][Symbol.iterator]() } } | Checks a class satisfies an interface at compile time. | |
class B extends A {} | Subclassing with super calls and overriding. | |
abstract class Base { abstract run(): void } | • Cannot be instantiated directly • may declare abstract members subclasses must implement. | |
class B extends A { override toString() { return "B" } } | • Replaces a base member • override keyword enforces the base member exists. | |
class A { get x() { return this._x } set x(v: number) { this._x = v } } | Declares typed property accessors. | |
class C { static count = 0; static { C.count = 1 } } | Runs complex static setup code with access to private members (TS 4.4+). | |
// tsconfig.json<br> { "compilerOptions": { "noImplicitOverride": true } } | Requires override keyword on all overriding members for safer refactors. |
Table 6: Narrowing (Type Guards & Control Flow)
| Technique | Example | Description |
|---|---|---|
if (typeof x === "string") x.toUpperCase() | Narrows unions using JS typeof checks. | |
if (e instanceof Error) console.error(e.message) | Narrows via prototype chain checks. | |
if ("id" in obj) obj.id | Narrows based on property existence. | |
if (s) s.trim() | Narrows based on falsy/truthy JavaScript semantics. | |
if (x === null) return | Narrows unions with === / !== comparisons. | |
type Shape = { kind: "circle"; r: number } | { kind: "square"; s: number } | Uses a shared literal field (kind) to narrow via switch/if checks. | |
function isError(x: unknown): x is Error { return x instanceof Error } | User-defined guard that narrows a value to a specific type. | |
const isString = (x: unknown) => typeof x === "string" | TS 5.5+ automatically infers x is string from a boolean-returning function body — no explicit annotation needed. | |
function assertNonNull(x: unknown): asserts x { if (x == null) throw new Error() } | Narrows by asserting a condition holds when the function returns normally. | |
const _exhaustive: never = value | Forces the compiler to prove all union cases are handled — errors if a case is missed. |
Table 7: Type Operators & Advanced Types
| Operator | Example | Description |
|---|---|---|
const input = document.getElementById("id") as HTMLInputElement | • Overrides TypeScript's inferred type • no runtime effect. Use when you know more than the compiler. | |
const x = value as unknown as TargetType | • Forces conversion between unrelated types via the unknown intermediate• use sparingly. | |
const cfg = { mode: "dev" as const }; type Cfg = typeof cfg | Extracts a type from a runtime value's shape. | |
type Keys = keyof User | Produces a union of property keys from an object type. | |
type UserId = User["id"] | Looks up a property type from another type via T[K]. | |
const routes = { home: "/" } satisfies Record<string, string> | Checks an expression matches a type without widening the expression's own inferred type. | |
type RO<T> = { readonly [K in keyof T]: T[K] } | Creates a new object type by iterating over keys. | |
type IsString<T> = T extends string ? true : false | Chooses a type based on an extends relationship test. | |
type EventName = `on${Capitalize<string>}` | Builds string types via template literal syntax over string unions. | |
type Getters<T> = { [K in keyof T as `get${Capitalize<string & K>}`]: () => T[K] } | Renames or filters keys while mapping with the as clause. | |
type ToArray<T> = T extends any ? T[] : never | Distributes over unions when the checked type is a naked type parameter. | |
type Elem<T> = T extends (infer U)[] ? U : T | Introduces an inferred type variable inside a conditional type. | |
type ReadRef<out T> = { readonly value: T }type Writer<in T> = { write(x: T): void } | • out = covariant (used in output position only)• in = contravariant (input only); improves checker accuracy (TS 4.7+). | |
type JSON = string | number | boolean | null | JSON[] | { [k: string]: JSON } | • A type alias that references itself • supported since TS 3.7 via deferred resolution. |
Table 8: Utility Types (Built-in)
| Type | Example | Description |
|---|---|---|
type Patch = Partial<User> | Makes all properties of T optional. | |
type StrictUser = Required<User> | Makes all properties of T required. | |
type Frozen = Readonly<User> | Makes all properties of T readonly. | |
type UserRef = Pick<User, "id" | "name"> | Selects a subset of properties by key. | |
type PublicUser = Omit<User, "email"> | Removes properties by key. | |
type ById = Record<string, User> | Maps keys K to value type T. | |
type NonString = Exclude<string | number, string> | Removes from T the members assignable to U. | |
type OnlyString = Extract<string | number, string> | Keeps from T only the members assignable to U. | |
type NN = NonNullable<string | null | undefined> | Removes null and undefined from a type. | |
type R = ReturnType<() => Promise<number>> | Extracts a function type's return type. | |
type P = Parameters<(x: string, y: number) => void> | Extracts a function type's parameter tuple. | |
type V = Awaited<Promise<string>> | Recursively unwraps the resolved value type of a promise-like. | |
class C { constructor(a: string, b: number) {} }type P = ConstructorParameters<typeof C> // [string, number] | Extracts a constructor's parameter types as a tuple. | |
type I = InstanceType<typeof User> | Extracts the instance type of a constructor function type. | |
function createStore<T>(init: T, fallback: NoInfer<T>): T { return init ?? fallback } | Blocks type inference from the wrapped position, forcing T to be inferred from other arguments (TS 5.4+). | |
const mixin: ThisType<{ x: number }> = { getX() { return this.x } } | Specifies the this type for methods in an object literal (requires noImplicitThis). | |
type U = Uppercase<"hello"> // "HELLO" | Intrinsic string types that transform string literal types to upper/lower case (TS 4.1+). | |
type C = Capitalize<"world"> // "World" | Intrinsic string types that capitalize or uncapitalize the first character of a string literal type (TS 4.1+). | |
type T = ThisParameterType<(this: Date) => void> // Date | Extracts the this parameter type from a function type. | |
type F = OmitThisParameter<(this: Date, x: string) => void> | Removes the this parameter from a function type. |
Table 9: Decorators
| Decorator | Example | Description |
|---|---|---|
function sealed(Base: typeof C, ctx: ClassDecoratorContext) {} class C {} | • Wraps or replaces a class • receives the class and a context object (TS 5.0 Stage 3 syntax). | |
function log(fn: Function, ctx: ClassMethodDecoratorContext) { return function(this: any, ...args: any[]) { return fn.apply(this, args) } }class C { greet() {} } | • Wraps a method • the replacement function is returned. | |
function init<T>(val: T) { return (_: undefined, _ctx: ClassFieldDecoratorContext) => () => val }class C { ("Ada") name!: string } | • Intercepts field initialization • return an initializer function to override the default value. | |
function bound(fn: Function, ctx: ClassAccessorDecoratorContext) {}class C { accessor name = "Ada" } | Decorates an accessor keyword field, which auto-generates a getter/setter pair. | |
function configurable(fn: Function, ctx: ClassGetterDecoratorContext) {}class C { get x() { return 1 } } | Decorates a getter or setter individually. | |
function meta(_: any, ctx: DecoratorContext) { ctx.metadata.info = "x" } class C {}; C[Symbol.metadata] | • TS 5.2+ adds Symbol.metadata to classes• decorators can store metadata accessible at runtime. | |
// tsconfig.json<br> { "compilerOptions": { "experimentalDecorators": true } } | • Enables the pre-Stage-3 legacy decorator syntax used by Angular, NestJS, and older libraries • incompatible with new Stage 3 decorators. |
Table 10: Modules & Imports
| Pattern | Example | Description |
|---|---|---|
import { readFile } from "node:fs/promises" | Standard ECMAScript module syntax, fully type-checked by TS. | |
import type { User } from "./types" | Imports a symbol only for the type system — erased entirely at runtime. | |
export type { User } from "./types" | Re-exports types without a runtime export. | |
import data from "./data.json" with { type: "json" } | • Instructs the runtime how to load a module (e.g., JSON) • ECMAScript 2025, supported from TS 5.3. | |
// tsconfig.json<br> { "compilerOptions": { "verbatimModuleSyntax": true } } | Preserves import/export statements literally and enforces import type for type-only imports. | |
import pkg from "cjs-only" | Covers how TS models default/namespace imports across ESM and CommonJS boundaries. | |
// tsconfig.json<br> { "compilerOptions": { "esModuleInterop": true } } | Adjusts emit and checking for default/namespace imports to match Node.js/bundler behavior. | |
// tsconfig.json<br> { "compilerOptions": { "allowSyntheticDefaultImports": true } } | Allows default imports from modules without a default export (type-checking convenience only). | |
// tsconfig.json<br> { "compilerOptions": { "moduleResolution": "bundler" } } | Selects how imports are resolved: node16, nodenext, or bundler for modern tooling. | |
// tsconfig.json<br> { "compilerOptions": { "module": "nodenext" } } | Selects the emitted module format and influences resolution behavior. | |
// tsconfig.json<br> { "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["src/*"] } } } | Adds path mapping for module specifiers during type checking and emit. |
Table 11: JSX / TSX
| Option | Example | Description |
|---|---|---|
// Component.tsx<br> export function Button() { return <button /> } | Enables JSX syntax in TypeScript source files with .tsx. | |
// tsconfig.json<br> { "compilerOptions": { "jsx": "react-jsx" } } | Controls how JSX is transformed or preserved by the compiler. | |
// tsconfig.json<br> { "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" } } | Sets the module for importing jsx/jsxs factories for the automatic runtime. | |
declare namespace JSX { interface IntrinsicElements { div: any } } | Declares valid JSX tags and their prop types for type checking. |
Table 12: TSConfig Core (Type Checking, Emit, Projects)
| Option | Example | Description |
|---|---|---|
// tsconfig.json<br> { "compilerOptions": { "strict": true } } | Enables a bundle of strict type-checking flags — the recommended baseline for new projects. | |
// tsconfig.json<br> { "compilerOptions": { "strictNullChecks": true } } | Treats null/undefined as distinct types requiring explicit handling. | |
// tsconfig.json<br> { "compilerOptions": { "noImplicitAny": true } } | Errors when the compiler would infer any due to missing type information. | |
// tsconfig.json<br> { "compilerOptions": { "target": "ES2022" } } | Sets the emitted JS language level and enables corresponding downlevel transforms. | |
// tsconfig.json<br> { "compilerOptions": { "lib": ["ES2022", "DOM"] } } | Selects built-in declaration libraries available (e.g., DOM, ES2022). | |
// tsconfig.json<br> { "compilerOptions": { "skipLibCheck": true } } | • Skips type checking of all .d.ts files• improves build speed and avoids third-party type conflicts. | |
// tsconfig.json<br> { "compilerOptions": { "resolveJsonModule": true } } | Allows importing .json files with full type inference from their content. | |
// tsconfig.json<br> { "compilerOptions": { "isolatedModules": true } } | Errors on patterns that require cross-file type information, making single-file transpile tools safe (e.g., esbuild, SWC). | |
// tsconfig.json<br> { "compilerOptions": { "declaration": true } } | Emits .d.ts declaration files describing the public types of each module. | |
// tsconfig.json<br> { "compilerOptions": { "noEmit": true } } | Runs type checking only without writing any output files. | |
// tsconfig.json<br> { "compilerOptions": { "incremental": true } } | Saves build info to a .tsbuildinfo file to speed up subsequent compilations. | |
// tsconfig.json<br> { "compilerOptions": { "composite": true } } | Makes a project reference-able in a project references graph and enables build outputs. | |
// tsconfig.json<br> { "references": [{ "path": "../core" }] } | Declares dependencies between TS projects for tsc -b incremental builds. | |
// tsconfig.json<br> { "compilerOptions": { "exactOptionalPropertyTypes": true } } | Makes optional properties more exact: setting undefined explicitly is distinct from the property being absent. | |
// tsconfig.json<br> { "compilerOptions": { "useUnknownInCatchVariables": true } } | Types catch (e) as unknown instead of any for safer error handling. | |
// tsconfig.json<br> { "compilerOptions": { "isolatedDeclarations": true } } | Requires sufficient type annotations on exports so other tools can generate .d.ts files without full type analysis (TS 5.5+). | |
// tsconfig.json<br> { "compilerOptions": { "erasableSyntaxOnly": true } } | Prohibits TS-specific runtime syntax (enums, namespaces, parameter properties) that cannot be stripped by Node.js type-stripping (TS 5.8+). |
Table 13: tsc CLI Workflows
| Command | Example | Description |
|---|---|---|
tsc | Compiles using the nearest tsconfig.json in the directory tree. | |
tsc --noEmit | Runs the type checker without producing any JavaScript output. | |
tsc --watch | Recompiles on file changes continuously. | |
tsc --init | Creates a tsconfig.json scaffold with annotated options. | |
tsc -p tsconfig.json | Compiles using an explicit configuration file path. | |
tsc -b | Builds a referenced project graph in dependency order. | |
tsc -b --watch | Incrementally rebuilds a project reference graph on changes. | |
tsc --version | Prints the installed TypeScript version to stdout. |
Table 14: Declaration Files & Augmentation
| Pattern | Example | Description |
|---|---|---|
// index.d.ts<br> export interface User { id: string } | Provides type information for JS at compile time with no runtime code. | |
// globals.d.ts<br> declare const VERSION: string | Declares globals accessible without imports (ambient global library style). | |
// index.d.ts<br> declare module "pkg" { export function f(): void } | Declares the shape of an importable module for untyped JS packages. | |
declare global { interface Window { appVersion: string } } | Augments global types from within a module (requires at least one import or export). | |
declare module "express" { interface Request { userId?: string } } | Adds members to an existing module's declarations without forking the types package. | |
interface Box { size: number }interface Box { color: string } | Multiple declarations with the same name are merged into one combined type. | |
/// <reference types="node" /> | • Declares a type package dependency for the file • use import type in modules instead. | |
/// <reference lib="dom" /> | Explicitly includes a built-in lib (e.g., dom) for the file without changing tsconfig.json. |
Table 15: Explicit Resource Management
| Feature | Example | Description |
|---|---|---|
using conn = getConnection() | Automatically calls conn[Symbol.dispose]() when the enclosing scope exits (TS 5.2+, ECMAScript Stage 4). | |
await using conn = await openConnection() | Automatically calls conn[Symbol.asyncDispose]() when the enclosing async scope exits. | |
class Conn { [Symbol.dispose]() { this.close() } } | • The synchronous cleanup method called by using• implement to make a class disposable. | |
class Conn { async [Symbol.asyncDispose]() { await this.close() } } | The asynchronous cleanup method called by await using. | |
function use(r: Disposable) { using _ = r; } | • Interface requiring [Symbol.dispose]()• available in lib: "ES2026" or "esnext.disposable". | |
async function use(r: AsyncDisposable) { await using _ = r; } | Interface requiring [Symbol.asyncDispose](). | |
using stack = new DisposableStack()stack.use(resource); stack.defer(() => cleanup()) | • Aggregates multiple resources for disposal in LIFO order • AsyncDisposableStack for async variants. |
References
Official Documentation
- TypeScript: JavaScript With Syntax For Types - https://www.typescriptlang.org/
- The TypeScript Handbook (Intro) - https://www.typescriptlang.org/docs/handbook/intro.html
- Everyday Types (Handbook) - https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
- Object Types (Handbook) - https://www.typescriptlang.org/docs/handbook/2/objects.html
- Interfaces (Handbook) - https://www.typescriptlang.org/docs/handbook/interfaces.html
- Type Narrowing (Handbook) - https://www.typescriptlang.org/docs/handbook/2/narrowing.html
- More on Functions (Handbook) - https://www.typescriptlang.org/docs/handbook/2/functions.html
- Generics (Handbook) - https://www.typescriptlang.org/docs/handbook/2/generics.html
- Classes (Handbook v2) - https://www.typescriptlang.org/docs/handbook/2/classes.html
- Classes (Legacy Handbook) - https://www.typescriptlang.org/docs/handbook/classes.html
- Unions and Intersections (Handbook) - https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html
- Literal Types (Handbook) - https://www.typescriptlang.org/docs/handbook/literal-types.html
- Enums (Handbook) - https://www.typescriptlang.org/docs/handbook/enums.html
- Keyof Type Operator (Handbook) - https://www.typescriptlang.org/docs/handbook/2/keyof-types.html
- Typeof Type Operator (Handbook) - https://www.typescriptlang.org/docs/handbook/2/typeof-types.html
- Indexed Access Types (Handbook) - https://www.typescriptlang.org/docs/handbook/2/indexed-access-types.html
- Conditional Types (Handbook) - https://www.typescriptlang.org/docs/handbook/2/conditional-types.html
- Mapped Types (Handbook) - https://www.typescriptlang.org/docs/handbook/2/mapped-types.html
- Template Literal Types (Handbook) - https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html
- Utility Types (Handbook) - https://www.typescriptlang.org/docs/handbook/utility-types.html
- Modules Reference (Handbook) - https://www.typescriptlang.org/docs/handbook/modules/reference.html
- ESM/CJS Interoperability (Handbook) - https://www.typescriptlang.org/docs/handbook/modules/appendices/esm-cjs-interop.html
- Choosing Compiler Options (Modules guide) - https://www.typescriptlang.org/docs/handbook/modules/guides/choosing-compiler-options.html
- JSX (Handbook) - https://www.typescriptlang.org/docs/handbook/jsx.html
- Decorators (Handbook) - https://www.typescriptlang.org/docs/handbook/decorators.html
- Triple-slash Directives (Handbook) - https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html
- Module Resolution (Handbook) - https://www.typescriptlang.org/docs/handbook/module-resolution.html
- Project References (Handbook) - https://www.typescriptlang.org/docs/handbook/project-references.html
- Declaration Files: By Example - https://www.typescriptlang.org/docs/handbook/declaration-files/by-example.html
- Declaration Files Template: Global .d.ts - https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-d-ts.html
- Declaration Files Template: Module .d.ts - https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-d-ts.html
- Declaration Merging (Handbook) - https://www.typescriptlang.org/docs/handbook/declaration-merging.html
- Namespaces (Handbook) - https://www.typescriptlang.org/docs/handbook/namespaces.html
- Type Checking JavaScript Files (Handbook) - https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html
- Advanced Types (Legacy Handbook) - https://www.typescriptlang.org/docs/handbook/advanced-types.html
- tsc CLI Options (Handbook) - https://www.typescriptlang.org/docs/handbook/compiler-options.html
- TSConfig Reference (Index) - https://www.typescriptlang.org/tsconfig/
- TSConfig: strict - https://www.typescriptlang.org/tsconfig/strict.html
- TSConfig: strictNullChecks - https://www.typescriptlang.org/tsconfig/strictNullChecks.html
- TSConfig: noImplicitAny - https://www.typescriptlang.org/tsconfig/noImplicitAny.html
- TSConfig: noImplicitOverride - https://www.typescriptlang.org/tsconfig/noImplicitOverride.html
- TSConfig: exactOptionalPropertyTypes - https://www.typescriptlang.org/tsconfig/exactOptionalPropertyTypes.html
- TSConfig: useUnknownInCatchVariables - https://www.typescriptlang.org/tsconfig/useUnknownInCatchVariables.html
- TSConfig: target - https://www.typescriptlang.org/tsconfig/target.html
- TSConfig: lib - https://www.typescriptlang.org/tsconfig/lib.html
- TSConfig: module - https://www.typescriptlang.org/tsconfig/module.html
- TSConfig: moduleResolution - https://www.typescriptlang.org/tsconfig/moduleResolution.html
- TSConfig: jsxImportSource - https://www.typescriptlang.org/tsconfig/jsxImportSource.html
- TSConfig: verbatimModuleSyntax - https://www.typescriptlang.org/tsconfig/verbatimModuleSyntax.html
- TSConfig: esModuleInterop - https://www.typescriptlang.org/tsconfig/esModuleInterop.html
- TSConfig: allowSyntheticDefaultImports - https://www.typescriptlang.org/tsconfig/allowSyntheticDefaultImports.html
- TSConfig: skipLibCheck - https://www.typescriptlang.org/tsconfig/skipLibCheck.html
- TSConfig: resolveJsonModule - https://www.typescriptlang.org/tsconfig/resolveJsonModule.html
- TSConfig: isolatedModules - https://www.typescriptlang.org/tsconfig/isolatedModules.html
- TSConfig: isolatedDeclarations - https://www.typescriptlang.org/tsconfig/isolatedDeclarations.html
- TSConfig: composite - https://www.typescriptlang.org/tsconfig/composite.html
- TSConfig: declaration - https://www.typescriptlang.org/tsconfig/declaration.html
- TSConfig: noEmit - https://www.typescriptlang.org/tsconfig/noEmit.html
- TSConfig: incremental - https://www.typescriptlang.org/tsconfig/incremental.html
- TSConfig: experimentalDecorators - https://www.typescriptlang.org/tsconfig/experimentalDecorators.html
- Recursive Type References (TypeScript Playground example) - https://www.typescriptlang.org/play/3-7/types-and-code-flow/recursive-type-references.ts.html
- Import attributes — MDN Web Docs - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/with
- Static initialization blocks — MDN Web Docs - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks
Release Notes (TypeScript)
- TypeScript 2.0 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html
- TypeScript 2.8 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html
- TypeScript 3.4 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html
- TypeScript 3.7 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html
- TypeScript 4.1 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html
- TypeScript 4.3 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-3.html
- TypeScript 4.4 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html
- TypeScript 4.7 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html
- TypeScript 4.9 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html
- TypeScript 5.0 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html
- TypeScript 5.2 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html
- TypeScript 5.3 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-3.html
- TypeScript 5.4 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-4.html
- TypeScript 5.5 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html
- TypeScript 5.7 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-7.html
- TypeScript 5.8 Release Notes - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-8.html
Microsoft & TypeScript Team Blogs
- Announcing TypeScript 4.9 - https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/
- Announcing TypeScript 5.0 - https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/
- Announcing TypeScript 5.2 Beta - https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/
- Announcing TypeScript 5.4 - https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/
- Announcing TypeScript 5.5 - https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/
- Announcing TypeScript 5.8 - https://devblogs.microsoft.com/typescript/announcing-typescript-5-8/
Technical Blogs & Tutorials
- Types vs. interfaces in TypeScript (LogRocket) - https://blog.logrocket.com/types-vs-interfaces-typescript/
- How to use type guards in TypeScript (LogRocket) - https://blog.logrocket.com/how-to-use-type-guards-typescript/
- Guide to conditional types in TypeScript (LogRocket) - https://blog.logrocket.com/guide-conditional-types-typescript/
- Using built-in utility types in TypeScript (LogRocket) - https://blog.logrocket.com/using-built-in-utility-types-typescript/
- Implementing function overloading in TypeScript (LogRocket) - https://blog.logrocket.com/implementing-function-overloading-typescript/
- A complete guide to const assertions in TypeScript (LogRocket) - https://blog.logrocket.com/complete-guide-const-assertions-typescript/
- Understanding the exclamation mark (non-null assertion) in TypeScript (LogRocket) - https://blog.logrocket.com/understanding-exclamation-mark-typescript/
- TypeScript enums: Usage, advantages, and best practices (LogRocket) - https://blog.logrocket.com/typescript-enum/
- How to use the keyof operator in TypeScript (LogRocket) - https://blog.logrocket.com/how-to-use-keyof-operator-typescript/
- Assertion functions in TypeScript (LogRocket) - https://blog.logrocket.com/assertion-functions-typescript/
- TypeScript discriminated union and intersection types (LogRocket) - https://blog.logrocket.com/understanding-discriminated-union-intersection-types-typescript/
- A practical guide to TypeScript decorators (LogRocket) - https://blog.logrocket.com/practical-guide-typescript-decorators/
- Resource management in TypeScript with the using keyword (LogRocket) - https://blog.logrocket.com/resource-management-typescript-using-keyword/
- How to use import attributes in TypeScript and JavaScript (LogRocket) - https://blog.logrocket.com/import-attributes-typescript-javascript/
- TypeScript project references (LogRocket) - https://blog.logrocket.com/boost-your-productivity-with-typescript-project-references/
- TypeScript Utility Types Guide (Cam McHenry) - https://camchenry.com/blog/typescript-utility-types
- TypeScript Utility Types You Need to Know (Builder.io) - https://www.builder.io/blog/utility-types
- Better Configuration in TypeScript with the satisfies Operator (Builder.io) - https://www.builder.io/blog/satisfies-operator
- Index Signatures in TypeScript (Dmitri Pavlutin) - https://dmitripavlutin.com/typescript-index-signatures/
- Covariance and Contravariance in TypeScript (Dmitri Pavlutin) - https://dmitripavlutin.com/typescript-covariance-contravariance/
- NoInfer: TypeScript 5.4's New Utility Type (Total TypeScript) - https://www.totaltypescript.com/noinfer
- Type Predicate Inference: The TS 5.5 Feature (Total TypeScript) - https://www.totaltypescript.com/type-predicate-inference
- TypeScript 5.0 Beta Deep Dive (Total TypeScript) - https://www.totaltypescript.com/tips/typescript-5-0-beta-deep-dive
- The moduleResolution Option in tsconfig.json (Total TypeScript) - https://www.totaltypescript.com/workshops/typescript-pro-essentials/configuring-typescript/the-moduleresolution-option-in-tsconfigjson
- TypeScript 5.5: A Blockbuster Release (Effective TypeScript) - https://effectivetypescript.com/2024/07/02/ts-55/
- The Making of a TypeScript Feature: Inferring Type Predicates (Effective TypeScript) - https://effectivetypescript.com/2024/04/16/inferring-a-type-predicate/
- TypeScript Index Signatures (Better Stack) - https://betterstack.com/community/guides/scaling-nodejs/typescript-index-signatures/
- TypeScript Enums (Better Stack) - https://betterstack.com/community/guides/scaling-nodejs/typescript-enums/
- Mapped Types in TypeScript (Better Stack) - https://betterstack.com/community/guides/scaling-nodejs/mapped-types/
- verbatimModuleSyntax Explained (Better Stack) - https://betterstack.com/community/guides/scaling-nodejs/ts-verbatimmodulesyntax/
- Understanding TypeScript Type Guards (Better Stack) - https://betterstack.com/community/guides/scaling-nodejs/typescript-type-guards/
- Understanding TypeScript Type Assertions (Better Stack) - https://betterstack.com/community/guides/scaling-nodejs/type-assertions/
- The --strict Compiler Option in TypeScript (Marius Schulz) - https://mariusschulz.com/blog/the-strict-compiler-option-in-typescript
- Conditional Types in TypeScript (Marius Schulz) - https://mariusschulz.com/blog/conditional-types-in-typescript
- Assertion Functions in TypeScript (Marius Schulz) - https://mariusschulz.com/blog/assertion-functions-in-typescript
- String Manipulation Types in TypeScript 4.x (DEV) - https://dev.to/43081j/string-manipulation-types-in-typescript-4-x-556e
- TypeScript 4.9: satisfies operator (DEV) - https://dev.to/ayc0/typescript-49-satisfies-operator-1e4i
- TypeScript Stage 3 Decorators: A Journey (DEV) - https://dev.to/baliachbryan/typescript-stage-3-decorators-a-journey-through-setup-and-usage-5f00
- Advanced Type Features in TypeScript 5.x (DEV) - https://dev.to/serifcolakel/advanced-type-features-in-typescript-5x-conditional-mapped-and-utility-types-1p5
- Introducing TypeScript override keyword (DEV) - https://dev.to/lioness100/introducing-typescript-override-keyword-4b36
- Node.js, TypeScript and ESM (DEV) - https://dev.to/a0viedo/nodejs-typescript-and-esm-it-doesnt-have-to-be-painful-438e
- Unlocking Type Safety: Type Guards in TypeScript (DEV) - https://dev.to/vjnvisakh/unlocking-type-safety-a-deep-dive-into-type-guards-in-typescript-46kn
- How to overload functions in TypeScript (DEV) - https://dev.to/zirkelc/how-to-overload-functions-in-typescript-22c3
- Mastering Enums in TypeScript (DEV) - https://dev.to/vjnvisakh/mastering-enums-in-typescript-a-comprehensive-guide-4945
- The power of const assertions (Dominik D. / tkdodo.eu) - https://tkdodo.eu/blog/the-power-of-const-assertions
- TypeScript
asassertion vssatisfiesoperator guide (Medium) - https://medium.com/@mohsentaleb/typescript-as-assertion-vs-satisfies-operator-complete-guide-with-examples-11af314cadfb - Writing Recursive Types That TypeScript Accepts (Medium) - https://medium.com/@AlexanderObregon/writing-recursive-types-that-typescript-accepts-8e805f206c78
- How to Use TypeScript Template Literal Types Like a Pro (Medium) - https://medium.com/javascript-in-plain-english/how-to-use-typescript-template-literal-types-like-a-pro-2e02a7db0bac
- Working with Function Overloads in TypeScript (Medium) - https://medium.com/@AlexanderObregon/working-with-function-overloads-in-typescript-1a2e21d2325f
- TypeScript Mapped Types Explained (Medium) - https://medium.com/@AlexanderObregon/writing-mapped-types-in-typescript-without-getting-in-your-own-way-07590a1226d1
- What Happens When You Use Generics in TypeScript Functions (Medium) - https://medium.com/@AlexanderObregon/what-happens-when-you-use-generics-in-typescript-functions-df5c23085da0
- tsconfig.json demystified (Medium) - https://medium.com/extra-credit-by-guild/tsconfig-json-demystified-d8f333e578c1
- ECMAScript explicit resource management in TypeScript 5.2 (Medium) - https://medium.com/@bagherani/ecmascript-explicit-resource-management-early-implementation-in-typescript-5-2-5e4d08b2aee3
- TypeScript 5.0 — The New Features (Medium) - https://medium.com/rewrite-tech/typescript-5-0-the-new-features-and-the-issues-they-solve-49757530e760
- A note on TypeScript non-null assertion operator (Medium) - https://medium.com/@tar.viturawong/a-note-on-typescript-non-null-assertion-operator-bad8fbe62bba
- Type Narrowing in TypeScript (Medium) - https://medium.com/@dewandameena1098/type-narrowing-in-typescript-a-simple-guide-1e5bcb6a1319
- Explicit Resource Management with TypeScript and Postgres (blog.r0b.io) - https://blog.r0b.io/post/using-explicit-resource-management-with-typescript-and-postgres/
- TypeScript Isolated Declarations: Speeding up the ecosystem (marvinh.dev) - https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-10/
- Node's new built-in support for TypeScript (2ality) - https://2ality.com/2025/01/nodejs-strip-type.html
- ECMAScript feature: import attributes (2ality) - https://2ality.com/2025/01/import-attributes.html
- Template literal types in TypeScript (2ality) - https://2ality.com/2025/01/template-literal-types.html
- TypeScript 5.7 & 5.8 Features (javascript-conference.com) - https://javascript-conference.com/blog/typescript-5-7-5-8-features-ecmascript-direct-execution/
- TypeScript 5.0: const modifier on type parameters (Xebia) - https://xebia.com/blog/typescript-5-0-and-the-new-const-modifier-on-type-parameters/
- TypeScript Decorators (Refine) - https://refine.dev/blog/typescript-decorators/
- Using TypeScript Decorators in Practice (Bits and Pieces) - https://blog.bitsrc.io/using-typescript-decorators-in-practise-d09cc1c0f8f4
- Dev 101: TypeScript 5.0+ Decorators (Unstacked Newsletter) - https://newsletter.unstacked.dev/p/dev-101-typescript-50-decorators
- Covariant, Contravariant, and Invariant in TypeScript (sandromaglione.com) - https://www.sandromaglione.com/articles/covariant-contravariant-and-invariant-in-typescript
- How to Create Variance Annotations in TypeScript (OneUptime Blog) - https://oneuptime.com/blog/post/typescript-variance-annotations/view
- How to benefit from const assertion in TypeScript (Kontent.ai) - https://kontent.ai/blog/how-to-benefit-from-const-assertion-in-your-typescript-code/
- How to Use TypeScript Satisfies Operator (Tao of React) - https://www.taoreact.com/typescript-satisfies/
- TypeScript Cheatsheet (Joshua's Docs) - https://docs.joshuatz.com/cheatsheets/typescript/
- typescript-eslint: consistent-type-imports rule - https://typescript-eslint.io/rules/consistent-type-imports
- typescript-eslint: consistent-type-assertions rule - https://typescript-eslint.io/rules/consistent-type-assertions/
GitHub Repositories, Issues & Discussions
- microsoft/TypeScript — main repository - https://github.com/microsoft/TypeScript
- TypeScript-Handbook source - https://github.com/microsoft/TypeScript-Handbook
- TypeScript issue: Import Attributes Stage 3 support - https://github.com/microsoft/TypeScript/issues/53656
- TypeScript issue: Variance annotation (in/out) - https://github.com/microsoft/TypeScript/issues/10717
- TypeScript issue: Isolated Declarations — state of the feature - https://github.com/microsoft/TypeScript/issues/58944
- TypeScript issue: Circular recursive types in conditional/mapped type world - https://github.com/microsoft/TypeScript/issues/23400
- TypeScript issue: Non-null assertion operator documentation - https://github.com/microsoft/TypeScript/issues/11494
- TypeScript issue: esModuleInterop / allowSyntheticDefaultImports clarification - https://github.com/microsoft/TypeScript/issues/62529
- ts-essentials: Essential TypeScript utility types - https://github.com/ts-essentials/ts-essentials
- type-fest: A collection of essential TypeScript types (Sindre Sorhus) - https://github.com/sindresorhus/type-fest
- ts-toolbelt: Higher type safety in TypeScript - https://github.com/millsp/ts-toolbelt
- next.js discussion: Support TypeScript satisfies operator - https://github.com/vercel/next.js/discussions/40895
- SvelteKit issue: moduleResolution bundler/node16/nodenext - https://github.com/sveltejs/kit/issues/9007
- esbuild: TypeScript project reference incremental build discussion - https://github.com/evanw/esbuild/issues/1250
- TC39 proposal: Explicit Resource Management (using/await using) - https://github.com/tc39/proposal-explicit-resource-management
- TC39 proposal: Import Attributes - https://github.com/tc39/proposal-import-attributes
- TC39 proposal: Stage 3 Decorators - https://github.com/tc39/proposal-decorators
Community Q&A (Stack Overflow)
- TypeScript function overloading — Stack Overflow - https://stackoverflow.com/questions/13212625/typescript-function-overloading
- Understanding target and module in tsconfig — Stack Overflow - https://stackoverflow.com/questions/41993811/understanding-target-and-module-in-tsconfig
- Do I need allowSyntheticDefaultImports if esModuleInterop is true? — Stack Overflow - https://stackoverflow.com/questions/52576203/do-i-ever-need-explicit-allowsyntheticdefaultimports-if-esmoduleinterop-is-true
- What does "as const" mean in TypeScript? — Stack Overflow - https://stackoverflow.com/questions/66993264/what-does-the-as-const-mean-in-typescript-and-what-is-its-use-case
- Can anyone clarify the TypeScript handbook explanation for keyof? — Stack Overflow - https://stackoverflow.com/questions/69450452/can-anyone-clarify-this-typescript-handbook-explanation-for-keyof-please
- Rules for the use of angle brackets in TypeScript — Stack Overflow - https://stackoverflow.com/questions/37358364/rules-for-the-use-of-angle-brackets-in-typescript
- Difference between type and interface in TypeScript — Stack Overflow - https://stackoverflow.com/questions/37233735/interfaces-vs-types-in-typescript
- TypeScript: difference between unknown and any — Stack Overflow - https://stackoverflow.com/questions/51439843/unknown-vs-any-in-typescript
- When to use never and unknown in TypeScript — Stack Overflow - https://stackoverflow.com/questions/51439843/unknown-vs-any-in-typescript
- How does infer work in TypeScript? — Stack Overflow - https://stackoverflow.com/questions/60067100/why-is-the-infer-keyword-needed-in-typescript
Video Resources
- TypeScript Full Course for Beginners (freeCodeCamp — YouTube) - https://www.youtube.com/watch?v=30LWjhZzg50
- TypeScript Course for Beginners — Learn TypeScript from Scratch (Academind — YouTube) - https://www.youtube.com/watch?v=BwuLxPH8IDs
- You are a Junior Dev if You Don't Know These 18 TypeScript Utility Types (YouTube) - https://www.youtube.com/watch?v=BhNSauna0eo
- TypeScript 5.0 BETA IS HERE (YouTube) - https://www.youtube.com/watch?v=iOTAFRFgm8I
- 5 NEW Features in TypeScript 5.5 (YouTube) - https://www.youtube.com/watch?v=0iX4SK-jbhE
- Inferred Type Predicates: TypeScript 5.5's Top New Feature (YouTube) - https://www.youtube.com/watch?v=LTuzl2r2HjA
- TypeScript 5.2 —
usingDeclarations and Explicit Resource Management (YouTube) - https://www.youtube.com/watch?v=kDmpuiGZkLI - TypeScript Got a New Utility Type — NoInfer (YouTube) - https://www.youtube.com/watch?v=O6VbrLR6ro8
- Disposable in TypeScript: Explicit Resource Management (YouTube) - https://www.youtube.com/watch?v=ytptTeBr0I8