TypeScript Foundations
TypeScript Foundations picks up where Intermediate JavaScript left off. You can write modern, capable JavaScript. Now you will add the static type system that defines professional Angular, Node.js, and React development.
Every concept in this course is applied directly to AceIt — a browser-based trivia quiz app you build from scratch and ship as a complete, working app by the final module.
What you will learn
Section titled “What you will learn”- TypeScript basics — what the compiler does, how to install it, and how
tsconfig.jsoncontrols the build - Core types —
string,number,boolean, arrays, tuples, object types, union and intersection types, literal types, and enums - Interfaces and type aliases — named shapes for objects, optional and readonly properties, extending and composing types
- Functions and classes — typed parameters, return types, function type expressions, access modifiers, and readonly fields
- Generics — reusable typed functions and interfaces, constraints, and the most useful built-in utility types
- Type narrowing —
typeof,instanceof, theinoperator, discriminated unions, type predicates, and theunknowntype
Prerequisites
Section titled “Prerequisites”This course assumes you have completed Intermediate JavaScript or have equivalent knowledge. You should be comfortable with ES6 classes, ES modules, async/await, the Fetch API, and localStorage. No prior TypeScript experience is assumed.
The AceIt project
Section titled “The AceIt project”All seven modules build the same real application — AceIt, a browser-based trivia quiz powered by the Open Trivia DB API. You can play the finished app or browse the source on GitHub.
The finished app:
- Fetches live trivia questions from the Open Trivia DB API and models the response with typed interfaces
- Lets you choose difficulty and question count before each round
- Uses a
QuizEngineclass with typed properties, private fields, and static methods - Wraps
fetchin a genericfetchJson<T>function so the API response is fully typed - Uses a discriminated union to model quiz state (
idle,loading,active,done) - Persists your high score to localStorage and displays it on the start screen
By Module 07 you will wire all of these pieces together into a working, deployable app.
Modules
Section titled “Modules”01 — Getting Started with TypeScript
Section titled “01 — Getting Started with TypeScript”- What Is TypeScript and Why It Exists
- Installing TypeScript and the Compiler
- Your First TypeScript File
- Type Annotations and Type Inference
- tsconfig.json Basics
- Module Recap
02 — Core Types
Section titled “02 — Core Types”- Primitive Types: string, number, and boolean
- Arrays and Tuples
- Object Types
- Union and Intersection Types
- Literal Types and Enums
- Module Recap
03 — Interfaces and Type Aliases
Section titled “03 — Interfaces and Type Aliases”- Type Aliases
- Interfaces
- Optional and Readonly Properties
- Extending Interfaces and Intersecting Types
- Interface vs Type Alias — When to Use Each
- Module Recap
04 — Functions and Classes
Section titled “04 — Functions and Classes”- Typed Function Parameters and Return Types
- Optional, Default, and Rest Parameters
- Function Types and Callbacks
- Classes with Typed Properties
- Access Modifiers and Readonly
- Module Recap
05 — Generics
Section titled “05 — Generics”- What Generics Are and Why They Matter
- Generic Functions
- Generic Interfaces and Type Aliases
- Generic Constraints
- Utility Types: Partial, Pick, Omit, and Record
- Module Recap
06 — Type Narrowing
Section titled “06 — Type Narrowing”- typeof and instanceof Guards
- The in Operator and Property Checks
- Discriminated Unions
- Type Predicates
- unknown, any, and never
- Module Recap