conditional-types-over-overloads

Community

Prefer conditional types over overloads for returns.

Authorluyi985
Version1.0.0
Installs0

System Documentation

What problem does it solve?

When a function's return type depends on its input type, overloads often proliferate and become hard to maintain. Conditional types provide a single, powerful alternative that handles unions cleanly and simplifies type signatures.

Core Features & Use Cases

  • Reduces overload proliferation by using a single conditional signature.
  • Handles union input types and distributes over unions automatically.
  • Useful for type utilities and generic functions where return types hinge on inputs.

Quick Start

Define a generic function signature using a conditional type to map each input union member to its corresponding output.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: conditional-types-over-overloads
Download link: https://github.com/luyi985/lyi-bash/archive/main.zip#conditional-types-over-overloads

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.