A structured repository for my of learning TypeScript, from basic concepts to advanced techniques.
This repository contains a comprehensive set of examples, exercises, and mini-projects to help you learn TypeScript. The project is organized into different sections based on complexity levels, making it easy to progress through your learning journey.
- Node.js (v14 or later)
- npm (comes with Node.js)
-
Clone this repository:
git clone https://github.com/awanicaleb/typescript.git cd typescript -
Install dependencies:
npm install
-
Run the main example:
npm start
typescript/
├── src/
│ ├── basics/ # Basic TypeScript concepts
│ ├── intermediate/ # Intermediate concepts
│ ├── advanced/ # Advanced TypeScript features
│ ├── exercises/ # Practice exercises
│ ├── projects/ # Mini-projects
│ ├── utils/ # Utility functions
│ ├── tests/ # Test files
│ └── index.ts # Main entry point
├── dist/ # Compiled JavaScript files
├── node_modules/ # Node.js dependencies
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
├── .gitignore # Git ignore file
└── README.md # Project documentation
- Types (string, number, boolean, etc.)
- Arrays and tuples
- Interfaces
- Enums
- Type annotations
- Classes and inheritance
- Interfaces with advanced features
- Function types
- Type aliases
- Union and intersection types
- Generics
- Type guards
- Utility types
- Advanced type manipulation
- Decorators
- Practical exercises to test your knowledge
- Increasingly challenging problems
- Todo application
- Logging utility
- Type helpers
- Utility functions
npm start: Run the main index.ts file that demonstrates all examplesnpm run build: Compile TypeScript to JavaScriptnpm run dev: Run with live reload for developmentnpm run basics: Run basic TypeScript examplesnpm run intermediate: Run intermediate examplesnpm run advanced: Run advanced examples
-
Start with the Basics
- Understand TypeScript's type system
- Learn about interfaces and basic types
-
Move to Intermediate Concepts
- Explore classes and object-oriented programming
- Learn about more complex type features
-
Tackle Advanced Topics
- Master generics
- Understand advanced type manipulations
-
Complete the Exercises
- Reinforce your knowledge
- Practice type-safe coding
-
Build Projects
- Apply what you've learned in real-world scenarios
-
Understand JavaScript First: TypeScript is a superset of JavaScript, so having a solid understanding of JavaScript will help.
-
Use Type Annotations: Always try to specify types explicitly when learning. This helps you understand how the type system works.
-
Read the Error Messages: TypeScript's error messages are descriptive and often tell you exactly what's wrong.
-
Use the Official Documentation: The TypeScript Handbook is an excellent resource.
-
Practice Regularly: Consistent practice is key to mastering TypeScript.
- TypeScript Official Documentation
- TypeScript Deep Dive
- W3Schools TypeScript (Best for beginners)
- TypeScript Playground
- Effective TypeScript (Book)
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License - see the LICENSE file for details.
- TypeScript team for creating such an amazing language
- The open-source community for providing valuable resources