COURSE / REAL PRACTICE
TypeScript foundations
Add explicit contracts to JavaScript, narrow unknown data and migrate the existing JSON report CLI with real compiler diagnostics and runtime checks.
Read the explanation and diagrams, then work through the practice. Your browser profile supplies your saved progress.
What you’ll work toward
Compile a tested TypeScript version of the existing JSONL job-report tool, preserve its streams/exit codes and compare its output with the JavaScript baseline. Exercise actual negative type checks and runtime validation separately.
Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.
Before you start
This course builds on these skills:
Individual lessons can add prerequisites. Your lesson progress shows your actual readiness.
A look inside the first lesson
Add annotations without changing the runtime contract
Practice directly with the supplied editor and exercise fixtures in the first lesson.
Your lesson sequence
Follow the same units and lessons in either view. Prerequisite links and your practice progress stay with each lesson.
Contracts and typed structures
- LESSON 01.01
Add annotations without changing the runtime contract
Use inferred local values and explicit function boundaries; preserve finite nonnegative duration behavior.
Open lesson - LESSON 01.02
Model objects, arrays and optional properties
Keep readonly inputs, fresh output objects and the distinction between an absent label and an empty string.
Open lesson - LESSON 01.03
Narrow unknown with discriminated unions
Use a runtime test to produce a tagged decision, then let control-flow analysis narrow each branch.
Open lesson
External data and reusable tooling
- LESSON 02.01
Validate external data at runtime
Treat parsed JSON as unknown and construct a canonical Job only after checking its actual fields.
Open lesson - LESSON 02.02
Write a small generic and use a local compiler
Keep input/output type relationships with a generic mapping helper and verify real strict compiler diagnostics.
Open lesson