diff --git a/tsconfig.json b/tsconfig.json index cfdd2d9e3b..e5fe6fc61b 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 0b7c597e47..f35336db42 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 0000000000..61cffc88ac --- /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 d7e7e664f5..f00024e18e 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 16dfae4411..5e66099839 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 ba70b55730..525f8d7a42 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: {