Skip to content

Repository files navigation

TypeScript: Basic to Advanced 🔷

A structured TypeScript learning repository — 10 topic folders, each with real code examples, theory notes, and interview prep questions. Built for JavaScript developers making the jump to TypeScript.

No course platform, no paywall. Clone it, open a folder, read the instructions.txt, run the code. Each topic is self-contained so you can work through it linearly or jump to what you need.


Table of Contents


Who This Is For

  • JavaScript developers moving to TypeScript and needing a structured path
  • Intermediate devs who know the basics but want to solidify generics, utility types, and advanced patterns
  • Students preparing for TypeScript interview questions

One prerequisite: a working understanding of JavaScript (ES6+). Everything TypeScript-specific is explained from scratch.


Topics Covered

FolderTopicWhat You'll Learn
01_introIntroduction & SetupWhat TypeScript is, installing the compiler, tsconfig.json basics
02_BasicsFundamental Typesnumber, string, boolean, type annotations, type inference
ArrayArrays & ConfigTyped arrays, tsconfig options, strict mode
TypeAliasesType AliasesDefining reusable custom types with type
Readonly_optionalReadonly & Optionalreadonly modifier, optional properties (?) in types and interfaces
TuplesTuplesTuple types vs arrays, fixed-length typed sequences, advanced usage
anyVsUnkownany vs unknownWhen to use each, type narrowing, why unknown is safer
unionAndIntersectionUnion & Intersection`
interfaceInterfacesObject shapes, implementing interfaces in classes, interface inheritance vs type
classesClassesOOP in TypeScript — constructors, access modifiers, inheritance
GenericsGenericsGeneric functions and classes, constraints, real-world use cases

Each folder contains:

  • instructions.txt — theory, explanations, and interview-style questions
  • TypeScript source files — working code examples you can run and modify

How to Use

1. Clone the repo

git clone https://github.com/Wcoder547/typeScript.git
cd typeScript

2. Install TypeScript

npm install -g typescript

3. Navigate to any topic folder and compile

cd 01_intro
tsc index.ts
node index.js

Recommended Learning Order

01_intro → 02_Basics → Array → TypeAliases → Readonly_optional
→ Tuples → anyVsUnkown → unionAndIntersection → interface → classes → Generics

Generics last — they make a lot more sense once you've seen interfaces and classes first.


Prerequisites

  • Node.js installed (nodejs.org)
  • Basic JavaScript (ES6+) — arrow functions, destructuring, classes, modules

Contributing

Corrections, improvements, and new examples are welcome.

  1. Fork the repository
  2. Create a branch: git checkout -b fix/your-fix
  3. Commit and push your changes
  4. Open a Pull Request with a short description

About

This repo came from learning TypeScript properly — not just adding : string to variables, but understanding the type system: why unknown exists, when generics actually help, how interfaces and type aliases differ in practice, and how TypeScript's structural typing works.

Each folder is the result of working through a concept until it clicked, then writing it down in a way that would have helped me earlier.

Built by Waseem Akram — Full-Stack Developer and DevOps Engineer based in Pakistan, working across the MERN stack, Generative AI integrations, and cloud automation.


If this helped you, consider giving it a ⭐

About

Structured TypeScript learning repo — 10 topic folders covering basics to generics, interfaces, classes & advanced types. Each folder has working code + theory notes + interview questions.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages