// This is necessary to disallow import of `call-bind/index` or `call-bind/index.js`: declare module "call-bind" { export = callBind; /** * For a given function, creates a bound function that has the same body as the original function. * The this object of the bound function is associated with the specified object, and has the specified initial parameters. * * Equivalent to: * ```js * Function.prototype.call.bind(target, ...) * ``` * * @param target The function to be used as the this object for `Function.prototype.call`. * @param args Arguments to bind to the parameters of the function. */ function callBind( target: (this: T, ...args: A) => R, ): (thisArg: T, ...args: A) => R; function callBind( target: (this: T, ...args: A) => R, thisArg: T, ): (...args: A) => R; function callBind( originalFunction: (this: T, ...args: readonly [...bound: AX, ...args: A]) => R, thisArg: T, ...bound: AX ): (...args: A) => R; namespace callBind { /** * For a given function, creates a bound function that has the same body as the original function. * The this object of the bound function is associated with the specified object, and has the specified initial parameters. * * Equivalent to: * ```js * Function.prototype.apply.bind(target, ...) * ``` * * @param target The function to be used as the this object for `Function.prototype.apply`. * @param args Arguments to bind to the parameters of the function. */ function apply( target: (this: T, ...args: A) => R, ): (thisArg: T, args: Readonly) => R; function apply( target: (this: T, ...args: A) => R, thisArg: T, ): (args: Readonly) => R; function apply( originalFunction: (this: T, ...args: readonly [...A1, ...A2]) => R, thisArg: T, ...args: A1 ): (args: Readonly) => R; } }