CSCosmos
TSViz
Concepts
Problems
Playground
GitHub
Toggle theme
Loading...
Learning Path
A step-by-step journey to TypeScript mastery.
Basics
Primitives & Basic Types
Understand the building blocks: string, number, boolean, and the 'any' trap.
Functions & Signatures
Learn how to type function arguments, return values, and callbacks.
Interfaces vs Types
The age-old debate. When to use which and how they differ.
Type Inference
Understand how TS guesses types.
Literal Types & Enums
Lock values to specific strings/numbers and compare with enums.
Tuples
Fixed-length arrays with positional meaning.
Safety Types: unknown, never, void, object
Safer alternatives to any and how to model impossible or empty values.
Intermediate
Unions & Intersections
Combine types to create powerful and flexible data structures.
Narrowing & Type Guards
Master control flow analysis to write safer code.
Assertions, Non-Null, satisfies
Direct the type checker safely when it cannot infer enough.
typeof, keyof, Indexed Access
Mirror runtime values in the type system for safer reuse.
Classes & OOP
Access modifiers, interfaces with classes, abstract classes.
Modules & Namespaces
Imports, exports, namespaces, and interop patterns.
Async/Await
Typing Promises and async functions.
tsconfig & Strict Mode
Key compiler flags that keep your codebase safe.
Advanced
Generics
Write reusable code that works with any data type.
Utility Types
Partial, Pick, Omit, and other built-in tools to transform types.
Mapped Types
Creating new types from existing ones (keyof, in).
Conditional Types
Logic within the type system.
Template Literal Types
String manipulation at the type level.
Ambient & Declaration Merging
Augment third-party types and describe globals safely.