From cf779a7eebc35a1d23897c3dddef9dad3f32617b Mon Sep 17 00:00:00 2001 From: alan Date: Wed, 31 Jul 2019 14:25:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20KERNEL-800=20=E5=B0=BD=E9=87=8F?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=B3=9B=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/base.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/typescript/core/base.ts b/typescript/core/base.ts index 3432be3ba8..d0e26dc1d8 100644 --- a/typescript/core/base.ts +++ b/typescript/core/base.ts @@ -13,9 +13,9 @@ export interface _base { packageItems: (items: any[], layouts: any[]) => any[]; - formatEL: (obj: any) => {el: any} + formatEL: (obj: T) => {el: T} | T - stripEL: (obj: any) => any; + stripEL: (obj: {el: T} | T) => T; trans2Element: (widgets: any[]) => any[]; @@ -56,7 +56,7 @@ export interface _base { some: (collection: any[]|object|string, callback?: Function|object|string, thisArg?: any) => boolean; - _any: (collection: any[]|object|string, callback?: Function|object|string, thisArg?: any) => boolean; + any: (collection: any[]|object|string, callback?: Function|object|string, thisArg?: any) => boolean; max: (collection: any[]|object|string, callback?: Function|object|string, thisArg?: any) => any; @@ -110,11 +110,11 @@ export interface _base { // 数组相关的方法 first: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T; - initial: (array: any[], callback?: Function|object|number|string, thisArg?: any) => any[]; + initial: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T[]; last: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T; - rest: (array: any[], callback?: Function|object|number|string, thisArg?: any) => any[]; + rest: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T[]; compact: (array: any[]) => any[]; @@ -132,7 +132,7 @@ export interface _base { unzip: (...array: any[]) => any[]; - _object: (keys: string[], values?: any[]) => any[]; + object: (keys: string[], values?: any[]) => any[]; indexOf: (array: any[], value: any, fromIndex?: number) => number; @@ -142,19 +142,19 @@ export interface _base { range: (start: number, end: number, step: number) => number[]; - take: (array: any[], n: number) => any[]; + take: (array: T[], n: number) => T[]; - takeRight: (array: any[], n: number) => any[]; + takeRight: (array: T[], n: number) => T[]; findIndex: (array: any[], value: any, callback?: Function|object|string, thisArg?: any) => number; findLastIndex: (array: any[], value: any, callback?: Function|object|string, thisArg?: any) => number; - makeArray: (length: number, value: any) => any[]; + makeArray: (length: number, value?: T) => number[] | T[]; makeObject: (array: any[], value: any) => any; - makeArrayByArray: (array: any[], value: any) => any[]; + makeArrayByArray: (array: any[], value: T) => T[]; uniq: (array: T[], isSorted?: boolean, iteratee?: any, context?: any) => T[]; @@ -177,7 +177,7 @@ export interface _base { defaults: (object: object, ...sources: any[]) => object; - clone: (object: object) => object; + clone: (object: T) => T; property: (path: any[]|string) => Function; @@ -237,7 +237,7 @@ export interface _base { has: (obj: object, keys: string[]) => boolean; - freeze: (value: object) => object; + freeze: (value: T) => T; isKey: (key: any) => boolean;