04 / Guías
Guía de introducción a TypeScript
TypeScript Ramp-Up Guide
A compact guide for senior engineers who already build production systems in other languages and now need TypeScript quickly.
If you have shipped services in Rust, Go, Python, Java, or C#, the gap is not software engineering. Async, API design, architecture, testing, data modeling, and observability transfer directly. The gap is the TypeScript type system and its ecosystem, and that part is learnable in days, not months.
How to Use This Guide
Read the pages in order. You can skim anything that maps cleanly onto a language you know and slow down on the parts that do not. For each topic, aim to answer:
- What problem does this feature solve?
- What does idiomatic TypeScript prefer?
- Where does it differ from the languages I already know?
- Can I write a tiny example from memory?
What Is Genuinely New
For an experienced engineer, only a few things are actually new:
- TypeScript types are erased at runtime. The type system is a compile-time layer over JavaScript, not a runtime guarantee.
- The type system is structural, not nominal. Compatibility is based on shape, not declared inheritance.
- The type system is unusually expressive. Discriminated unions, generics, mapped types, and conditional types let you encode real constraints.
- The runtime is JavaScript, with single-threaded event-loop concurrency and one error model.
Everything else is ecosystem familiarity.
Recommended Path
Phase 1 — The Type System
- Mental Model: What TypeScript Is and Is Not
- The Type System Core
- Discriminated Unions and Exhaustiveness
- Generics and Constraints
- Mapped, Conditional, and Utility Types
- Narrowing: unknown, any, and Type Guards
Phase 2 — Language and Runtime
Phase 3 — Backend TypeScript
Phase 4 — Frontend TypeScript
Phase 5 — Ship and Interview
Fastest Practical Plan
A focused two-week sprint is enough to interview well if the rest of your portfolio is strong.
- Week 1: the type system. Work through phases 1 and 2 and write small examples until the syntax stops surprising you.
- Week 2: build one full-stack project end to end (phases 3 and 4) and wire up the tooling.
Default Target Stack
If you do not know where to start, aim for this combination:
TypeScript (strict) + Node.js + Hono + Drizzle ORM + PostgreSQL + Zod + Vitest, and React + TanStack Query and Router on the frontend.
It is modern, widely used, and maps cleanly onto patterns you already know from other backends.
Grounding
This is a ramp-up guide, not a replacement for the official documentation. The pure-TypeScript examples in this guide were type-checked under strict mode. For authoritative references and verification notes, see Grounding and References.
01 — Mental Model: What TypeScript Is and Is Not
TypeScript is a structural, erasable type layer over JavaScript. Understanding what survives to runtime is the single most important shift for an experienced engineer.
02 — The Type System Core
type aliases, interfaces, unions, intersections, literals, and the everyday vocabulary you use to describe data in TypeScript.
03 — Discriminated Unions and Exhaustiveness
Discriminated unions are how idiomatic TypeScript models state, results, and events, with the compiler enforcing that you handle every case.
04 — Generics and Constraints
Generics in TypeScript, constraints with extends, default type parameters, and how inference flows through generic functions.
05 — Mapped, Conditional, and Utility Types
The type-level toolkit: built-in utility types, how mapped types build them, and conditional types with infer for the cases the utilities do not cover.
06 — Narrowing: unknown, any, and Type Guards
How TypeScript narrows types through control flow, why unknown beats any, and how to write user-defined type guards and assertions.
07 — Async and Concurrency
Promises, async/await, the single-threaded event loop, structured concurrency with Promise combinators, and where worker threads fit.
08 — Modules, tsconfig, and the Build Story
ESM versus CommonJS, how TypeScript compiles, the tsconfig options that matter, and the modern runners that skip the build step in development.
09 — Backend Stack: Node, Hono or Fastify, Drizzle, Postgres
A modern TypeScript backend that maps onto patterns you already know: an HTTP framework, a typed query layer with Drizzle, and PostgreSQL.
10 — Validation at the Boundary with Zod
Because types are erased at runtime, you validate external input with a schema library. Zod is the common choice and bridges runtime checks back into types.
11 — Frontend: React and TanStack
React with TypeScript for backend engineers, the TanStack Query concepts interviewers probe, and how Router and Query integrate through loaders and a shared cache.
12 — Tooling and Testing
The everyday TypeScript toolchain: package managers, tsc as a gate, ESLint and Prettier, Vitest, and the lint rules that prevent the most common mistakes.
13 — Capstone Project and Interview Framing
One full-stack project that exercises the whole stack, plus how a senior engineer from another ecosystem should frame their TypeScript readiness.
14 — Grounding and References
Authoritative references used to ground the TypeScript Ramp-Up Guide, plus how the pure-TypeScript examples were verified.