From daac8543e29d5a52fa09588ff517130046d2aed6 Mon Sep 17 00:00:00 2001 From: iapyang Date: Thu, 31 Oct 2019 17:14:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=E5=B0=9D=E8=AF=95update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/{global.d.ts => fineui.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename types/{global.d.ts => fineui.d.ts} (100%) diff --git a/types/global.d.ts b/types/fineui.d.ts similarity index 100% rename from types/global.d.ts rename to types/fineui.d.ts From 62287cabc8a87644cba240d7a29e16eb3dcf88e7 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 4 Nov 2019 10:11:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?KERNEL-1752=20refactor:=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9fineui=E4=B8=ADBI=E7=9A=84=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsconfig.json | 3 ++- types/{fineui.d.ts => globals.d.ts} | 2 +- typescript/bundle.ts | 3 +++ typescript/core/decorator/decorator.ts | 2 +- typescript/index.ts | 6 +++--- webpack/webpack.common.js | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) rename types/{fineui.d.ts => globals.d.ts} (77%) create mode 100644 typescript/bundle.ts diff --git a/tsconfig.json b/tsconfig.json index cfdd2d9e3..e5fe6fc61 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,8 +13,9 @@ "outDir": "./bin", "baseUrl": ".", // "strict": true, - // "strictNullChecks": true, + "strictNullChecks": true, "noImplicitAny": true, + "noImplicitThis": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, diff --git a/types/fineui.d.ts b/types/globals.d.ts similarity index 77% rename from types/fineui.d.ts rename to types/globals.d.ts index 0b7c597e4..f35336db4 100644 --- a/types/fineui.d.ts +++ b/types/globals.d.ts @@ -2,7 +2,7 @@ interface Obj { [key: string]: any; } -declare let BI: Obj & import("../typescript/index")._BI; +declare let BI: Obj & import("../typescript/index").BI; // declare let BI: Obj; diff --git a/typescript/bundle.ts b/typescript/bundle.ts new file mode 100644 index 000000000..61cffc88a --- /dev/null +++ b/typescript/bundle.ts @@ -0,0 +1,3 @@ +import fineui from "./index"; + +BI.extend(BI, fineui); diff --git a/typescript/core/decorator/decorator.ts b/typescript/core/decorator/decorator.ts index d7e7e664f..f00024e18 100644 --- a/typescript/core/decorator/decorator.ts +++ b/typescript/core/decorator/decorator.ts @@ -83,4 +83,4 @@ type UnionToTupleRecursively_> UnionToTupleRecursively, Prepend>; type UnionToTuple = UnionToTupleRecursively; -*/ \ No newline at end of file +*/ diff --git a/typescript/index.ts b/typescript/index.ts index 16dfae441..5e6609983 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -22,7 +22,7 @@ type ClassConstructor = T & { readonly prototype: T; } -export interface _BI extends _func, _i18n, _base { +export interface BI extends _func, _i18n, _base { OB: ClassConstructor<_OB>; Widget: ClassConstructor<_Widget> & _WidgetStatic; Single: ClassConstructor<_Single>; @@ -40,6 +40,6 @@ export interface _BI extends _func, _i18n, _base { Decorators: typeof decorator; } -BI = BI.extend(BI, { +export default { Decorators: decorator, -}) as any; +}; diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index ba70b5573..525f8d7a4 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -26,7 +26,7 @@ module.exports = { "es6-promise/auto", ], fineui: [ - "./typescript/index.ts", + "./typescript/bundle.ts", ], }, resolve: {