Reputation: 2747
Given this:
type params = Parameters<(x: string, y:number)=>void>
In the pseudo code below how does one make fn
to be (x: string, y:number)=>void
, but using the params
type?
type fn = (...params)=>void // type should be (x: string, y:number)=>void
Upvotes: 1
Views: 3105
Reputation: 215117
type fn = (...p: params)=>void
should work. Type the rest parameter with type params
.
Upvotes: 2