diff --git a/typescript/core/base.ts b/typescript/core/base.ts index 6a6594884..b6d7e795d 100644 --- a/typescript/core/base.ts +++ b/typescript/core/base.ts @@ -40,11 +40,11 @@ export interface _base { each: (collection: T[]|object|string, callback?: ((index: number, value: T) => void)|object|string, thisArg?: any) => any; - map: (collection: T[]|object|string, callback?: ((index: number, value: T) => any)|object|string, thisArg?: any) => any[]; + map: (collection: T[]|object|string, callback?: ((index: number, value: T) => U)|object|string, thisArg?: any) => U[]; - reduce: (collection: T[]|object|string, callback?: ((total: T, currentValue: T, currentIndex: number) => any)|object|string, thisArg?: any) => any; + reduce: (collection: T[]|object|string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T)|object|string, initialValue?: U|T) => U extends T ? U : T; - reduceRight: (collection: T[]|object|string, callback?: ((total: T, currentValue: T, currentIndex: number) => any)|object|string, thisArg?: any) => any; + reduceRight: (collection: T[]|object|string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T)|object|string, initialValue?: U|T) => U extends T ? U : T; find: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => any;