I would like to reference one function's parameter types in another function, but only use a subset of them.
//params of bar should be same as foo, except p1 should be a different type
function foo(p1: string, p2: number, p3: boolean){
...
}
//i'd like to do something like this, though it's obviously not valid syntax
function bar(p1: string[], ...rest: Parameters<typeof foo>.slice(1)){
}
Is there a way to do that? Obviously it's not hard to do manually with only 3 parameters, but in my actual code I have more parameters and I'd like to not repeat them.