mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
Expose _.shuffle() in chained array and object wrappers
This commit is contained in:
@@ -565,6 +565,8 @@ result = <number>_.sample([1, 2, 3, 4]);
|
||||
result = <number[]>_.sample([1, 2, 3, 4], 2);
|
||||
|
||||
result = <number[]>_.shuffle([1, 2, 3, 4, 5, 6]);
|
||||
result = <_.LoDashArrayWrapper<number>>_([1, 2, 3]).shuffle();
|
||||
result = <_.LoDashArrayWrapper<_.Dictionary<string>>>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).shuffle();
|
||||
|
||||
result = <number>_.size([1, 2]);
|
||||
result = <number>_.size({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
|
||||
14
lodash/lodash.d.ts
vendored
14
lodash/lodash.d.ts
vendored
@@ -4398,6 +4398,20 @@ declare module _ {
|
||||
shuffle<T>(collection: Dictionary<T>): T[];
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.shuffle
|
||||
**/
|
||||
shuffle(): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.shuffle
|
||||
**/
|
||||
shuffle(): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.size
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user