thecodex.expert · The Codex Family of Knowledge
Track 2 — Practitioner

TypeScript: Practitioner

Five lessons to write real TypeScript — classes, generics, utility types, and tsconfig.

🕐 ~4 hours5 lessonsTypeScript 5.x

Lessons

Lesson 1

Classes with access modifiers

public, private, protected, readonly, abstract, shorthand constructor, and implements.

Prerequisite: Foundations track complete

What to look for:

  • The BankAccount example in the Exploring tab
  • Shorthand constructor: constructor(public readonly x: number)
  • private vs # (private field) — private is compile-time only
  • abstract class vs interface
🕑 45 min
Lesson 2

Generics and type constraints

Type parameters, extends constraints, keyof, generic interfaces, generic classes, and generic utility functions.

Prerequisite: Lesson 1 of Practitioner

What to look for:

  • The first example — T is inferred from the argument
  • Constraints: T extends { length: number }
  • keyof T and T[K] — safe property access
  • The Repository interface — generic contract pattern
🕑 60 min
Lesson 3

Utility types: Partial, Pick, Omit, Record

All the built-in utility types, when to use each, and how they are implemented with mapped types.

Prerequisite: Lesson 2 of Practitioner

What to look for:

  • Partial for update payloads, Required for full objects
  • Pick and Omit for API response shaping
  • Record for lookup tables and enums-as-objects
  • Exclude and Extract for union manipulation
🕑 45 min
Lesson 4

tsconfig and strict mode

The critical tsconfig settings, strict: true and what it enables, noUncheckedIndexedAccess, and moduleResolution.

Prerequisite: Lesson 3 of Practitioner

What to look for:

  • strict: true — not on by default, always enable
  • noUncheckedIndexedAccess — arr[0] is T | undefined
  • noImplicitReturns — all code paths must return
  • isolatedModules — needed for esbuild/Vite bundlers
🕑 30 min
Lesson 5

Declaration files and module types

.d.ts files, @types packages, declare module, and how TypeScript finds type definitions.

Prerequisite: Lesson 4 of Practitioner

What to look for:

  • @types/node, @types/react — install separately
  • declare module for augmenting library types
  • The Express Request augmentation example
  • typeRoots and types in tsconfig
🕑 30 min

How to use this track: Each lesson links to the Codex reference page. Use reading level tabs. Check "What to look for". Come back here for the quiz.

Track quiz

4 questions on the Practitioner track.

What does private in TypeScript actually enforce?

What does T extends { length: number } mean in a generic?

What does Partial produce?

Why should strict: true be in every tsconfig?

← Foundations trackAdvanced track →
#128311; TypeScript Snippets

14 copy-ready TypeScript patterns with live Try it buttons.

TS Snippets #8594;