mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-25 11:11:46 +08:00
Added chainable definitions for _(...).sortBy
This commit is contained in:
@@ -524,6 +524,10 @@ result = <number[]>_.sortBy([1, 2, 3], function (num) { return Math.sin(num); })
|
||||
result = <number[]>_.sortBy([1, 2, 3], function (num) { return this.sin(num); }, Math);
|
||||
result = <string[]>_.sortBy(['banana', 'strawberry', 'apple'], 'length');
|
||||
|
||||
result = <number[]>_([1, 2, 3]).sortBy(function (num) { return Math.sin(num); }).value();
|
||||
result = <number[]>_([1, 2, 3]).sortBy(function (num) { return this.sin(num); }, Math).value();
|
||||
result = <string[]>_(['banana', 'strawberry', 'apple']).sortBy('length').value();
|
||||
|
||||
(function (a: number, b: number, c: number, d: number) { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
|
||||
|
||||
result = <IStoogesCombined[]>_.where(stoogesCombined, { 'age': 40 });
|
||||
|
||||
Vendored
+21
@@ -4349,6 +4349,27 @@ declare module _ {
|
||||
whereValue: W): T[];
|
||||
}
|
||||
|
||||
interface LoDashArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.sortBy
|
||||
**/
|
||||
sortBy<TSort>(
|
||||
callback?: ListIterator<T, TSort>,
|
||||
thisArg?: any): LoDashArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortBy
|
||||
* @param pluckValue _.pluck style callback
|
||||
**/
|
||||
sortBy(pluckValue: string): LoDashArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.sortBy
|
||||
* @param whereValue _.where style callback
|
||||
**/
|
||||
sortBy<W>(whereValue: W): LoDashArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.toArray
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user