I have a possibly weird situation that I'm trying to model with typescript.
I have a bunch of functions with the following format
type State = { something: any }
type InitialFn = (state: State, ...args: string[]) => void
I would like to be able to create a type that represents InitialFn
with the first argument removed. Something like
// this doesn't work, as F is unused, and args doesn't correspond to the previous arguments
type PostTransformationFn<F extends InitialFn> = (...args: string[]) => void
Is this possible?
a=(b,c)=>{}; d=a.bind(null,6);
such that callingd(7)
,b
will always be6
andc
will be whatever the first passed arg tod
was 7 in this case. Not sure what the ts syntax would be for this