typed-typings / npm-ramda

TypeScript's type definitions for Ramda
MIT License
384 stars 64 forks source link

Arity limitation for R.compose's rightmost function? #452

Open NicoleRauch opened 3 years ago

NicoleRauch commented 3 years ago

I would like to apply @types/ramda to my project but I bumped into an error with R.compose. The documentation claims that

The last argument may have any arity

But looking at the provided typings, the maximum allowed arity is... 3?

I am aware of the comment in the typings:

// generic rest parameters in TS 3.0 allows writing a single variant for any number of Vx // compose<V extends any[], T1>(fn0: (...args: V) => T1): (...args: V) => T1; // compose<V extends any[], T1, T2>(fn1: (x: T1) => T2, fn0: (...args: V) => T1): (...args: V) => T2; // but requiring TS>=3.0 sounds like a breaking change, so just leaving a comment for the future

and I was wondering whether you could reconsider this issue, as TS 3.0 is maybe not such a breaking change any more after all...

(Also, if you make the move to TS 3.0, could I ask you to use unknown[] instead of any[] to make things more type-safe?)