Setup
TypeScript is installed via npm. For quick experimentation, ts-node lets you run .ts files directly without a compile step.
Lessons
1
Hello, TypeScript!
TypeScript is a superset of JavaScript. Every .js file is valid TypeScript — you…
→
2
Basic Types
TypeScript has all JavaScript's types plus a few extras: tuples, enums, `unknown…
→
3
Interfaces & Type Aliases
Interfaces and type aliases both let you name a shape. The difference is subtle …
→
4
Typed Functions
Adding types to functions is where TypeScript pays off most immediately — your e…
→
5
Classes
TypeScript classes add access modifiers (`public`, `private`, `protected`, `read…
→
6
Generics
Generics let you write code that works with many types while staying type-safe. …
→
7
Utility Types
TypeScript ships a library of generic utility types that transform existing type…
→
8
Async TypeScript
TypeScript's async types are straightforward once you know the pattern: async fu…
→
9
Mini Project: Typed CLI Tool
Let's build a typed command-line tool that queries a public API. We'll use gener…
→
10
TypeScript Cheatsheet
The type system on one page — annotations, interfaces, generics, utility types.
→