TypeScript Tips 2: Branded Types

Joe Rackham
2 min readMay 9, 2023
Photo by Alexey Mak on Unsplash

Welcome to my series ‘TypeScript Tips’. I’m sharing some lesser-known language features, design patterns, and coding advice to make you more effective whilst working with TS.

What are branded types?

Branded types (also known as nominal types) are types you can construct from a base type that are distinct from that base type despite working the same:

--

--

Joe Rackham

Professional Software Engineer @ Microsoft - All opinions my own