Skip to content

Rekt-Dev/typescript-fundamentals

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript Fundamentals

Practical TypeScript reference covering the type system, advanced patterns, and real-world usage across different project contexts. Organized as runnable examples with inline commentary on non-obvious behavior.

Topics

Area Coverage
Core Types Primitives, arrays, tuples, enums, union/intersection types
Type Narrowing typeof, instanceof, discriminated unions, assertion functions
Generics Generic functions, classes, constraints, conditional types
Utility Types Partial, Required, Pick, Omit, Record, ReturnType, and more
Template Literals Mapped types, template literal types, infer keyword
Modules ES modules, declaration files, path aliases
Config tsconfig.json options, strict mode, project references
Patterns Builder pattern, factory functions, branded types, type guards

Structure

src/
├── basics/           # Core type system and primitives
├── generics/         # Generic patterns and constraints
├── utility-types/    # Built-in utility type examples
├── advanced/         # Conditional types, infer, mapped types
└── patterns/         # Real-world design patterns in TypeScript

Running Examples

npm install
npx ts-node src/<topic>/index.ts

Or compile and run:

npx tsc
node dist/<topic>/index.js

Prerequisites

  • Node.js 18+
  • TypeScript 5+

About

TypeScript fundamentals reference — type system, generics, utility types, and advanced patterns with runnable examples.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 94.0%
  • JavaScript 6.0%