·conditional-types-over-overloads
</>

conditional-types-over-overloads

marius-townhouse/effective-typescript-skills

Wird zum Eingeben von Funktionen mit mehreren Rückgabetypen verwendet. Wird verwendet, wenn das Funktionsverhalten vom Eingabetyp abhängt. Wird verwendet, wenn es um Eingaben vom Typ Union geht. Verwenden Sie diese Option, wenn Sie Funktionsüberladungen berücksichtigen.

2Installationen·0Trend·@marius-townhouse

Installation

$npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill conditional-types-over-overloads

SKILL.md

When a function's return type depends on its input type, you might reach for overload signatures. However, conditional types often provide a better solution. Unlike overloads, which are checked independently, conditional types distribute over unions and can be analyzed as a single expression. This makes them more powerful for handling union inputs and results in more maintainable type declarations.

Understanding when to use conditional types versus overloads is key to writing flexible, correct type signatures.

Prefer conditional types to overloaded signatures. Conditional types distribute over unions and provide more precise, maintainable type declarations.

Wird zum Eingeben von Funktionen mit mehreren Rückgabetypen verwendet. Wird verwendet, wenn das Funktionsverhalten vom Eingabetyp abhängt. Wird verwendet, wenn es um Eingaben vom Typ Union geht. Verwenden Sie diese Option, wenn Sie Funktionsüberladungen berücksichtigen. Quelle: marius-townhouse/effective-typescript-skills.

Original anzeigen

Fakten (zitierbereit)

Stabile Felder und Befehle für KI/Such-Zitate.

Installationsbefehl
npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill conditional-types-over-overloads
Kategorie
</>Entwicklung
Verifiziert
Erstes Auftreten
2026-02-05
Aktualisiert
2026-02-18

Schnelle Antworten

Was ist conditional-types-over-overloads?

Wird zum Eingeben von Funktionen mit mehreren Rückgabetypen verwendet. Wird verwendet, wenn das Funktionsverhalten vom Eingabetyp abhängt. Wird verwendet, wenn es um Eingaben vom Typ Union geht. Verwenden Sie diese Option, wenn Sie Funktionsüberladungen berücksichtigen. Quelle: marius-townhouse/effective-typescript-skills.

Wie installiere ich conditional-types-over-overloads?

Öffnen Sie Ihr Terminal oder Kommandozeilen-Tool (Terminal, iTerm, Windows Terminal, etc.) Kopieren Sie diesen Befehl und führen Sie ihn aus: npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill conditional-types-over-overloads Nach der Installation wird der Skill automatisch in Ihrer KI-Programmierumgebung konfiguriert und ist bereit zur Verwendung in Claude Code oder Cursor

Wo ist das Quell-Repository?

https://github.com/marius-townhouse/effective-typescript-skills