Shop Viral Mens Fashion Now
Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows.
$19.99
Get Fast, Free Shipping with Amazon Prime
FREE delivery Wednesday, July 1 on orders shipped by Amazon over $35
Or Prime members get FREE delivery Tomorrow, June 27. Join Prime
In Stock
$$19.99 () Includes selected options. Includes initial monthly payment and selected options. Details
Price
Subtotal
$$19.99
Subtotal
Initial payment breakdown
Shipping cost, delivery date, and order total (including tax) shown at checkout.
Shipper / Seller
Amazon.com
Amazon.com
Shipper / Seller
Amazon.com
Returns
30-day refund / replacement
30-day refund / replacement
Quick refund
Usually issued within 24 hours. See exceptions
Shipping fee
May apply, not eligible for free return. See details
Convenient dropoff
At any of our 50,000 US locations.
See return policy
Gift options
Available at checkout
Available at checkout This item is a gift. Change
At checkout, you can add a custom message, a gift receipt for easy returns and have the item gift-wrapped
Payment
Secure transaction
Your transaction is secure
We work hard to protect your security and privacy. Our payment security system encrypts your information during transmission. We don’t share your credit card details with third-party sellers, and we don’t sell your information to others. Learn more
Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

  • The TypeScript Type System: From Generics to DSL-Level Types (The TypeScript Library)

Follow the author

Get new release updates & improved recommendations
Something went wrong. Please try your request again later.

The TypeScript Type System: From Generics to DSL-Level Types (The TypeScript Library)


{"desktop_buybox_group_1":[{"displayPrice":"$19.99","priceAmount":19.99,"currencySymbol":"$","integerValue":"19","decimalSeparator":".","fractionalValue":"99","symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"op1pOGVLEwN%2FbDzpPqz7P12Zd6n4J4M8Tk2tgWsLzoKHfsg1gLWGja4b6mmB%2B6zgg17z%2FcpmkvJGLN%2B8aWuKp%2B4yB2egS3oYXvotnM66nAEp65u9zyj91f55n1fo4zDFzXJ8L5N1zf7HJ5cbMniBfg%3D%3D","locale":"en-US","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}]}

Purchase options and add-ons

TypeScript stopped being "JavaScript with annotations" several years ago. This book is the layer where the type system becomes a programming language in its own right.

The libraries that define the modern TypeScript ecosystem —
Zod, tRPC, Drizzle, Hono, Effect — rely on type-level mechanics most TypeScript users have never deliberately learned. Schemas become types. Routes become typed client SDKs. SQL queries become row shapes. To read those libraries fluently — let alone design your own — you have to wield the type system, not decorate code with it.

The TypeScript Type System is the deep dive. Twenty-five chapters, pinned to TypeScript 6.0, with every example runnable in the public companion repository at github.com/gabrielanhaia/the-typescript-library-examples.

What's inside:

Generics from first principles — type parameters, constraints, defaults, inference at the call site, satisfies vs annotation vs assertion, and const type parameters for preserving literal types.
Mapped and conditional types — the Pick/Omit/Partial/Readonly family, key remapping with as, distributive conditionals, and the [T] extends [U] trick to opt out.
keyof, typeof, indexed access — the three operators that turn values into types and types into other types.
infer and template literal types — pulling types out of other types, parsing strings at the type level, building DSLs the compiler can validate.
Recursive types — the recursion-depth limits, when to break out into helpers, JSON schemas as recursive types.
Branded (nominal) types — making UserId and OrderId distinct even though both are string underneath.
Variance and the bivariance footgun — covariance, contravariance, why strictFunctionTypes matters, and the method-vs-property gotcha that bites everyone once.
Type-level state machines — making illegal states unrepresentable, fluent builders the compiler enforces.
Error modeling with Result — errors as values, exhaustive matching, recovering from typed failures.
Type-driven library case studies — how Zod produces types from schemas, how tRPC produces a typed client from a router, how Hono RPC turns route definitions into a fully-typed fetch client.

Every example is
runnable and CI-verified. The companion repository pins TypeScript 6.0 and runs the same examples on Node 24, Bun 1.3, and Deno 2.7.

Who this book is for: TypeScript users who already write TS daily and want to wield the type system rather than decorate code with it. The reader knows what means at the call site and is ready to learn what it means at the definition site — and beyond.

The TypeScript Library (a five-book collection):
TypeScript Essentials (Book 1)
This bookThe TypeScript Type System: From Generics to DSL-Level Types (Book 2)
Kotlin and Java to TypeScript: A Bridge for JVM Developers (Book 3)
PHP to TypeScript: A Bridge for Modern PHP 8+ Developers (Book 4)
TypeScript in Production: Tooling, Build, and Library Authoring Across Runtimes (Book 5)

Landing page: xgabriel.com/the-typescript-library/
The%20Amazon%20Book%20Review
The Amazon Book Review
Book recommendations, author interviews, editors' picks, and more. Read it now.

Product details

About the author

Follow authors to get new release updates, plus improved recommendations.
Gabriel Anhaia
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

Gabriel Anhaia is a Senior Software Engineer and author with a passion for making complex technical concepts clear and practical. With over a decade of experience designing and scaling backend systems for fintechs, startups, and high-growth companies, he specializes in PHP, Go, microservices, and distributed architectures.

Customer reviews

There are 0 customer reviews.