//#region bind(): /** * 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. * @param thisArg The object to be used as the this object. * @param args Arguments to bind to the parameters of the function. */ declare function bind(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; declare function bind( this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0, ): (...args: A) => R; declare function bind( this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, ): (...args: A) => R; declare function bind( this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, ): (...args: A) => R; declare function bind( this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ): (...args: A) => R; declare function bind(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; declare function bind(this: T, thisArg: any): T; declare function bind( this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0, ): new (...args: A) => R; declare function bind( this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, ): new (...args: A) => R; declare function bind( this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, ): new (...args: A) => R; declare function bind( this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ): new (...args: A) => R; declare function bind(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; //#endregion declare namespace bind { //#region bind.call(): /** * Creates a bound function with the specified object as the this value and the specified rest arguments as the arguments. * @param thisArg The object to be used as the this object. * @param args Argument values to be passed to the function. */ // CallableFunction: function call(func: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; function call( func: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0, ): (...args: A) => R; function call( func: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, ): (...args: A) => R; function call( func: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, ): (...args: A) => R; function call( func: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ): (...args: A) => R; function call(func: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; // NewableFunction: function call(func: new (...args: A) => R, thisArg: unknown): new (...args: A) => R; function call( func: new (arg0: A0, ...args: A) => R, thisArg: unknown, arg0: A0, ): new (...args: A) => R; function call( func: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: unknown, arg0: A0, arg1: A1, ): new (...args: A) => R; function call( func: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: unknown, arg0: A0, arg1: A1, arg2: A2, ): new (...args: A) => R; function call( func: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: unknown, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ): new (...args: A) => R; function call(func: new (...args: AX[]) => R, thisArg: unknown, ...args: AX[]): new (...args: AX[]) => R; //#endregion //#region bind.apply(): /** * Creates a bound function with the specified object as the this value and the elements of specified array as the arguments. * @param thisArg The object to be used as the this object. * @param args An array of argument values to be passed to the function. */ // CallableFunction: function apply(func: (this: T, ...args: A) => R, args: [T]): (...args: A) => R; function apply( func: (this: T, arg0: A0, ...args: A) => R, args: [T, A0], ): (...args: A) => R; function apply( func: (this: T, arg0: A0, arg1: A1, ...args: A) => R, args: [T, A0, A1], ): (...args: A) => R; function apply( func: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, args: [T, A0, A1, A2], ): (...args: A) => R; function apply( func: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, args: [T, A0, A1, A2, A3], ): (...args: A) => R; function apply(func: (this: T, ...args: AX[]) => R, args: [T, ...AX[]]): (...args: AX[]) => R; // NewableFunction: function apply(func: new (...args: A) => R, args: [unknown]): new (...args: A) => R; function apply( func: new (arg0: A0, ...args: A) => R, args: [unknown, A0], ): new (...args: A) => R; function apply( func: new (arg0: A0, arg1: A1, ...args: A) => R, args: [unknown, A0, A1], ): new (...args: A) => R; function apply( func: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, args: [unknown, A0, A1, A2], ): new (...args: A) => R; function apply( func: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, args: [unknown, A0, A1, A2, A3], ): new (...args: A) => R; function apply(func: new (...args: AX[]) => R, args: [unknown, ...AX[]]): new (...args: AX[]) => R; //#endregion } export = bind;