mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Add most components of ListIteratee to Collection.orderBy (#35667)
[PropertyName, any] breaks contextual typing of ListIterator, so I left it out.
This commit is contained in:
+2
-2
@@ -1342,7 +1342,7 @@ declare module "../index" {
|
||||
/**
|
||||
* @see _.orderBy
|
||||
*/
|
||||
orderBy(iteratees?: Many<ListIterator<T, NotVoid>>, orders?: Many<boolean|"asc"|"desc">): Collection<T>;
|
||||
orderBy(iteratees?: Many<ListIterator<T, NotVoid> | PropertyName | PartialDeep<T>>, orders?: Many<boolean|"asc"|"desc">): Collection<T>;
|
||||
}
|
||||
interface Object<T> {
|
||||
/**
|
||||
@@ -1354,7 +1354,7 @@ declare module "../index" {
|
||||
/**
|
||||
* @see _.orderBy
|
||||
*/
|
||||
orderBy(iteratees?: Many<ListIterator<T, NotVoid>>, orders?: Many<boolean|"asc"|"desc">): CollectionChain<T>;
|
||||
orderBy(iteratees?: Many<ListIterator<T, NotVoid> | PropertyName | PartialDeep<T>>, orders?: Many<boolean|"asc"|"desc">): CollectionChain<T>;
|
||||
}
|
||||
interface ObjectChain<T> {
|
||||
/**
|
||||
|
||||
@@ -3161,7 +3161,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType CollectionChain<number>
|
||||
_.orderBy("acbd", [(value) => 1, (value) => 2], [true, false]); // $ExpectType string[]
|
||||
_.orderBy(list, (value) => 1); // $ExpectType AbcObject[]
|
||||
_.orderBy(list, (value) => 1, true); // $ExpectType AbcObject[]
|
||||
_.orderBy(list, [(value) => 1, (value) => 2], [true, false]); // $ExpectType AbcObject[]
|
||||
_.orderBy(list, [(value) => 1, 'third', (value) => 2], [true, false]); // $ExpectType AbcObject[]
|
||||
_.orderBy(dictionary, (value) => 1); // $ExpectType AbcObject[]
|
||||
_.orderBy(dictionary, (value) => 1, true); // $ExpectType AbcObject[]
|
||||
_.orderBy(numericDictionary, (value) => 1); // $ExpectType AbcObject[]
|
||||
@@ -3177,7 +3177,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType CollectionChain<number>
|
||||
|
||||
_.chain(list).orderBy((value) => 1); // $ExpectType CollectionChain<AbcObject>
|
||||
_.chain(list).orderBy((value) => 1, true); // $ExpectType CollectionChain<AbcObject>
|
||||
_.chain(list).orderBy([(value) => 1, (value) => 2], true); // $ExpectType CollectionChain<AbcObject>
|
||||
_.chain(list).orderBy([(value) => 1, 'third', (value) => 2], true); // $ExpectType CollectionChain<AbcObject>
|
||||
_.chain(dictionary).orderBy((value) => 1); // $ExpectType CollectionChain<AbcObject>
|
||||
_.chain(dictionary).orderBy((value) => 1, true); // $ExpectType CollectionChain<AbcObject>
|
||||
_.chain(numericDictionary).orderBy((value) => 1); // $ExpectType CollectionChain<AbcObject>
|
||||
|
||||
Reference in New Issue
Block a user