diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 9e5f7b35a..cb4e14436 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -446,6 +446,9 @@ var view = { view = _.bindAll(view); jQuery('#docs').on('click', view.onClick); +view = _(view).bindAll().value(); +jQuery('#docs').on('click', view.onClick); + var objectBindKey = { 'name': 'moe', 'greet': function(greeting) { @@ -453,7 +456,7 @@ var objectBindKey = { } }; -var funcBindKey: Function = _.bindKey(object, 'greet', 'hi'); +var funcBindKey: Function = _.bindKey(objectBindKey, 'greet', 'hi'); funcBindKey(); objectBindKey.greet = function(greeting) { @@ -462,6 +465,9 @@ objectBindKey.greet = function(greeting) { funcBindKey(); +funcBindKey = _(objectBindKey).bindKey('greet', 'hi').value(); +funcBindKey(); + var realNameMap = { 'curly': 'jerome' }; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 278e267bd..e4a75c5c2 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1922,6 +1922,13 @@ declare module _ { object: any, ...methodNames: string[]): any; + interface LoDashWrapper { + /** + * @see _.bindAll + **/ + bindAll(...methodNames: string[]): LoDashWrapper; + } + /** * Creates a function that, when called, invokes the method at object[key] and prepends any * additional bindKey arguments to those provided to the bound function. This method differs @@ -1937,6 +1944,15 @@ declare module _ { key: string, ...args: any[]): Function; + interface LoDashWrapper { + /** + * @see _.bindKey + **/ + bindKey( + key: string, + ...args: any[]): LoDashWrapper; + } + /** * Creates a function that is the composition of the provided functions, where each function * consumes the return value of the function that follows. For example, composing the functions