Blog

Notes on data structures & algorithms, system design, and things I learn along the way.

Learning DSA? Follow the structured path — ordered articles from recursion to dynamic programming.→
October 18, 2026Recursive Types in TypeScript3 min read

Types that refer to themselves describe trees, JSON, nested configs and linked lists. How recursive type aliases and interfaces work, building DeepPartial and DeepReadonly, generating every dotted path through an object with template literals, and the compiler limits you'll hit.

#TypeScript
October 18, 2026tsconfig Flags Worth Turning On Beyond strict3 min read

strict: true is the baseline, but several useful checks live outside it. What noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitOverride, noImplicitReturns and noFallthroughCasesInSwitch catch — with the real compiler errors — and how to adopt them in an existing codebase.

#TypeScript
October 17, 2026Runtime Validation with Zod: Types That Survive the Network3 min read

TypeScript types disappear at runtime, so data from requests, APIs, storage and environment variables is unchecked until you check it. How a Zod schema validates that data, produces the TypeScript type, reports precise errors, and transforms input — and where in an app to put the checks.

#TypeScript
October 16, 2026TypeScript Decorators: The Standard Version3 min read

Decorators wrap or annotate classes and their members with a reusable function. How TypeScript 5's standard decorators work — what a method decorator receives and returns, evaluation order, addInitializer, decorator factories — and how they differ from the experimentalDecorators that Angular and NestJS were built on.

#TypeScript
October 16, 2026Function Overloads in TypeScript3 min read

One function, several call signatures, so the return type follows the argument type. How TypeScript resolves overloads top to bottom, why the implementation signature is invisible to callers, the union-argument trap, and when a generic or a conditional type is the better tool.

#TypeScript
October 16, 2026Covariance and Contravariance in TypeScript4 min read

If a Dog is an Animal, is a Dog[] an Animal[]? Is a function that handles Dogs a function that handles Animals? Variance answers these questions. What covariant, contravariant and invariant mean, where TypeScript deliberately allows unsafe code, and the in/out annotations that make it explicit.

#TypeScript
October 9, 2026Declaration Files (.d.ts): Giving JavaScript Code TypeScript Types3 min read

How TypeScript type-checks code that isn't written in TypeScript: declaration files describe the shape of JavaScript that lives elsewhere. Where they come from — libraries, DefinitelyTyped, your own builds — and how to write one for an untyped module or a global.

#TypeScript
October 7, 2026as const vs enum: Modelling Fixed Sets of Values in TypeScript3 min read

TypeScript widens literals by default and enums generate runtime code. How as const preserves exact values, how to derive a union type from one list, and why many teams now prefer const objects over enums.

#TypeScript
October 7, 2026Conditional Types and infer: If/Else for TypeScript Types3 min read

T extends U ? X : Y lets a type make decisions, and infer lets it pull pieces out of other types. How conditional types work, why they distribute over unions, and how ReturnType, Awaited and Exclude are built from them.

#TypeScript
October 7, 2026Template Literal Types: String Patterns the Compiler Understands3 min read

The same backtick syntax as template strings, but for types. How to generate every valid combination of a class name or event handler, type routes and IDs by their shape, rename keys in mapped types, and parse strings with infer.

#TypeScript

18 posts tagged TypeScript · page 1 of 2