From 35036ae8dd9b89f4ccd9a7d0f8f5e75de01fe198 Mon Sep 17 00:00:00 2001 From: Daniel Beckwith Date: Fri, 1 May 2015 00:31:59 -0400 Subject: [PATCH] adds function type for Dictionary version of reduce (issue 4244) --- underscore/underscore.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index 7ff9aa5eb..c5815f51a 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -53,6 +53,10 @@ declare module _ { (prev: TResult, curr: T, index: number, list: T[]): TResult; } + interface MemoObjectIterator { + (prev: TResult, curr: T, key: string, list: any): TResult; + } + interface Collection { } // Common interface between Arrays and jQuery objects @@ -181,7 +185,7 @@ interface UnderscoreStatic { reduce( list: _.Dictionary, - iterator: _.ObjectIterator, + iterator: _.MemoObjectIterator, memo?: TResult, context?: any): TResult;