Browse Source

refactor: 补充遗漏的类型描述

es6
iapyang 4 years ago
parent
commit
f41b725aa5
  1. 18
      typescript/core/base.ts

18
typescript/core/base.ts

@ -261,6 +261,10 @@ export interface _base {
isWindow: (obj: any) => obj is Window;
deepClone: <T>(obj: T) => T;
deepExtend: merge['deepExtend'];
isDeepMatch: (object: any, attrs: any) => boolean;
contains: (obj: any[], target: any, fromIndex?: number) => boolean;
@ -373,3 +377,17 @@ export interface _base {
getTime: (...args: any[]) => number;
}
type merge = {
deepExtend<TObject, TSource>(object: TObject, source: TSource): TObject & TSource;
deepExtend<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2;
deepExtend<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2;
deepExtend<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): TObject & TSource1 & TSource2 & TSource3;
deepExtend<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4): TObject & TSource1 & TSource2 & TSource3 & TSource4;
deepExtend(object: any, ...otherArgs: any[]): any;
}

Loading…
Cancel
Save