THE ANSWER IS IN THE TYPE.

type Answer<Q> =
  Q extends () => infer R
    ? R
    : "It depends";

IT
DEPENDS

TypeScript Principles, Debated

ELIRAZ KEDMI

Ask a senior developer any question about TypeScript, and you’ll get the same answer: ‘It depends.’ This book is about what it depends on.

A team of developers. Thirty arguments. Working code that puts their opinions to the test. From any versus unknown to reviewing AI-generated code, follow the debate as a neat rule meets a stubborn caller, a failing test or a requirement nobody mentioned. Sometimes the team reaches a verdict. Sometimes they still disagree. Either way, you see what changed their minds—and what didn’t.

Start reading: Chapter 1Paperback coming soon

Free to read online. Every example is checked against TypeScript 7.0.2.

How the arguments unfold

01

The Principle

A rule you can test, stated up front.

02

The Debate

The team argues it over working code.

03

The Turn

An example changes the conversation.

04

The Verdict / Debate Continues

A ruling—or a disagreement that remains.

05

Additional Takes

Other voices, costs and conditions.

Contents