TypeScript: Varargs Overload Signatures

Nicholas Jamieson
3 min readDec 3, 2020
Photo by Matt Artz on Unsplash

I thought I’d write up a short post to explain a TypeScript problem that took up far too much of my time.

The TL;DR is that if you have overload signatures for a function that takes a variable number of (initial) arguments, the ordering of the signatures matters in a way that is not obvious. And the ‘simplest’ signature should be placed first.

--

--

Nicholas Jamieson

RxJS core team member; front-end developer; mentor; speaker; open-source contributor