RecipesChapter 3: The Type System

Defining Nominal Types in a Structural Type System

Recipe 3.12 from The TypeScript Cookbook

// Hypothetical code, this does not work!
type Balance = unique number;
type AccountNumber = unique number;
Open in TypeScript Playground →