mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Add definitions for _(...).groupBy
This commit is contained in:
@@ -380,6 +380,10 @@ result = <_.Dictionary<number[]>>_.groupBy([4.2, 6.1, 6.4], function(num) { retu
|
||||
result = <_.Dictionary<number[]>>_.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
|
||||
result = <_.Dictionary<string[]>>_.groupBy(['one', 'two', 'three'], 'length');
|
||||
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<number[]>>>_([4.2, 6.1, 6.4]).groupBy(function(num) { return Math.floor(num); });
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<number[]>>>_([4.2, 6.1, 6.4]).groupBy(function(num) { return this.floor(num); }, Math);
|
||||
result = <_.LoDashObjectWrapper<_.Dictionary<string[]>>>_(['one', 'two', 'three']).groupBy('length');
|
||||
|
||||
result = <_.Dictionary<IKey>>_.indexBy(keys, 'dir');
|
||||
result = <_.Dictionary<IKey>>_.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
|
||||
result = <_.Dictionary<IKey>>_.indexBy(keys, function(key) { this.fromCharCode(key.code); }, String);
|
||||
|
||||
Vendored
+21
@@ -1761,6 +1761,27 @@ declare module _ {
|
||||
whereValue: W): Dictionary<T[]>;
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper {
|
||||
/**
|
||||
* @see _.groupBy
|
||||
**/
|
||||
groupBy<T>(
|
||||
callback: ListIterator<T, any>,
|
||||
thisArg?: any): _.LoDashObjectWrapper<Dictionary<T[]>>;
|
||||
|
||||
/**
|
||||
* @see _.groupBy
|
||||
**/
|
||||
groupBy<T>(
|
||||
pluckValue: string): _.LoDashObjectWrapper<Dictionary<T[]>>;
|
||||
|
||||
/**
|
||||
* @see _.groupBy
|
||||
**/
|
||||
groupBy<W, T extends W>(
|
||||
whereValue: W): _.LoDashObjectWrapper<Dictionary<T[]>>;
|
||||
}
|
||||
|
||||
//_.indexBy
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user