# TypeScript Level 14: Advanced Type Design

> Level 14: Advanced Type Design of the LoWisa TypeScript course: Type-Level Programming, API and Library Type Architecture, Balancing Type Safety and Complexity. 3 lessons and 9 ideas, each explained in one line.

Advanced Type Design is level 14 of 16 of the [LoWisa TypeScript course](/courses/typescript/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Type-Level Programming

- **Types as functions.** Generic conditional types are **functions** over types: inputs, branching, recursion, all at compile time.
- **Recursive types.** A **recursive** type walks nested structures: DeepReadonly visits every property of every child.
- **Know the limits.** The checker has depth and complexity **limits**: a type that times out the compiler is a design smell.

## API and Library Type Architecture

- **Inference-first APIs.** The best APIs need no type arguments: design so **inference** carries the caller the whole way.
- **Builder and fluent typing.** A typed **builder** accumulates knowledge step by step, refusing build() until the required parts exist.
- **Overload surfaces.** Public libraries shape ergonomics with careful **overloads**: precise returns for each documented call shape.

## Balancing Type Safety and Complexity

- **The cleverness budget.** Every team has a type **cleverness** budget: spend it where bugs are expensive, not where it is fun.
- **Escape hatches, labelled.** A justified cast is honest when **commented**: the assumption named, dated and owned.
- **Optimise for the reader.** The winning type design is the one a tired colleague **reads** correctly at review speed.

## Before and after this level

- **Before:** [Level 13: Testing & Refactoring](/courses/typescript/level-13-testing-and-refactoring/): Testing Typed Code, Type-Safe Refactoring, Maintaining Large TypeScript Codebases.
- **Next:** [Level 15: Production TypeScript](/courses/typescript/level-15-production-typescript/): Build Performance and Tooling, JavaScript Interoperability, Production Architecture and Reliability.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does TypeScript Level 14: Advanced Type Design cover?

Type-Level Programming, API and Library Type Architecture, Balancing Type Safety and Complexity: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 13: Testing & Refactoring, which covers Testing Typed Code, Type-Safe Refactoring, Maintaining Large TypeScript Codebases.

## Learn TypeScript on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/typescript/level-14-advanced-type-design/ · Updated 2026-11-16
