TypeScript quick reference

Runs in Zerethon IDE · TypeScript 7 Official TypeScript documentation ↗

TypeScript 7 in strict mode on Node.js 22: type annotations and inference, unions and narrowing, interfaces and generics, typed collections, async code, input and files — and how type-checking and running work in Zerethon IDE.

Written for TypeScript 7. Examples that show an output were run in the Zerethon sandbox (TypeScript 7) on 2026-10-20.

Basics

  • Hello, World

    The smallest TypeScript program: it is type-checked, compiled to JavaScript and run with Node.js.

  • Types, inference and unions

    Annotate variables, let TypeScript infer the rest, and combine types with unions and literal types.

  • Conditions, loops and narrowing

    if, switch, for…of and while, and how a check narrows a union type.

  • Functions

    Typed parameters and return values, optional and default parameters, and function types.

  • Interfaces, classes and generics

    Describe object shapes with interface and type, write classes, and reuse code for any type with generics.

Data

Input and files

In Zerethon IDE

  • Running TypeScript in Zerethon IDE

    How Run type-checks, compiles and runs your project, the time limit, input and tests.

  • Common errors

    The type errors you meet first (TS2304, TS2322, TS18048, TS7006, TS2339, TS2451) and run-time errors.

  • Official documentation

    Where to read more: the TypeScript Handbook, the TSConfig reference, and MDN / Node.js for the JavaScript underneath.

References