Posts tagged “generics”
6 posts found
TypeScript Recursive Types in 2026: Modeling JSON, Trees, and Deep Partial Without Hitting the Limit
July 23, 2026
Master recursive types to model JSON values, file systems, and nested data structures. Learn production patterns that avoid TypeScript's recursion depth limit while maintaining type safety.
TypeScript Generic Constraints in Depth: `extends`, `keyof`, and the Patterns That Prevent Runtime Errors
July 18, 2026
Master TypeScript generic constraints with extends and keyof to eliminate runtime errors. Learn the patterns production codebases rely on for type-safe property access and API design.
TypeScript Variadic Tuple Types: Composing Function Signatures and Middleware Pipelines
July 18, 2026
Master variadic tuple types to build type-safe function composition and middleware pipelines that preserve argument types through transformation chains.
TypeScript const Type Parameters: Immutable Inference and When It Beats as const
July 15, 2026
Most TypeScript type widening problems in generic functions stem from a single overlooked feature: const type parameters. Learn when they beat as const and how to combine them with satisfies for maximum type safety.
Strict Mode Isn't Enough: Using TypeScript's New Variance Annotations to Catch Subtle Generic Bugs
June 26, 2026
Most generic type bugs stem from variance issues that strict mode doesn't catch. TypeScript's new 'in' and 'out' annotations finally give developers explicit control over covariance and contravariance in generic parameters.
Generics in TypeScript
March 5, 2020
This post aims to go over generics in TypeScript and talk about what they are, how they work, and why we even need them.