added _(...).bind defs

This commit is contained in:
Brian Zengel
2013-10-20 23:26:23 -04:00
parent 716b7f981c
commit 4b57cabc9f
2 changed files with 12 additions and 2 deletions
+3 -2
View File
@@ -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); }
+9
View File
@@ -1900,6 +1900,15 @@ declare module _ {
thisArg: any,
...args: any[]): () => any;
interface LoDashWrapper<T> {
/**
* @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