Type Parameters
- S extends Record<M, BindableFunction<S, A, any[], any>>
- M extends PropertyKey
- A extends unknown[]
- R extends any
Parameters
- self: S
- method_name: M
Rest
...args: A
Returns ((...args: S[M] extends BindableFunction<S, A, B, R>
? B
: never) => R)
a version of the function method_name
that is now bound to the object self
, with the default first few partial arguments args
binds a class-prototype-method (by name
method_name
) to the passed objectself
(which should be an instance of the class), and returns that bound method.Example
example with assigned default arguments