TypeScript
Guides in TypeScript. Written like documentation — short paragraphs, real examples, interview-relevant depth.
Type Narrowing
intermediateHow TypeScript refines types through control flow — predicates, discriminants, and patterns that keep strict mode honest.
intermediate
TypeScript for JavaScript Engineers
beginnerA practical on-ramp: what TS adds to JS, strict mode basics, gradual migration, and the frontend patterns that matter first.
beginner
Basic Types and Annotations
beginnerPrimitives, arrays, objects, and function annotations TypeScript actually checks — plus where inference is enough and where it is not.
beginner
Typing React Props
beginnerType component props with required/optional fields, children, unions for variants, and HTML attribute extension patterns.
beginner
Interfaces vs Type Aliases
beginnerWhen to use interface vs type in TypeScript — extension, unions, declaration merging, and a practical default for frontend apps.
beginner
Union and Intersection Types
beginnerCombine types with | and & — model alternatives, mixins, and why unions need narrowing while intersections require all members.
beginner
Typing React Events
intermediateCorrect event types for onClick, onChange, forms, and keyboard handlers in React TypeScript — synthetic events and target narrowing.
intermediate
Literal Types
beginnerString, number, and boolean literal types — model fixed variants, narrow with equality, and combine with unions for safe UI props.
beginner
Type Guards typeof and instanceof
beginnerBuilt-in typeof and instanceof narrowing, custom type predicates, and how guards differ from assertions in TypeScript.
beginner
Discriminated Unions for UI State
intermediateModel loading, success, and error as mutually exclusive variants so TypeScript and your UI cannot show impossible states.
intermediate
Generics Basics
intermediateType parameters for functions, components, and data structures — constraints, inference, and the mistakes that produce any-shaped APIs.
intermediate
Generic Constraints
intermediateLimit type parameters with extends so generics stay flexible but can safely use properties like id, length, or keyof T.
intermediate
keyof typeof and Indexed Access
intermediateDerive keys and value types from objects with keyof, typeof, and T[K] — the toolkit behind typed forms, configs, and safe property access.
intermediate
Utility Types Partial Pick Omit
beginnerUse Partial, Required, Pick, Omit, and Record to reshape props and DTOs without rewriting object types by hand.
beginner
Readonly and const Assertions
intermediateFreeze intent with readonly, Readonly<T>, and as const — keep literal types, prevent accidental mutation, and type config objects correctly.
intermediate
Enums vs Union Types
intermediateWhen TypeScript enums help, when they hurt, and why string literal unions plus const objects win for most frontend code.
intermediate
Function Overloads
advancedDeclare multiple call signatures so one implementation returns different types based on arguments — without lying with unions everywhere.
advanced
Tuple Types
intermediateFixed-length arrays with per-position types — useState pairs, CSV rows, rest parameters, and labeled tuples in TypeScript.
intermediate
unknown vs any
beginnerWhy unknown is the type-safe top type, how to narrow it, and when any is a deliberate escape hatch — not a default.
beginner
tsconfig Strict Flags
intermediateWhat strict mode actually enables, flag-by-flag impact on frontend code, and a practical migration order for legacy apps.
intermediate
Non-null Assertion Operator
intermediateWhat value! means in TypeScript, when non-null assertions are justified, and safer patterns that keep strictNullChecks honest.
intermediate
Type Assertions Safely
intermediateWhen as Type is justified, why double assertions are a smell, and how to replace casts with narrowing, guards, and validation.
intermediate
Typing fetch Responses
intermediateType HTTP JSON safely — Response generics myths, unknown + schema parse, error unions, and React Query-friendly patterns.
intermediate
Generics in React Components
advancedType props that depend on item shape — lists, selects, and tables — with generic components, inference pitfalls, and TSX syntax quirks.
advanced
Runtime Validation with Schemas
intermediateTypeScript types erase at runtime — validate JSON and form input with Zod (or similar) so parsed data is actually typed and safe.
intermediate
satisfies Operator
intermediateCheck a value against a type while keeping the narrow inferred type — config objects, route maps, and as const without losing literals.
intermediate
Template Literal Types
advancedBuild string types with `on${Event}`, extract route params, and type CSS-like APIs using TypeScript template literal types.
advanced
Conditional Types Intro
advancedT extends U ? X : Y — how TypeScript picks types from conditions, distributes over unions, and powers utility types you already use.
advanced
Mapped Types Intro
advancedTransform every property of a type with {[K in keyof T]: …} — the engine behind Partial, Readonly, Pick patterns, and typed form bags.
advanced
Declaration Files and DefinitelyTyped
intermediateHow .d.ts files describe JS to TypeScript, when to use @types packages, module augmentation, and writing minimal ambient types for untyped libs.
intermediate
Path Aliases and Tooling Sync
intermediateKeep tsconfig paths, bundler aliases, Vitest, and ESLint in sync so @/ imports resolve everywhere — not just in the IDE.
intermediate
infer Keyword Basics
advancedUse infer inside conditional types to extract return types, promise payloads, array elements, and function parameters.
advanced
Branded Types for IDs
advancedNominal-style UserId vs OrderId in TypeScript — prevent ID mixups at compile time with brands, parsers, and form boundaries.
advanced
Record and Partial patterns for Forms
intermediateType form values, errors, touched flags, and dirty maps with Record, Partial, and keyof so field names stay in sync.
intermediate
Narrowing with in Operator
beginnerUse the in operator to narrow unions by property presence — object shapes, optional fields, and when in is the wrong tool.
beginner
never Type and Exhaustiveness
intermediateWhat never means, how exhaustive switches use it, and why unreachable code and empty unions show up in TypeScript errors.
intermediate