TypeScript Handbook
Use types and narrowing to describe data clearly and catch mistakes before execution.
Where This Fits
Start with everyday types and narrowing after you can write small JavaScript programs. Describe a resource object and the different states of a request. Prefer types that express actual possibilities instead of forcing the compiler to accept an assumption.
Follow data from an external file into your program. TypeScript can help after a value is understood, but a type assertion does not inspect that value at runtime. Practice distinguishing compile-time confidence from checks that must run when data enters the application.
Before You Start
- JavaScript functions, arrays and objects
- A working local development environment
What to Focus On
- Object types and unions
- Control-flow narrowing
- Typed functions and modules
Put It into Practice
Model a resource request as loading, success or failure. Render each state deliberately, and validate imported JSON before treating it as your resource type.
Check Your Understanding
- Handle every declared state
- Explain why an assertion is not validation
- Avoid hiding unexplained errors with any
Access and Limits
The official handbook is free. Type checking does not enforce authorization, sanitize input or prove that an application behaves correctly.
Using It Offline
Read documentation online; an installed compiler and prepared local project can be used offline.
Follow the learning path
