Welcome to TypeScript Domination β your ultimate resource to master TypeScript from the ground up like a true engineer, hacker, or developer.
This repository follows a phase-wise roadmap, covering everything from beginner to advanced real-world TypeScript concepts. Whether you're coming from JavaScript or diving straight into TS, this guide is designed to build your knowledge incrementally and practically.
This repository is structured around a detailed, multi-phase roadmap for mastering TypeScript. Youβll not only learn syntax and theory but also real-world usage patterns, tooling, and integration with modern frameworks like React.
Each phase focuses on a core set of skills, building up your TypeScript expertise in a clean, organized, and hands-on manner.
The roadmap is divided into 5 Phases:
-
Introduction
- What is TypeScript?
- Why use TypeScript over JavaScript?
- TypeScript vs JavaScript
- Setting up a TypeScript Project (
tsc
,tsconfig.json
)
-
Basic Types
number
,string
,boolean
null
,undefined
,any
unknown
,never
,void
-
Type Inference & Annotation
- Explicit vs Implicit Typing
- Best Practices for Annotation
-
Variables & Constants
let
,const
with Type Annotations- Type safety and reassignment
-
Functions
- Function Types
- Optional & Default Parameters
- Rest Parameters
- Return Type Annotations
- Arrow functions with Types
-
Arrays & Tuples
- Typed Arrays (
number[]
,string[]
) - Generic Array Type:
Array<T>
- Tuples (
[string, number]
) - Readonly Arrays and Tuples
- Typed Arrays (
-
Objects
- Object Type Definitions
- Optional & Readonly Properties
- Index Signatures
-
Enums
- Numeric Enums
- String Enums
- Enum vs Union Types
-
Union & Intersection Types
type A = string | number
type B = {x: number} & {y: number}
-
Literal Types & Type Aliases
- String, Number, Boolean Literals
type Direction = 'left' | 'right' | 'center'
-
Type Narrowing
typeof
,instanceof
,in
operators- Custom Type Guards
- Discriminated Unions
-
Interfaces
- Creating & Extending Interfaces
- Interface vs Type
- Optional and Readonly Modifiers
-
Functions Advanced
- Function Overloads
this
parameter- Call Signatures in Types/Interfaces
-
Working with Classes
- Class syntax with Types
- Public / Private / Protected / Readonly
- Constructors & Property Initialization
- Inheritance and
implements
-
Generics
- Generic Functions
- Generic Interfaces & Classes
- Constraints with
<T extends>
- Default Generic Types
-
Utility Types
Partial
,Required
,Readonly
,Record
Pick
,Omit
,Exclude
,Extract
ReturnType
,Parameters
,InstanceType
-
Advanced Types
- Mapped Types
- Conditional Types (
T extends U ? X : Y
) - Template Literal Types
- Key Remapping with
as
-
Declaration Merging
- Interface Merging
- Module Augmentation
-
Modules & Namespaces
- ES modules in TS
import
/export
syntax- Ambient Declarations (
declare
)
-
Error Handling
- Typing
try
/catch
- Custom Error Classes
- Typing
-
Configuration
tsconfig.json
Optionsinclude
,exclude
,compilerOptions
strict
,target
,module
,lib
-
Working with npm & Modules
- Type Declarations Files (
.d.ts
) - Installing
@types
packages - Type definitions for 3rd-party libraries
- Type Declarations Files (
-
TypeScript with JavaScript
- Migration strategies
- JSDoc annotations to assist JS with TS
-
TypeScript + React
- Typing Functional Components
- Props & State with Interfaces
React.FC
vsVoidFunctionComponent
- Event Handlers with TS
- Using Generics in Components
- Typing
useRef
,useReducer
,useContext
-
Linting & Formatting
- ESLint for TypeScript (
@typescript-eslint
) - Prettier with TypeScript
- Rules for code quality
- ESLint for TypeScript (
-
Advanced Typing Techniques
- Type-level Programming
- Recursive Types
- Branded Types (opaque types)
- Polymorphic
this
types
-
Type Safety & Contracts
- Preventing
any
- Compile-time safety with proper constraints
- Avoiding overuse of
unknown
- Preventing
-
Monorepos & TypeScript
- Project References
- Composite Projects
- Managing Types across packages
-
Build & Deployment
- TypeScript with Webpack / Vite
- Type Checking in CI/CD
tsc
vs Babel with TS
-
Testing with TypeScript
- Writing Tests in Jest + TS
- Typing Mocks and Stubs
- Types for Unit & Integration Test
-
Patterns & Best Practices
- Domain-driven Types
- Avoiding Type Inference Pitfalls
- Favoring Composition over Inheritance
- Safe API Integration with
zod
/io-ts
TypeScript_Domination/
βββ phase-1-fundamentals/
βββ phase-2-intermediate/
βββ phase-3-advanced-types/
βββ phase-4-tooling/
βββ phase-5-expert/
βββ README.md
βββ tsconfig.json
If you'd like to contribute, fix typos, or add examples, feel free to submit a PR or open an issue.
- Author: ExploitEngineer
- Repo: TypeScript_Domination
This project is licensed under the MIT License.
βMastering TypeScript isn't just about knowing types β it's about writing safer, scalable, and smarter code.β