diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index d8d08a3b75..8f8e32d370 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -67,6 +67,10 @@ declare module _ { (element: T, key: string, list: Dictionary): TResult; } + type IterateePropertyShorthand = string | number; + + type IterateeMatcherShorthand = Dictionary; + interface MemoIterator { (prev: TResult, curr: T, index: number, list: List): TResult; } @@ -146,7 +150,7 @@ interface UnderscoreStatic { **/ map( list: _.List, - iterator: _.ListIterator, + iterator: _.ListIterator | _.IterateePropertyShorthand | _.IterateeMatcherShorthand, context?: any): TResult[]; /** @@ -161,12 +165,13 @@ interface UnderscoreStatic { iterator: _.ObjectIterator, context?: any): TResult[]; + /** * @see _.map **/ collect( list: _.List, - iterator: _.ListIterator, + iterator: _.ListIterator | _.IterateePropertyShorthand | _.IterateeMatcherShorthand, context?: any): TResult[]; /** @@ -900,7 +905,7 @@ interface UnderscoreStatic { uniq( array: _.List, isSorted?: boolean, - iterator?: _.ListIterator, + iterator?: _.ListIterator | _.IterateePropertyShorthand, context?: any): T[]; /** @@ -916,7 +921,7 @@ interface UnderscoreStatic { **/ unique( array: _.List, - iterator?: _.ListIterator, + iterator?: _.ListIterator | _.IterateePropertyShorthand, context?: any): T[]; /**