mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-24 11:29:30 +08:00
added _(...).bindKey def
This commit is contained in:
@@ -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'
|
||||
};
|
||||
|
||||
Vendored
+16
@@ -1922,6 +1922,13 @@ declare module _ {
|
||||
object: any,
|
||||
...methodNames: string[]): any;
|
||||
|
||||
interface LoDashWrapper<T> {
|
||||
/**
|
||||
* @see _.bindAll
|
||||
**/
|
||||
bindAll(...methodNames: string[]): LoDashWrapper<any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<T> {
|
||||
/**
|
||||
* @see _.bindKey
|
||||
**/
|
||||
bindKey(
|
||||
key: string,
|
||||
...args: any[]): LoDashWrapper<Function>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
||||
Reference in New Issue
Block a user