Browse Source

无JIRA任务 chore: 添加inject.js中的描述

es6
zsmj1994 4 years ago
parent
commit
b0264ef876
  1. 47
      typescript/core/inject.ts
  2. 5
      typescript/index.ts

47
typescript/core/inject.ts

@ -0,0 +1,47 @@
type _module = (xtype: string, cls: any) => void;
type _constant = (xtype: string, cls: any) => void;
type _model = (xtype: string, cls: any) => void;
type _store = (xtype: string, cls: any) => void;
type _service = (xtype: string, cls: any) => void;
type _provider = (xtype: string, cls: any) => void;
interface _modules {
getModule: (type: string) => any;
getAllModules: () => any;
}
interface _constants {
getConstant: (type: string) => any;
}
interface _models {
getModel: (type: string, options: any) => any;
}
interface _stores {
getStore: (type: string, options: any) => any;
}
interface _providers {
getProvider: (type: string, options: any) => any;
}
interface _services {
getService: (type: string, options: any) => any;
}
export type _inject = {
module: _module;
constant: _constant;
model: _model;
store: _store;
provider: _provider;
service: _service;
Modules: _modules;
Constants: _constants;
Models: _models;
Stores: _stores;
Providers: _providers;
Services: _services;
}

5
typescript/index.ts

@ -36,6 +36,7 @@ import { _i18n } from "./core/i18n";
import { _Plugin } from "./core/plugin"; import { _Plugin } from "./core/plugin";
import { _OB } from "./core/ob"; import { _OB } from "./core/ob";
import { _Widget, _WidgetStatic } from "./core/widget"; import { _Widget, _WidgetStatic } from "./core/widget";
import { _inject } from "./core/inject";
import { _Layout } from "./core/wrapper/layout"; import { _Layout } from "./core/wrapper/layout";
import { _AbsoluteLayout } from "./core/wrapper/layout/layout.absolute"; import { _AbsoluteLayout } from "./core/wrapper/layout/layout.absolute";
import { _HTapeLayout, _VTapeLayout } from "./core/wrapper/layout/layout.tape"; import { _HTapeLayout, _VTapeLayout } from "./core/wrapper/layout/layout.tape";
@ -49,9 +50,9 @@ type ClassConstructor<T extends {}> = T & {
readonly prototype: T; readonly prototype: T;
} }
export interface BI extends _func, _i18n, _base { export interface BI extends _func, _i18n, _base, _inject {
OB: ClassConstructor<_OB>; OB: ClassConstructor<_OB>;
Plugin:_Plugin; Plugin: _Plugin;
Widget: ClassConstructor<_Widget> & _WidgetStatic; Widget: ClassConstructor<_Widget> & _WidgetStatic;
Single: ClassConstructor<_Single>; Single: ClassConstructor<_Single>;
BasicButton: ClassConstructor<_BasicButton> & _BasicButtonStatic; BasicButton: ClassConstructor<_BasicButton> & _BasicButtonStatic;

Loading…
Cancel
Save