← CodeClarityLab Home
Browse by Category
+ added · updated 7d
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Diagram: Covariance & Contravariance Covariance & Contravariance 4.7
Variance describes how subtype relationships on a type's components affect subtype relationships on the whole type — covariant types follow the direction, contravariant types reverse it.
4w ago typescript advanced
Diagram: Module Augmentation & Declaration Merging Module Augmentation & Declaration Merging 2.0
Module augmentation lets you extend third-party or global type definitions without modifying their source — adding properties to existing interfaces, modules, or the global scope.
4w ago typescript advanced
Diagram: Recursive Types Recursive Types 3.7
Types that reference themselves to describe arbitrarily nested structures — trees, nested menus, JSON, linked lists — without requiring any escape hatch.
4w ago typescript advanced
Branded / Opaque Types in TypeScript
A technique to make structurally identical types incompatible — a UserId and an OrderId are both strings, but branding makes them distinct types so passing an OrderId where UserId is expected is a compile-time error.
2mo ago typescript advanced
infer Keyword in Conditional Types 2.8
The infer keyword inside conditional types lets TypeScript extract and name a type from within a generic structure — enabling ReturnType<T>, Awaited<T>, and custom type extraction.
2mo ago typescript advanced
using & await using (TS 5.2 Explicit Resource Management) 5.2
TypeScript 5.2 using keyword automatically disposes resources (DB connections, file handles) when they go out of scope — like C# using or Python with.
2mo ago typescript advanced
Template Literal Types 4.1
TypeScript template literal types combine string literals with type interpolation — type EventName = `on${Capitalize<string>}` — enabling precise string-pattern type constraints.
2mo ago typescript advanced
Conditional Types & infer 2.8
Types that choose between two types based on a condition — T extends U ? X : Y — enabling type-level branching. The infer keyword extracts types from within a conditional.
2mo ago typescript advanced
Mapped Types & Template Literal Types 2.1
Mapped types transform existing types by iterating over their keys. Template literal types create string union types from combinations — together they enable powerful type-level transformations.
2mo ago typescript advanced
TypeScript Declaration Files (.d.ts) 2.0
Type-only files describing JavaScript code shapes — DefinitelyTyped (@types/* packages) provides community-maintained declarations for popular JS libraries.
2mo ago typescript advanced
TypeScript Decorators 4.0
Metadata annotations on classes, methods, and properties — used in NestJS, Angular, TypeORM, and class-validator to attach behaviour declaratively.
2mo ago typescript advanced
Diagram: TypeScript Generics TypeScript Generics 2.0
Type parameters that allow functions, classes, and interfaces to work with any type while preserving type information — the TypeScript equivalent of PHP templates or Java generics.
2mo ago typescript advanced
✓ schema.org compliant