General 2,917 installs

typescript-advanced-types

by wshobson/agents

Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe…

Skill content

Advanced TypeScript type system patterns for building type-safe, reusable components and utilities.

- Covers five core concepts: generics with constraints, conditional types with inference, mapped types for property transformation, template literal types for string patterns, and built-in utility types

- Includes six advanced patterns: type-safe event emitters, API clients, builder patterns, deep readonly/partial, form validation, and discriminated unions for robust type narrowing

- Demonstrates type inference techniques using the infer keyword, type guards, and assertion functions for compile-time safety

- Provides best practices including strict mode configuration, type testing strategies, and guidance on avoiding common pitfalls like circular references and over-complex types

TypeScript Advanced Types

Comprehensive guidance for mastering TypeScript's advanced type system including generics, conditional types, mapped types, template literal types, and utility types for building robust, type-safe applications.

When to Use This Skill

- Building type-safe libraries or frameworks

- Creating reusable generic components

- Implementing complex type inference logic

- Designing type-safe API clients

- Building form validation systems

- Creating strongly-typed configuration objects

- Implementing type-safe state management

- Migrating JavaScript codebases to TypeScript

Core Concepts

1. Generics