Welcome to my TypeScript learning and reference repository! This project is a structured, step-by-step codebase designed to master TypeScript fundamentals, advanced type mechanics, and modern software design patterns for writing scalable, type-safe applications.
- Strict Type Safety: Moving from loosely-typed JavaScript to highly secure, compile-time checked architectures.
- Advanced Type Engineering: Harnessing generics, union/intersection types, and built-in utility types.
- Object-Oriented Programming (OOP): Implementing clean classes, interfaces, abstract classes, and access modifiers.
- Modern Tooling: Configuring compiler settings (
tsconfig.json) for strictly enforced code quality.
The folders are organized sequentially to track my progress from foundational syntax to advanced structural design:
01-ts-basic-types– Working with primitives, arrays, tuples, enums, and explicit typing.02-ts-functions– Typed parameters, return statements, optional arguments, and arrow functions.03-ts-interfaces– Defining object shapes, optional properties, read-only modifiers, and extending interfaces.04-ts-classes– Object-oriented structures usingpublic,private,protectedaccessors and inheritance.05-ts-generics– Building highly flexible, reusable components, constraints, and generic interfaces.06-ts-advanced-types– Type guards, type assertions, intersection/union types, and literal types.07-ts-utility-types– Leveraging built-in utilities likePartial,Readonly,Pick,Omit, andRecord.08-ts-modules-config– Understanding compilation behaviors, strict mode rules, and modular imports/exports.
- Language: TypeScript
- Runtime Environment: Node.js
- Compiler Execution:
tsc(TypeScript Compiler) /ts-node(Direct execution)
To explore these practices or run the TypeScript scripts locally on your machine, follow these steps:
git clone https://github.com
cd YOUR_REPOSITORY_NAMEnpm installTo compile a specific TypeScript file into standard JavaScript:
npx tsc 01-ts-basic-types/index.tsAlternatively, to execute a TypeScript file directly without manually compiling it first:
npx ts-node 01-ts-basic-types/index.tsnoImplicitAny: trueenabled to force explicit or context-inferred data structures.strictNullChecks: trueenabled to proactively catch runtime reference errors.- Zero use of the
anykeyword to maximize compilation-level safety.
This project is open-source and available under the MIT License.