From b8d42fee89e3f58fef56e348a1939e0b1ec24f5d Mon Sep 17 00:00:00 2001 From: alan Date: Thu, 12 Sep 2019 10:59:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=97=A0jira=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E5=96=84=E6=B3=9B=E5=9E=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/base.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/typescript/core/base.ts b/typescript/core/base.ts index 32c83c3a7..6a6594884 100644 --- a/typescript/core/base.ts +++ b/typescript/core/base.ts @@ -38,13 +38,13 @@ export interface _base { size: (collection: any[]|object|string) => number; - each: (collection: any[]|object|string, callback?: ((index: number, value: T) => void)|object|string, thisArg?: any) => any; + each: (collection: T[]|object|string, callback?: ((index: number, value: T) => void)|object|string, thisArg?: any) => any; - map: (collection: any[]|object|string, callback?: ((index: number, value: T) => any)|object|string, thisArg?: any) => any[]; + map: (collection: T[]|object|string, callback?: ((index: number, value: T) => any)|object|string, thisArg?: any) => any[]; - reduce: (collection: any[]|object|string, callback?: ((total: any, currentValue: T, currentIndex: number) => any)|object|string, thisArg?: any) => any; + reduce: (collection: T[]|object|string, callback?: ((total: T, currentValue: T, currentIndex: number) => any)|object|string, thisArg?: any) => any; - reduceRight: (collection: any[]|object|string, callback?: ((total: any, currentValue: T, currentIndex: number) => any)|object|string, thisArg?: any) => any; + reduceRight: (collection: T[]|object|string, callback?: ((total: T, currentValue: T, currentIndex: number) => any)|object|string, thisArg?: any) => any; find: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => any; From 4135723e6fe734d049d75bf112020a347cd7983c Mon Sep 17 00:00:00 2001 From: alan Date: Thu, 12 Sep 2019 11:40:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=B3=9B=E5=9E=8B?= =?UTF-8?q?=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/base.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;