I would like to enforce that a particular function accepts a first argument of a particular type
type MyFunc = <Args extends []>(channelId: string, ...args: Args) => string
const doThing: MyFunc = (channelId: string, arg1: number, arg2: string) => arg1 + arg2
I get the following error
Type '(channelId: string, arg1: number, arg2: string) => string' is not assignable to type 'MyFunc'.
Types of parameters 'arg1' and 'args' are incompatible.
Type 'Args' is not assignable to type '[arg1: number, arg2: string]'.
Type '[]' is not assignable to type '[arg1: number, arg2: string]'.
Source has 0 element(s) but target requires 2.