Roadmap › 4. Frontend › Step 44
TS
TypeScript — Types, Generics and Real-World Patterns
Why TypeScript, basic and object types, interfaces vs type aliases, unions and narrowing, functions, classes, generics, utility types, mapped and conditional types, modules, tsconfig and strict mode, typing API calls for Angular/React, and the TypeScript interview questions.
Quick revision for interview day. Print it or save it as a PDF.
Core types
string number boolean bigint symbol · T[] / Array<T> · tuple [A, B] · unknown (safe) vs any (unsafe) · never · void · literal types "a" | "b" · as const.
Interface vs type
Interface: object contracts, extends, declaration merging. Type: unions, tuples, mapped/conditional types, & intersections.
Narrowing
typeof · instanceof · in · discriminant switch + never default · x is T guards · asserts x is T.
Utility types
Partial Required Readonly Pick Omit Record Exclude Extract NonNullable ReturnType Parameters Awaited.
Safety rules
strict: true · avoid any and as · unknown for external data · validate API responses (Zod) · generate types from OpenAPI · import type for type-only imports · tsc --noEmit in CI.