diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 9b2cecdd6..9e5f7b35a 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -432,11 +432,12 @@ _.forEach(saves, function(type) { }); var funcBind = function (greeting) { return greeting + ' ' + this.name }; -// need a second var otherwise typescript thinks func signature is the above func type, -// instead of the newly returned _bind => func type. var funcBind2: () => any = _.bind(funcBind, { 'name': 'moe' }, 'hi'); funcBind2(); +var funcBind3: () => any = _(funcBind).bind({ 'name': 'moe' }, 'hi').value(); +funcBind3(); + var view = { 'label': 'docs', 'onClick': function() { console.log('clicked ' + this.label); } diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d641739fd..278e267bd 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1900,6 +1900,15 @@ declare module _ { thisArg: any, ...args: any[]): () => any; + interface LoDashWrapper { + /** + * @see _.bind + **/ + bind( + thisArg: any, + ...args: any[]): LoDashWrapper<() => any>; + } + /** * Binds methods of an object to the object itself, overwriting the existing method. Method * names may be specified as individual arguments or as arrays of method names. If no method