This course guides you step by step through learning TypeScript, from installation to generics and utility types, including basic types, interfaces, functions, unions and classes. Each lesson combines explanation, concrete example and small hands-on exercise. Prerequisite: knowing the basics of JavaScript.
Introduction to TypeScript
Understand what TypeScript is, why it exists and what it brings to JavaScript.
Installation and Configuration
Install TypeScript with npm, compile a file and configure tsconfig.json.
Basic Types
string, number, boolean, type inference, any and unknown.
Arrays and Tuples
Type arrays, use tuples and protect data with readonly.
Objects and Interfaces
Describe the shape of an object with interfaces, optional properties and extends.
Functions
Type parameters and return values, default values, callbacks, void and never.
Unions and Narrowing
Combine types with |, narrow with typeof, literal types and discriminated unions.
Aliases, Intersections and Enums
type, &, enum, as const and type assertions: name and combine your types.
Classes
Typed properties, access modifiers, inheritance and implements.
Generics
Write reusable code that keeps type safety, with T and extends.
Utility Types
Partial, Pick, Omit, Readonly, Record, keyof and typeof to derive types.
Modules, Libraries and the DOM
import / export, @types packages, typing the DOM and API data.