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/global.d.ts b/types/globals.d.ts similarity index 77% rename from types/global.d.ts rename to types/globals.d.ts index 0b7c597e4..f35336db4 100644 --- a/types/global.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: {