mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _(...).createCallback def
This commit is contained in:
@@ -504,8 +504,11 @@ result = <Function>_.compose(greet, format);
|
||||
result = <_.LoDashWrapper<Function>>_(greet).compose(format);
|
||||
|
||||
var createCallbackObj = { name: 'Joe' };
|
||||
var pluckCallback: () => any = _.createCallback('name');
|
||||
var whereCallback: () => boolean = _.createCallback(createCallbackObj);
|
||||
result = <() => any>_.createCallback('name');
|
||||
result = <() => boolean>_.createCallback(createCallbackObj);
|
||||
result = <_.LoDashWrapper<() => any>>_('name').createCallback();
|
||||
result = <_.LoDashWrapper<() => boolean>>_(createCallbackObj).createCallback();
|
||||
|
||||
|
||||
var curried: Function = _.curry(function(a, b, c) {
|
||||
console.log(a + b + c);
|
||||
|
||||
Vendored
+9
@@ -2058,6 +2058,15 @@ declare module _ {
|
||||
thisArg?: any,
|
||||
argCount?: number): () => boolean;
|
||||
|
||||
interface LoDashWrapper<T> {
|
||||
/**
|
||||
* @see _.createCallback
|
||||
**/
|
||||
createCallback(
|
||||
thisArg?: any,
|
||||
argCount?: number): LoDashWrapper<() => any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function which accepts one or more arguments of func that when invoked either
|
||||
* executes func returning its result, if all func arguments have been provided, or returns
|
||||
|
||||
Reference in New Issue
Block a user