Is there a way to reference one function's parameter types in another function, but only use a subset of them without repeating the entire list of parameters?
//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)){
}
In my actual code, I have more than just 3 parameters and manually specifying them is not ideal. Any suggestions on how to achieve this efficiently?