variadic-tuple-types

Installation
SKILL.md

Use Rest Parameters and Tuple Types to Model Variadic Functions

Overview

Variadic functions - functions that accept a variable number of arguments - are common in JavaScript. TypeScript's tuple types and rest parameters let you type these precisely, preserving the number and types of arguments. This enables powerful patterns like typed function composition and generic pipelines.

Understanding how to combine rest parameters with tuple types unlocks precise typing for flexible APIs.

When to Use This Skill

  • Functions accept variable number of typed arguments
  • Need to preserve tuple length through transformations
  • Building generic function composition utilities
  • Typing rest parameters with specific constraints
  • Creating typed function pipelines

The Iron Rule

Use rest parameters with tuple types to precisely type variadic functions. Combine with generics to preserve argument types through transformations.

Related skills
Installs
9
GitHub Stars
2
First Seen
Feb 3, 2026