mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Merge pull request #5794 from chrootsu/lodash-noConflict
lodash: changed _.noConflict() method
This commit is contained in:
@@ -1751,8 +1751,6 @@ var testAttempFn: TestAttemptFn;
|
||||
result = <TResult|Error>_.attempt<TResult>(testAttempFn);
|
||||
result = <TResult|Error>_(testAttempFn).attempt<TResult>();
|
||||
|
||||
var lodash = <typeof _>_.noConflict();
|
||||
|
||||
result = <number>_.random(0, 5);
|
||||
result = <number>_.random(5);
|
||||
result = <number>_.random(5, true);
|
||||
@@ -2077,6 +2075,15 @@ result = <number>(_(TestMethodOfObject).methodOf<number>(1, 2).value())(['a', '0
|
||||
result = _(testMixinSource).mixin<TResult>(testMixinOptions).value();
|
||||
}
|
||||
|
||||
// _.noConflict
|
||||
{
|
||||
let result: typeof _;
|
||||
result = _.noConflict();
|
||||
result = _(42).noConflict();
|
||||
result = _<any>([]).noConflict();
|
||||
result = _({}).noConflict();
|
||||
}
|
||||
|
||||
// _.uniqueId
|
||||
result = <string>_.uniqueId();
|
||||
result = <string>_.uniqueId('');
|
||||
|
||||
Vendored
+11
-3
@@ -8424,9 +8424,17 @@ declare module _ {
|
||||
//_.noConflict
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Reverts the '_' variable to its previous value and returns a reference to the lodash function.
|
||||
* @return The lodash function.
|
||||
**/
|
||||
* Reverts the _ variable to its previous value and returns a reference to the lodash function.
|
||||
*
|
||||
* @return Returns the lodash function.
|
||||
*/
|
||||
noConflict(): typeof _;
|
||||
}
|
||||
|
||||
interface LoDashWrapperBase<T, TWrapper> {
|
||||
/**
|
||||
* @see _.noConflict
|
||||
*/
|
||||
noConflict(): typeof _;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user