Menu

1 / 2

Template Literal Types Aren't Just for URLs

DEV Community·Gabriel Anhaia·6 months ago
#rEOvrZyp
#use#typescript#programming#webdev#type
Reading 0:00
15s threshold

Book: The TypeScript Type System — From Generics to DSL-Level Types

Also by me: The TypeScript Library — the 5-book collection

My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools

Me: xgabriel.com | GitHub

Open any post about template literal types from the last three years. The example is a router. /users/:id , parse it, get back { id: string } . Type-safe Express. Type-safe Hono. Type-safe tRPC. The pattern is real and the routers are good, but the demo has eaten the feature. People read those posts and walk away thinking template literals are a URL trick.

They are not. The router demo is the easiest example to make legible in a tutorial.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.