mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
lodash: changed _.runInContext() method
This commit is contained in:
@@ -1768,9 +1768,6 @@ result = <void>_<string>([]).noop(true, 'a', 1);
|
||||
result = <void>_({}).noop(true, 'a', 1);
|
||||
result = <void>_(any).noop(true, 'a', 1);
|
||||
|
||||
var tempObject = {};
|
||||
result = <typeof _>_.runInContext(tempObject);
|
||||
|
||||
// _.property
|
||||
interface TestPropertyObject {
|
||||
a: {
|
||||
@@ -2084,6 +2081,14 @@ result = <number>(_(TestMethodOfObject).methodOf<number>(1, 2).value())(['a', '0
|
||||
result = _({}).noConflict();
|
||||
}
|
||||
|
||||
// _.runInContext
|
||||
{
|
||||
let result: typeof _;
|
||||
result = _.runInContext();
|
||||
result = _.runInContext({});
|
||||
result = _({}).runInContext();
|
||||
}
|
||||
|
||||
// _.uniqueId
|
||||
result = <string>_.uniqueId();
|
||||
result = <string>_.uniqueId('');
|
||||
|
||||
Vendored
+13
-5
@@ -8552,11 +8552,19 @@ declare module _ {
|
||||
//_.runInContext
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Create a new lodash function using the given context object.
|
||||
* @param context The context object
|
||||
* @returns The lodash function.
|
||||
**/
|
||||
runInContext(context: any): typeof _;
|
||||
* Create a new pristine lodash function using the given context object.
|
||||
*
|
||||
* @param context The context object.
|
||||
* @return Returns a new lodash function.
|
||||
*/
|
||||
runInContext(context?: Object): typeof _;
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.runInContext
|
||||
*/
|
||||
runInContext(): typeof _;
|
||||
}
|
||||
|
||||
//_.times
|
||||
|
||||
Reference in New Issue
Block a user