@cocojs/mvc 0.0.1-alpha.4 → 0.0.1-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +90 -90
- package/dist/index.d.ts +83 -83
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -448,7 +448,7 @@ function isClass(v) {
|
|
|
448
448
|
function isCocoClass(v) {
|
|
449
449
|
return typeof v === 'function' && v.prototype && v.prototype.constructor === v &&
|
|
450
450
|
// 必须有$$cocoId属性
|
|
451
|
-
typeof v.$$
|
|
451
|
+
typeof v.$$id === 'string' && v.$$id.trim();
|
|
452
452
|
}
|
|
453
453
|
|
|
454
454
|
var defaultProp = 'value';
|
|
@@ -1015,7 +1015,7 @@ new (_Target2 = (_Target3 = /*#__PURE__*/function (_Metadata) {
|
|
|
1015
1015
|
function _Class() {
|
|
1016
1016
|
var _this2;
|
|
1017
1017
|
_classCallCheck(this, _Class);
|
|
1018
|
-
_this2 = _callSuper(this, _Class, [_Target]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
1018
|
+
_this2 = _callSuper(this, _Class, [_Target]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'Target'), _defineProperty(_assertThisInitialized(_this2), "Type", Type), _initClass$x();
|
|
1019
1019
|
return _this2;
|
|
1020
1020
|
}
|
|
1021
1021
|
_inherits(_Class, _identity2);
|
|
@@ -1046,7 +1046,7 @@ new (_Autowired2 = (_Autowired3 = /*#__PURE__*/function (_Metadata) {
|
|
|
1046
1046
|
function _Class() {
|
|
1047
1047
|
var _this2;
|
|
1048
1048
|
_classCallCheck(this, _Class);
|
|
1049
|
-
_this2 = _callSuper(this, _Class, [_Autowired]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
1049
|
+
_this2 = _callSuper(this, _Class, [_Autowired]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'Autowired'), _initClass$w();
|
|
1050
1050
|
return _this2;
|
|
1051
1051
|
}
|
|
1052
1052
|
_inherits(_Class, _identity2);
|
|
@@ -1057,42 +1057,42 @@ var Autowired = _Autowired;
|
|
|
1057
1057
|
// TODO: cls?: Class<any>如果去掉的话,在项目中会报错,应该是ts-server是拿到参数了,但是声明中确没有
|
|
1058
1058
|
var autowired = createDecoratorExp(Autowired);
|
|
1059
1059
|
|
|
1060
|
-
var _Class$v,
|
|
1061
|
-
var _initClass$v,
|
|
1060
|
+
var _Class$v, _Id3, _applyDecs$c$v;
|
|
1061
|
+
var _initClass$v, _Id2;
|
|
1062
1062
|
/**
|
|
1063
1063
|
* @public
|
|
1064
1064
|
*/
|
|
1065
|
-
var
|
|
1066
|
-
new (
|
|
1067
|
-
function
|
|
1065
|
+
var _Id;
|
|
1066
|
+
new (_Id2 = (_Id3 = /*#__PURE__*/function (_Metadata) {
|
|
1067
|
+
function Id() {
|
|
1068
1068
|
var _this;
|
|
1069
|
-
_classCallCheck(this,
|
|
1069
|
+
_classCallCheck(this, Id);
|
|
1070
1070
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1071
1071
|
args[_key] = arguments[_key];
|
|
1072
1072
|
}
|
|
1073
|
-
_this = _callSuper(this,
|
|
1073
|
+
_this = _callSuper(this, Id, [].concat(args));
|
|
1074
1074
|
_defineProperty(_this, "value", void 0);
|
|
1075
1075
|
return _this;
|
|
1076
1076
|
}
|
|
1077
|
-
_inherits(
|
|
1078
|
-
return _createClass(
|
|
1079
|
-
}(Metadata), _applyDecs$c$v = _slicedToArray(_applyDecs2311(
|
|
1077
|
+
_inherits(Id, _Metadata);
|
|
1078
|
+
return _createClass(Id);
|
|
1079
|
+
}(Metadata), _applyDecs$c$v = _slicedToArray(_applyDecs2311(_Id3, [target([Target.Type.Method])], [], 0, void 0, Metadata).c, 2), _Id = _applyDecs$c$v[0], _initClass$v = _applyDecs$c$v[1], _Id3), _Class$v = /*#__PURE__*/function (_identity2) {
|
|
1080
1080
|
function _Class() {
|
|
1081
1081
|
var _this2;
|
|
1082
1082
|
_classCallCheck(this, _Class);
|
|
1083
|
-
_this2 = _callSuper(this, _Class, [
|
|
1083
|
+
_this2 = _callSuper(this, _Class, [_Id]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'Id'), _initClass$v();
|
|
1084
1084
|
return _this2;
|
|
1085
1085
|
}
|
|
1086
1086
|
_inherits(_Class, _identity2);
|
|
1087
1087
|
return _createClass(_Class);
|
|
1088
|
-
}(_identity), _defineProperty(_Class$v,
|
|
1089
|
-
var
|
|
1088
|
+
}(_identity), _defineProperty(_Class$v, _Id2, void 0), _Class$v)();
|
|
1089
|
+
var Id = _Id;
|
|
1090
1090
|
|
|
1091
1091
|
/**
|
|
1092
|
-
* @
|
|
1093
|
-
* 在使用@component方法装饰注入的普通类,必须使用@
|
|
1092
|
+
* @id装饰器
|
|
1093
|
+
* 在使用@component方法装饰注入的普通类,必须使用@id来申明组件的$$id
|
|
1094
1094
|
*/
|
|
1095
|
-
var
|
|
1095
|
+
var id$2 = createDecoratorExp(Id);
|
|
1096
1096
|
|
|
1097
1097
|
var _Class$u, _Component3, _applyDecs$c$u;
|
|
1098
1098
|
var _initClass$u, _Component2;
|
|
@@ -1121,7 +1121,7 @@ new (_Component2 = (_Component3 = /*#__PURE__*/function (_Metadata) {
|
|
|
1121
1121
|
function _Class() {
|
|
1122
1122
|
var _this2;
|
|
1123
1123
|
_classCallCheck(this, _Class);
|
|
1124
|
-
_this2 = _callSuper(this, _Class, [_Component]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
1124
|
+
_this2 = _callSuper(this, _Class, [_Component]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'Component'), _initClass$u();
|
|
1125
1125
|
return _this2;
|
|
1126
1126
|
}
|
|
1127
1127
|
_inherits(_Class, _identity2);
|
|
@@ -1152,7 +1152,7 @@ new (_Configuration2 = (_Configuration3 = /*#__PURE__*/function (_Metadata) {
|
|
|
1152
1152
|
function _Class() {
|
|
1153
1153
|
var _this;
|
|
1154
1154
|
_classCallCheck(this, _Class);
|
|
1155
|
-
_this = _callSuper(this, _Class, [_Configuration]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
1155
|
+
_this = _callSuper(this, _Class, [_Configuration]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Configuration'), _initClass$t();
|
|
1156
1156
|
return _this;
|
|
1157
1157
|
}
|
|
1158
1158
|
_inherits(_Class, _identity2);
|
|
@@ -1185,7 +1185,7 @@ new (_ConstructorParam2 = (_ConstructorParam3 = /*#__PURE__*/function (_Metadata
|
|
|
1185
1185
|
function _Class() {
|
|
1186
1186
|
var _this2;
|
|
1187
1187
|
_classCallCheck(this, _Class);
|
|
1188
|
-
_this2 = _callSuper(this, _Class, [_ConstructorParam]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
1188
|
+
_this2 = _callSuper(this, _Class, [_ConstructorParam]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'ConstructorParam'), _initClass$s();
|
|
1189
1189
|
return _this2;
|
|
1190
1190
|
}
|
|
1191
1191
|
_inherits(_Class, _identity2);
|
|
@@ -1228,7 +1228,7 @@ new (_Scope2 = (_Scope3 = /*#__PURE__*/function (_Metadata) {
|
|
|
1228
1228
|
function _Class() {
|
|
1229
1229
|
var _this2;
|
|
1230
1230
|
_classCallCheck(this, _Class);
|
|
1231
|
-
_this2 = _callSuper(this, _Class, [_Scope]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
1231
|
+
_this2 = _callSuper(this, _Class, [_Scope]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'Scope'), _initClass$r();
|
|
1232
1232
|
return _this2;
|
|
1233
1233
|
}
|
|
1234
1234
|
_inherits(_Class, _identity2);
|
|
@@ -1261,7 +1261,7 @@ new (_Qualifier2 = (_Qualifier3 = /*#__PURE__*/function (_Metadata) {
|
|
|
1261
1261
|
function _Class() {
|
|
1262
1262
|
var _this2;
|
|
1263
1263
|
_classCallCheck(this, _Class);
|
|
1264
|
-
_this2 = _callSuper(this, _Class, [_Qualifier]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
1264
|
+
_this2 = _callSuper(this, _Class, [_Qualifier]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'Qualifier'), _initClass$q();
|
|
1265
1265
|
return _this2;
|
|
1266
1266
|
}
|
|
1267
1267
|
_inherits(_Class, _identity2);
|
|
@@ -1294,7 +1294,7 @@ new (_Value2 = (_Value3 = /*#__PURE__*/function (_Metadata) {
|
|
|
1294
1294
|
function _Class() {
|
|
1295
1295
|
var _this2;
|
|
1296
1296
|
_classCallCheck(this, _Class);
|
|
1297
|
-
_this2 = _callSuper(this, _Class, [_Value]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
1297
|
+
_this2 = _callSuper(this, _Class, [_Value]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'Value'), _initClass$p();
|
|
1298
1298
|
return _this2;
|
|
1299
1299
|
}
|
|
1300
1300
|
_inherits(_Class, _identity2);
|
|
@@ -2569,27 +2569,27 @@ function validate(metadataList, componentMetadataClass) {
|
|
|
2569
2569
|
return diagnoseList;
|
|
2570
2570
|
}
|
|
2571
2571
|
|
|
2572
|
-
var
|
|
2572
|
+
var IdClassMap = /*#__PURE__*/function () {
|
|
2573
2573
|
/**
|
|
2574
2574
|
* * 保存元数据类本身,方便运行是通过id获取元数据类
|
|
2575
2575
|
* * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
|
|
2576
2576
|
*/
|
|
2577
|
-
function
|
|
2578
|
-
_classCallCheck(this,
|
|
2579
|
-
_defineProperty(this, "
|
|
2577
|
+
function IdClassMap(metaMetadataMap) {
|
|
2578
|
+
_classCallCheck(this, IdClassMap);
|
|
2579
|
+
_defineProperty(this, "idClassMap", new Map());
|
|
2580
2580
|
var _iterator = _createForOfIteratorHelper(metaMetadataMap.keys()),
|
|
2581
2581
|
_step;
|
|
2582
2582
|
try {
|
|
2583
2583
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2584
2584
|
var cls = _step.value;
|
|
2585
|
-
var
|
|
2586
|
-
if (typeof
|
|
2585
|
+
var id = cls.$$id;
|
|
2586
|
+
if (typeof id !== 'string' || !id.trim()) {
|
|
2587
2587
|
throw new Error(stringifyDiagnose(createDiagnose(DiagnoseCode.CO10016, cls.name)));
|
|
2588
2588
|
}
|
|
2589
|
-
if (this.
|
|
2590
|
-
throw new Error(stringifyDiagnose(createDiagnose(DiagnoseCode.CO10017, cls, this.
|
|
2589
|
+
if (this.idClassMap.has(id)) {
|
|
2590
|
+
throw new Error(stringifyDiagnose(createDiagnose(DiagnoseCode.CO10017, cls, this.idClassMap.get(id))));
|
|
2591
2591
|
}
|
|
2592
|
-
this.
|
|
2592
|
+
this.idClassMap.set(id, cls);
|
|
2593
2593
|
}
|
|
2594
2594
|
} catch (err) {
|
|
2595
2595
|
_iterator.e(err);
|
|
@@ -2599,22 +2599,22 @@ var CocoidClassMap = /*#__PURE__*/function () {
|
|
|
2599
2599
|
}
|
|
2600
2600
|
/**
|
|
2601
2601
|
* * 根据cocoId获取元数据类
|
|
2602
|
-
* * @param
|
|
2602
|
+
* * @param id 元数据类id
|
|
2603
2603
|
* * @returns 元数据类
|
|
2604
2604
|
*/
|
|
2605
|
-
return _createClass(
|
|
2605
|
+
return _createClass(IdClassMap, [{
|
|
2606
2606
|
key: "getMetaClassById",
|
|
2607
|
-
value: function getMetaClassById(
|
|
2608
|
-
if (typeof
|
|
2607
|
+
value: function getMetaClassById(id) {
|
|
2608
|
+
if (typeof id !== 'string' || !id.trim() || !this.idClassMap.has(id)) {
|
|
2609
2609
|
return null;
|
|
2610
2610
|
} else {
|
|
2611
|
-
return this.
|
|
2611
|
+
return this.idClassMap.get(id);
|
|
2612
2612
|
}
|
|
2613
2613
|
}
|
|
2614
2614
|
}, {
|
|
2615
2615
|
key: "destructor",
|
|
2616
2616
|
value: function destructor() {
|
|
2617
|
-
this.
|
|
2617
|
+
this.idClassMap.clear();
|
|
2618
2618
|
}
|
|
2619
2619
|
}]);
|
|
2620
2620
|
}();
|
|
@@ -2635,20 +2635,20 @@ function initMetadataModule(decoratorMap) {
|
|
|
2635
2635
|
if (diagnoseList.length > 0) {
|
|
2636
2636
|
diagnoseList.forEach(printDiagnose);
|
|
2637
2637
|
}
|
|
2638
|
-
var
|
|
2638
|
+
var idClassMap = new IdClassMap(metadataMap);
|
|
2639
2639
|
return {
|
|
2640
2640
|
metadataRepository: metadataRepository,
|
|
2641
|
-
|
|
2641
|
+
idClassMap: idClassMap,
|
|
2642
2642
|
componentMetadataClass: componentMetadataClass
|
|
2643
2643
|
};
|
|
2644
2644
|
}
|
|
2645
2645
|
// 元数据相关数据清理
|
|
2646
|
-
function clearMetadataModule(metadataRepository,
|
|
2646
|
+
function clearMetadataModule(metadataRepository, idClassMap, componentMetadataClass) {
|
|
2647
2647
|
if (metadataRepository) {
|
|
2648
2648
|
metadataRepository.destructor();
|
|
2649
2649
|
}
|
|
2650
|
-
if (
|
|
2651
|
-
|
|
2650
|
+
if (idClassMap) {
|
|
2651
|
+
idClassMap.destructor();
|
|
2652
2652
|
}
|
|
2653
2653
|
if (componentMetadataClass) {
|
|
2654
2654
|
componentMetadataClass.destructor();
|
|
@@ -2717,9 +2717,9 @@ var IocComponentDefinition = /*#__PURE__*/function () {
|
|
|
2717
2717
|
}
|
|
2718
2718
|
return _createClass(IocComponentDefinition, [{
|
|
2719
2719
|
key: "newIocComponentDefinition",
|
|
2720
|
-
value: function newIocComponentDefinition(
|
|
2720
|
+
value: function newIocComponentDefinition(id, cls, isSingleton, instantiateType) {
|
|
2721
2721
|
return {
|
|
2722
|
-
|
|
2722
|
+
id: id,
|
|
2723
2723
|
cls: cls,
|
|
2724
2724
|
isSingleton: isSingleton,
|
|
2725
2725
|
instantiateType: instantiateType
|
|
@@ -2727,11 +2727,11 @@ var IocComponentDefinition = /*#__PURE__*/function () {
|
|
|
2727
2727
|
}
|
|
2728
2728
|
}, {
|
|
2729
2729
|
key: "addDefinition",
|
|
2730
|
-
value: function addDefinition(cls,
|
|
2731
|
-
if (typeof
|
|
2730
|
+
value: function addDefinition(cls, id, isSingleton, methodInstantiateOpts) {
|
|
2731
|
+
if (typeof id !== 'string' || !id.trim()) {
|
|
2732
2732
|
throw new Error("\u751F\u6210\u7EC4\u4EF6id\u5931\u8D25: [".concat(cls.name, "]"));
|
|
2733
2733
|
}
|
|
2734
|
-
var existIdDef = this.idDefinitionMap.get(
|
|
2734
|
+
var existIdDef = this.idDefinitionMap.get(id);
|
|
2735
2735
|
if (existIdDef) {
|
|
2736
2736
|
throw new Error("\u5B58\u5728cocoid\u7684\u7EC4\u4EF6: [".concat(existIdDef.cls.name, "] - [").concat(cls.name, "]"));
|
|
2737
2737
|
}
|
|
@@ -2739,11 +2739,11 @@ var IocComponentDefinition = /*#__PURE__*/function () {
|
|
|
2739
2739
|
if (existClsDef) {
|
|
2740
2740
|
throw new Error("\u5B58\u5728\u540C\u540D\u7684\u7EC4\u4EF6: [".concat(existClsDef.cls.name, "] - [").concat(cls.name, "]"));
|
|
2741
2741
|
}
|
|
2742
|
-
var componentDefinition = this.newIocComponentDefinition(
|
|
2742
|
+
var componentDefinition = this.newIocComponentDefinition(id, cls, isSingleton, methodInstantiateOpts ? 'method' : 'new');
|
|
2743
2743
|
if (methodInstantiateOpts) {
|
|
2744
2744
|
componentDefinition.methodInstantiateOpts = methodInstantiateOpts;
|
|
2745
2745
|
}
|
|
2746
|
-
this.idDefinitionMap.set(
|
|
2746
|
+
this.idDefinitionMap.set(id, componentDefinition);
|
|
2747
2747
|
this.clsDefinitionMap.set(cls, componentDefinition);
|
|
2748
2748
|
}
|
|
2749
2749
|
/**
|
|
@@ -2778,7 +2778,7 @@ var IocComponentDefinition = /*#__PURE__*/function () {
|
|
|
2778
2778
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2779
2779
|
var child = _step.value;
|
|
2780
2780
|
var def = this.clsDefinitionMap.get(child);
|
|
2781
|
-
if (def.
|
|
2781
|
+
if (def.id === qualifier) {
|
|
2782
2782
|
return def;
|
|
2783
2783
|
}
|
|
2784
2784
|
}
|
|
@@ -2789,12 +2789,12 @@ var IocComponentDefinition = /*#__PURE__*/function () {
|
|
|
2789
2789
|
}
|
|
2790
2790
|
}
|
|
2791
2791
|
if (qualifier) {
|
|
2792
|
-
var _diagnose = createDiagnose(DiagnoseCode.CO10010, definition.
|
|
2792
|
+
var _diagnose = createDiagnose(DiagnoseCode.CO10010, definition.id, descendantList.map(function (i) {
|
|
2793
2793
|
return i.name;
|
|
2794
2794
|
}), qualifier);
|
|
2795
2795
|
throw new Error(stringifyDiagnose(_diagnose));
|
|
2796
2796
|
} else {
|
|
2797
|
-
var _diagnose2 = createDiagnose(DiagnoseCode.CO10009, definition.
|
|
2797
|
+
var _diagnose2 = createDiagnose(DiagnoseCode.CO10009, definition.id, descendantList.map(function (i) {
|
|
2798
2798
|
return i.name;
|
|
2799
2799
|
}));
|
|
2800
2800
|
throw new Error(stringifyDiagnose(_diagnose2));
|
|
@@ -2965,7 +2965,7 @@ var IocComponentFactory = /*#__PURE__*/function () {
|
|
|
2965
2965
|
var qualifier = opt.qualifier;
|
|
2966
2966
|
if (!qualifier) {
|
|
2967
2967
|
// 如果没有指定,尝试从配置中获取
|
|
2968
|
-
qualifier = application.propertiesConfig.getValue("".concat(targetDefinition.
|
|
2968
|
+
qualifier = application.propertiesConfig.getValue("".concat(targetDefinition.id, ".qualifier"));
|
|
2969
2969
|
}
|
|
2970
2970
|
// 真正实例化的类定义
|
|
2971
2971
|
var instantiateDefinition = application.iocComponentDefinition.getInstantiateDefinition(classOrId, qualifier);
|
|
@@ -3204,7 +3204,7 @@ function doBuildIocComponentDefinition(metadataRepository, componentMetadataClas
|
|
|
3204
3204
|
// 取组件装饰器的@scope装饰器
|
|
3205
3205
|
scope = getComponentDecoratorScope(componentMetadata, metaMetadata, componentMetadataClass);
|
|
3206
3206
|
}
|
|
3207
|
-
iocComponentDefinition.addDefinition(beDecoratedCls, beDecoratedCls.$$
|
|
3207
|
+
iocComponentDefinition.addDefinition(beDecoratedCls, beDecoratedCls.$$id, scope === exports.SCOPE.Singleton);
|
|
3208
3208
|
} else {
|
|
3209
3209
|
var methods = metadataRepository.listMethodByMetadataCls(beDecoratedCls, Component);
|
|
3210
3210
|
var _iterator2 = _createForOfIteratorHelper(methods),
|
|
@@ -3216,7 +3216,7 @@ function doBuildIocComponentDefinition(metadataRepository, componentMetadataClas
|
|
|
3216
3216
|
// TODO: @component()装饰器的参数能否在 ioc 组件中定义了,没有定义都是有问题的
|
|
3217
3217
|
var scopeMetas = metadataRepository.listMethodKindMetadata(beDecoratedCls, method, Scope);
|
|
3218
3218
|
// TODO: 添加校验是否有@cocoid装饰器;
|
|
3219
|
-
var cocoidMetas = metadataRepository.listMethodKindMetadata(beDecoratedCls, method,
|
|
3219
|
+
var cocoidMetas = metadataRepository.listMethodKindMetadata(beDecoratedCls, method, Id);
|
|
3220
3220
|
iocComponentDefinition.addDefinition(componentMetas[0].value, cocoidMetas[0].value, !scopeMetas.length || scopeMetas[0].value === exports.SCOPE.Singleton, {
|
|
3221
3221
|
configurationCls: beDecoratedCls,
|
|
3222
3222
|
method: method
|
|
@@ -3321,7 +3321,7 @@ var Application = /*#__PURE__*/function () {
|
|
|
3321
3321
|
_classCallCheck(this, Application);
|
|
3322
3322
|
_defineProperty(this, "componentMetadataClass", void 0);
|
|
3323
3323
|
_defineProperty(this, "metadataRepository", void 0);
|
|
3324
|
-
_defineProperty(this, "
|
|
3324
|
+
_defineProperty(this, "idClassMap", void 0);
|
|
3325
3325
|
_defineProperty(this, "propertiesConfig", void 0);
|
|
3326
3326
|
_defineProperty(this, "iocComponentDefinition", void 0);
|
|
3327
3327
|
_defineProperty(this, "iocComponentFactory", void 0);
|
|
@@ -3338,10 +3338,10 @@ var Application = /*#__PURE__*/function () {
|
|
|
3338
3338
|
// 用装饰器参数初始化元数据数据
|
|
3339
3339
|
var _initMetadataModule = initMetadataModule(getDecoratorParam()),
|
|
3340
3340
|
metadataRepository = _initMetadataModule.metadataRepository,
|
|
3341
|
-
|
|
3341
|
+
idClassMap = _initMetadataModule.idClassMap,
|
|
3342
3342
|
componentMetadataClass = _initMetadataModule.componentMetadataClass;
|
|
3343
3343
|
this.metadataRepository = metadataRepository;
|
|
3344
|
-
this.
|
|
3344
|
+
this.idClassMap = idClassMap;
|
|
3345
3345
|
this.componentMetadataClass = componentMetadataClass;
|
|
3346
3346
|
// 用元数据信息初始化ioc组件数据
|
|
3347
3347
|
var _initIocComponentModu = initIocComponentModule(this.metadataRepository, this.componentMetadataClass),
|
|
@@ -3356,7 +3356,7 @@ var Application = /*#__PURE__*/function () {
|
|
|
3356
3356
|
key: "destructor",
|
|
3357
3357
|
value: function destructor() {
|
|
3358
3358
|
destructorIocComponentModule(this.iocComponentDefinition, this.iocComponentFactory);
|
|
3359
|
-
clearMetadataModule(this.metadataRepository, this.
|
|
3359
|
+
clearMetadataModule(this.metadataRepository, this.idClassMap, this.componentMetadataClass);
|
|
3360
3360
|
clearDecoratorParamModule();
|
|
3361
3361
|
}
|
|
3362
3362
|
}, {
|
|
@@ -3397,7 +3397,7 @@ var Application = /*#__PURE__*/function () {
|
|
|
3397
3397
|
}, {
|
|
3398
3398
|
key: "getMetaClassById",
|
|
3399
3399
|
value: function getMetaClassById(id) {
|
|
3400
|
-
return this.
|
|
3400
|
+
return this.idClassMap.getMetaClassById(id);
|
|
3401
3401
|
}
|
|
3402
3402
|
/**
|
|
3403
3403
|
* 启动所有配置boot的组件
|
|
@@ -3436,7 +3436,7 @@ new (_Bind2 = (_Bind3 = /*#__PURE__*/function (_Metadata) {
|
|
|
3436
3436
|
function _Class() {
|
|
3437
3437
|
var _this;
|
|
3438
3438
|
_classCallCheck(this, _Class);
|
|
3439
|
-
_this = _callSuper(this, _Class, [_Bind]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
3439
|
+
_this = _callSuper(this, _Class, [_Bind]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Bind'), _initClass$o();
|
|
3440
3440
|
return _this;
|
|
3441
3441
|
}
|
|
3442
3442
|
_inherits(_Class, _identity2);
|
|
@@ -3467,7 +3467,7 @@ new (_Cookie2 = (_Cookie3 = /*#__PURE__*/function (_Metadata) {
|
|
|
3467
3467
|
function _Class() {
|
|
3468
3468
|
var _this;
|
|
3469
3469
|
_classCallCheck(this, _Class);
|
|
3470
|
-
_this = _callSuper(this, _Class, [_Cookie]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
3470
|
+
_this = _callSuper(this, _Class, [_Cookie]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Cookie'), _initClass$n();
|
|
3471
3471
|
return _this;
|
|
3472
3472
|
}
|
|
3473
3473
|
_inherits(_Class, _identity2);
|
|
@@ -3730,7 +3730,7 @@ new (_View2 = (_View3 = /*#__PURE__*/function (_Metadata) {
|
|
|
3730
3730
|
function _Class() {
|
|
3731
3731
|
var _this;
|
|
3732
3732
|
_classCallCheck(this, _Class);
|
|
3733
|
-
_this = _callSuper(this, _Class, [_View]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
3733
|
+
_this = _callSuper(this, _Class, [_View]), _defineProperty(_assertThisInitialized(_this), "$$id", 'View'), _initClass$m();
|
|
3734
3734
|
return _this;
|
|
3735
3735
|
}
|
|
3736
3736
|
_inherits(_Class, _identity2);
|
|
@@ -3757,7 +3757,7 @@ new (_Layout2 = (_Layout3 = /*#__PURE__*/function (_Metadata) {
|
|
|
3757
3757
|
function _Class() {
|
|
3758
3758
|
var _this;
|
|
3759
3759
|
_classCallCheck(this, _Class);
|
|
3760
|
-
_this = _callSuper(this, _Class, [_Layout]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
3760
|
+
_this = _callSuper(this, _Class, [_Layout]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Layout'), _initClass$l();
|
|
3761
3761
|
return _this;
|
|
3762
3762
|
}
|
|
3763
3763
|
_inherits(_Class, _identity2);
|
|
@@ -3784,7 +3784,7 @@ new (_LocalStorage2 = (_LocalStorage3 = /*#__PURE__*/function (_Metadata) {
|
|
|
3784
3784
|
function _Class() {
|
|
3785
3785
|
var _this;
|
|
3786
3786
|
_classCallCheck(this, _Class);
|
|
3787
|
-
_this = _callSuper(this, _Class, [_LocalStorage]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
3787
|
+
_this = _callSuper(this, _Class, [_LocalStorage]), _defineProperty(_assertThisInitialized(_this), "$$id", 'LocalStorage'), _initClass$k();
|
|
3788
3788
|
return _this;
|
|
3789
3789
|
}
|
|
3790
3790
|
_inherits(_Class, _identity2);
|
|
@@ -3811,7 +3811,7 @@ new (_Memoized2 = (_Memoized3 = /*#__PURE__*/function (_Metadata) {
|
|
|
3811
3811
|
function _Class() {
|
|
3812
3812
|
var _this;
|
|
3813
3813
|
_classCallCheck(this, _Class);
|
|
3814
|
-
_this = _callSuper(this, _Class, [_Memoized]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
3814
|
+
_this = _callSuper(this, _Class, [_Memoized]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Memoized'), _initClass$j();
|
|
3815
3815
|
return _this;
|
|
3816
3816
|
}
|
|
3817
3817
|
_inherits(_Class, _identity2);
|
|
@@ -3902,7 +3902,7 @@ new (_Page2 = (_Page3 = /*#__PURE__*/function (_Metadata) {
|
|
|
3902
3902
|
function _Class() {
|
|
3903
3903
|
var _this;
|
|
3904
3904
|
_classCallCheck(this, _Class);
|
|
3905
|
-
_this = _callSuper(this, _Class, [_Page]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
3905
|
+
_this = _callSuper(this, _Class, [_Page]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Page'), _initClass$i();
|
|
3906
3906
|
return _this;
|
|
3907
3907
|
}
|
|
3908
3908
|
_inherits(_Class, _identity2);
|
|
@@ -3931,7 +3931,7 @@ new (_Reactive2 = (_Reactive3 = /*#__PURE__*/function (_Metadata) {
|
|
|
3931
3931
|
function _Class() {
|
|
3932
3932
|
var _this;
|
|
3933
3933
|
_classCallCheck(this, _Class);
|
|
3934
|
-
_this = _callSuper(this, _Class, [_Reactive]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
3934
|
+
_this = _callSuper(this, _Class, [_Reactive]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Reactive'), _initClass$h();
|
|
3935
3935
|
return _this;
|
|
3936
3936
|
}
|
|
3937
3937
|
_inherits(_Class, _identity2);
|
|
@@ -4043,7 +4043,7 @@ new (_Ref2 = (_Ref3 = /*#__PURE__*/function (_Metadata) {
|
|
|
4043
4043
|
function _Class() {
|
|
4044
4044
|
var _this;
|
|
4045
4045
|
_classCallCheck(this, _Class);
|
|
4046
|
-
_this = _callSuper(this, _Class, [_Ref]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
4046
|
+
_this = _callSuper(this, _Class, [_Ref]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Ref'), _initClass$g();
|
|
4047
4047
|
return _this;
|
|
4048
4048
|
}
|
|
4049
4049
|
_inherits(_Class, _identity2);
|
|
@@ -4076,7 +4076,7 @@ new (_Refs2 = (_Refs3 = /*#__PURE__*/function (_Metadata) {
|
|
|
4076
4076
|
function _Class() {
|
|
4077
4077
|
var _this;
|
|
4078
4078
|
_classCallCheck(this, _Class);
|
|
4079
|
-
_this = _callSuper(this, _Class, [_Refs]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
4079
|
+
_this = _callSuper(this, _Class, [_Refs]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Refs'), _initClass$f();
|
|
4080
4080
|
return _this;
|
|
4081
4081
|
}
|
|
4082
4082
|
_inherits(_Class, _identity2);
|
|
@@ -4107,7 +4107,7 @@ new (_SessionStorage2 = (_SessionStorage3 = /*#__PURE__*/function (_Metadata) {
|
|
|
4107
4107
|
function _Class() {
|
|
4108
4108
|
var _this;
|
|
4109
4109
|
_classCallCheck(this, _Class);
|
|
4110
|
-
_this = _callSuper(this, _Class, [_SessionStorage]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
4110
|
+
_this = _callSuper(this, _Class, [_SessionStorage]), _defineProperty(_assertThisInitialized(_this), "$$id", 'SessionStorage'), _initClass$e();
|
|
4111
4111
|
return _this;
|
|
4112
4112
|
}
|
|
4113
4113
|
_inherits(_Class, _identity2);
|
|
@@ -4134,7 +4134,7 @@ new (_Store2 = (_Store3 = /*#__PURE__*/function (_Metadata) {
|
|
|
4134
4134
|
function _Class() {
|
|
4135
4135
|
var _this;
|
|
4136
4136
|
_classCallCheck(this, _Class);
|
|
4137
|
-
_this = _callSuper(this, _Class, [_Store]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
4137
|
+
_this = _callSuper(this, _Class, [_Store]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Store'), _initClass$d();
|
|
4138
4138
|
return _this;
|
|
4139
4139
|
}
|
|
4140
4140
|
_inherits(_Class, _identity2);
|
|
@@ -4256,7 +4256,7 @@ new (_Router2$1 = (_Router3$1 = /*#__PURE__*/function (_Metadata) {
|
|
|
4256
4256
|
function _Class() {
|
|
4257
4257
|
var _this;
|
|
4258
4258
|
_classCallCheck(this, _Class);
|
|
4259
|
-
_this = _callSuper(this, _Class, [_Router$1]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
4259
|
+
_this = _callSuper(this, _Class, [_Router$1]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Router'), _initClass$c();
|
|
4260
4260
|
return _this;
|
|
4261
4261
|
}
|
|
4262
4262
|
_inherits(_Class, _identity2);
|
|
@@ -4287,7 +4287,7 @@ new (_Route2$1 = (_Route3$1 = /*#__PURE__*/function (_Metadata) {
|
|
|
4287
4287
|
function _Class() {
|
|
4288
4288
|
var _this2;
|
|
4289
4289
|
_classCallCheck(this, _Class);
|
|
4290
|
-
_this2 = _callSuper(this, _Class, [_Route$1]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
4290
|
+
_this2 = _callSuper(this, _Class, [_Route$1]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'Route'), _initClass$b();
|
|
4291
4291
|
return _this2;
|
|
4292
4292
|
}
|
|
4293
4293
|
_inherits(_Class, _identity2);
|
|
@@ -4314,7 +4314,7 @@ new (_Router2 = (_Router3 = /*#__PURE__*/_createClass(function Router() {
|
|
|
4314
4314
|
function _Class() {
|
|
4315
4315
|
var _this;
|
|
4316
4316
|
_classCallCheck(this, _Class);
|
|
4317
|
-
_this = _callSuper(this, _Class, [_Router]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
4317
|
+
_this = _callSuper(this, _Class, [_Router]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Router'), _initClass$a();
|
|
4318
4318
|
return _this;
|
|
4319
4319
|
}
|
|
4320
4320
|
_inherits(_Class, _identity2);
|
|
@@ -4453,7 +4453,7 @@ new (_Route2 = (_Route3 = /*#__PURE__*/_createClass(function Route() {
|
|
|
4453
4453
|
function _Class() {
|
|
4454
4454
|
var _this;
|
|
4455
4455
|
_classCallCheck(this, _Class);
|
|
4456
|
-
_this = _callSuper(this, _Class, [_Route]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
4456
|
+
_this = _callSuper(this, _Class, [_Route]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Route'), _initClass$9();
|
|
4457
4457
|
return _this;
|
|
4458
4458
|
}
|
|
4459
4459
|
_inherits(_Class, _identity2);
|
|
@@ -4475,7 +4475,7 @@ new (_Render2$1 = (_Render3$1 = /*#__PURE__*/function (_Metadata) {
|
|
|
4475
4475
|
function _Class() {
|
|
4476
4476
|
var _this;
|
|
4477
4477
|
_classCallCheck(this, _Class);
|
|
4478
|
-
_this = _callSuper(this, _Class, [_Render$1]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
4478
|
+
_this = _callSuper(this, _Class, [_Render$1]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Render'), _initClass$8();
|
|
4479
4479
|
return _this;
|
|
4480
4480
|
}
|
|
4481
4481
|
_inherits(_Class, _identity2);
|
|
@@ -4497,7 +4497,7 @@ new (_Render2 = (_Render3 = /*#__PURE__*/_createClass(function Render() {
|
|
|
4497
4497
|
function _Class() {
|
|
4498
4498
|
var _this;
|
|
4499
4499
|
_classCallCheck(this, _Class);
|
|
4500
|
-
_this = _callSuper(this, _Class, [_Render]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
4500
|
+
_this = _callSuper(this, _Class, [_Render]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Render'), _initClass$7();
|
|
4501
4501
|
return _this;
|
|
4502
4502
|
}
|
|
4503
4503
|
_inherits(_Class, _identity2);
|
|
@@ -8745,7 +8745,7 @@ new (_WebRender2 = (_WebRender3 = /*#__PURE__*/function (_Render) {
|
|
|
8745
8745
|
function _Class() {
|
|
8746
8746
|
var _this2;
|
|
8747
8747
|
_classCallCheck(this, _Class);
|
|
8748
|
-
_this2 = _callSuper(this, _Class, [_WebRender]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
8748
|
+
_this2 = _callSuper(this, _Class, [_WebRender]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'WebRender'), _initClass$6();
|
|
8749
8749
|
return _this2;
|
|
8750
8750
|
}
|
|
8751
8751
|
_inherits(_Class, _identity2);
|
|
@@ -8810,7 +8810,7 @@ new (_HistoryRouter2 = (_HistoryRouter3 = /*#__PURE__*/function (_Router) {
|
|
|
8810
8810
|
function _Class() {
|
|
8811
8811
|
var _this2;
|
|
8812
8812
|
_classCallCheck(this, _Class);
|
|
8813
|
-
_this2 = _callSuper(this, _Class, [_HistoryRouter]), _defineProperty(_assertThisInitialized(_this2), "$$
|
|
8813
|
+
_this2 = _callSuper(this, _Class, [_HistoryRouter]), _defineProperty(_assertThisInitialized(_this2), "$$id", 'HistoryRouter'), _initClass$5();
|
|
8814
8814
|
return _this2;
|
|
8815
8815
|
}
|
|
8816
8816
|
_inherits(_Class, _identity2);
|
|
@@ -8835,7 +8835,7 @@ new (_Util2 = (_Util3 = /*#__PURE__*/function (_Metadata) {
|
|
|
8835
8835
|
function _Class() {
|
|
8836
8836
|
var _this;
|
|
8837
8837
|
_classCallCheck(this, _Class);
|
|
8838
|
-
_this = _callSuper(this, _Class, [_Util]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
8838
|
+
_this = _callSuper(this, _Class, [_Util]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Util'), _initClass$4();
|
|
8839
8839
|
return _this;
|
|
8840
8840
|
}
|
|
8841
8841
|
_inherits(_Class, _identity2);
|
|
@@ -8862,7 +8862,7 @@ new (_Api2 = (_Api3 = /*#__PURE__*/function (_Metadata) {
|
|
|
8862
8862
|
function _Class() {
|
|
8863
8863
|
var _this;
|
|
8864
8864
|
_classCallCheck(this, _Class);
|
|
8865
|
-
_this = _callSuper(this, _Class, [_Api]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
8865
|
+
_this = _callSuper(this, _Class, [_Api]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Api'), _initClass$3();
|
|
8866
8866
|
return _this;
|
|
8867
8867
|
}
|
|
8868
8868
|
_inherits(_Class, _identity2);
|
|
@@ -8889,7 +8889,7 @@ new (_Flow2 = (_Flow3 = /*#__PURE__*/function (_Metadata) {
|
|
|
8889
8889
|
function _Class() {
|
|
8890
8890
|
var _this;
|
|
8891
8891
|
_classCallCheck(this, _Class);
|
|
8892
|
-
_this = _callSuper(this, _Class, [_Flow]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
8892
|
+
_this = _callSuper(this, _Class, [_Flow]), _defineProperty(_assertThisInitialized(_this), "$$id", 'Flow'), _initClass$2();
|
|
8893
8893
|
return _this;
|
|
8894
8894
|
}
|
|
8895
8895
|
_inherits(_Class, _identity2);
|
|
@@ -8917,7 +8917,7 @@ new (_GlobalData2 = (_GlobalData3 = /*#__PURE__*/function (_Metadata) {
|
|
|
8917
8917
|
function _Class() {
|
|
8918
8918
|
var _this;
|
|
8919
8919
|
_classCallCheck(this, _Class);
|
|
8920
|
-
_this = _callSuper(this, _Class, [_GlobalData]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
8920
|
+
_this = _callSuper(this, _Class, [_GlobalData]), _defineProperty(_assertThisInitialized(_this), "$$id", 'GlobalData'), _initClass$1();
|
|
8921
8921
|
return _this;
|
|
8922
8922
|
}
|
|
8923
8923
|
_inherits(_Class, _identity2);
|
|
@@ -8944,7 +8944,7 @@ new (_WebApplication2 = (_WebApplication3 = /*#__PURE__*/function (_Metadata) {
|
|
|
8944
8944
|
function _Class() {
|
|
8945
8945
|
var _this;
|
|
8946
8946
|
_classCallCheck(this, _Class);
|
|
8947
|
-
_this = _callSuper(this, _Class, [_WebApplication]), _defineProperty(_assertThisInitialized(_this), "$$
|
|
8947
|
+
_this = _callSuper(this, _Class, [_WebApplication]), _defineProperty(_assertThisInitialized(_this), "$$id", 'WebApplication'), _initClass();
|
|
8948
8948
|
return _this;
|
|
8949
8949
|
}
|
|
8950
8950
|
_inherits(_Class, _identity2);
|
|
@@ -8959,7 +8959,6 @@ exports.Application = Application;
|
|
|
8959
8959
|
exports.Autowired = Autowired;
|
|
8960
8960
|
exports.Bind = Bind;
|
|
8961
8961
|
exports.Children = Children;
|
|
8962
|
-
exports.Cocoid = Cocoid;
|
|
8963
8962
|
exports.Component = Component;
|
|
8964
8963
|
exports.Configuration = Configuration;
|
|
8965
8964
|
exports.ConstructorParam = ConstructorParam;
|
|
@@ -8967,6 +8966,7 @@ exports.Cookie = Cookie;
|
|
|
8967
8966
|
exports.Flow = Flow;
|
|
8968
8967
|
exports.GlobalData = GlobalData;
|
|
8969
8968
|
exports.HistoryRouter = _HistoryRouter$1;
|
|
8969
|
+
exports.Id = Id;
|
|
8970
8970
|
exports.KindClass = KindClass;
|
|
8971
8971
|
exports.KindField = KindField;
|
|
8972
8972
|
exports.KindMethod = KindMethod;
|
|
@@ -8999,7 +8999,6 @@ exports.WebRender = _WebRender$1;
|
|
|
8999
8999
|
exports.api = api;
|
|
9000
9000
|
exports.autowired = autowired;
|
|
9001
9001
|
exports.bind = bind;
|
|
9002
|
-
exports.cocoid = cocoid;
|
|
9003
9002
|
exports.component = component;
|
|
9004
9003
|
exports.configuration = configuration;
|
|
9005
9004
|
exports.constructorParam = constructorParam;
|
|
@@ -9009,6 +9008,7 @@ exports.createPlaceholderDecoratorExp = createPlaceholderDecoratorExp;
|
|
|
9009
9008
|
exports.defineReactive = defineReactive;
|
|
9010
9009
|
exports.flow = flow;
|
|
9011
9010
|
exports.globalData = globalData;
|
|
9011
|
+
exports.id = id$2;
|
|
9012
9012
|
exports.jsx = jsx;
|
|
9013
9013
|
exports.jsxs = jsx;
|
|
9014
9014
|
exports.layout = layout;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const api: () => Decorator<ClassDecoratorContext>;
|
|
|
15
15
|
export declare class Application {
|
|
16
16
|
componentMetadataClass: ComponentMetadataClass;
|
|
17
17
|
metadataRepository: MetadataRepository;
|
|
18
|
-
|
|
18
|
+
idClassMap: IdClassMap;
|
|
19
19
|
propertiesConfig: PropertiesConfig;
|
|
20
20
|
iocComponentDefinition: IocComponentDefinition;
|
|
21
21
|
iocComponentFactory: IocComponentFactory;
|
|
@@ -61,7 +61,7 @@ export declare class Application {
|
|
|
61
61
|
declare class Application_2 {
|
|
62
62
|
componentMetadataClass: ComponentMetadataClass_2;
|
|
63
63
|
metadataRepository: MetadataRepository_2;
|
|
64
|
-
|
|
64
|
+
idClassMap: IdClassMap_2;
|
|
65
65
|
propertiesConfig: PropertiesConfig_2;
|
|
66
66
|
iocComponentDefinition: IocComponentDefinition_2;
|
|
67
67
|
iocComponentFactory: IocComponentFactory_2;
|
|
@@ -107,7 +107,7 @@ declare class Application_2 {
|
|
|
107
107
|
declare class Application_3 {
|
|
108
108
|
componentMetadataClass: ComponentMetadataClass_3;
|
|
109
109
|
metadataRepository: MetadataRepository_3;
|
|
110
|
-
|
|
110
|
+
idClassMap: IdClassMap_3;
|
|
111
111
|
propertiesConfig: PropertiesConfig_3;
|
|
112
112
|
iocComponentDefinition: IocComponentDefinition_3;
|
|
113
113
|
iocComponentFactory: IocComponentFactory_3;
|
|
@@ -193,63 +193,6 @@ export declare const Children: {
|
|
|
193
193
|
forEach: (children: any, func: any, context: any) => void;
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
/**
|
|
197
|
-
* @public
|
|
198
|
-
*/
|
|
199
|
-
export declare class Cocoid extends Metadata {
|
|
200
|
-
value: string;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export declare const cocoid: (cocoid: string) => Decorator<ClassMethodDecoratorContext>;
|
|
204
|
-
|
|
205
|
-
declare class CocoidClassMap {
|
|
206
|
-
private cocoidClassMap;
|
|
207
|
-
/**
|
|
208
|
-
* * 保存元数据类本身,方便运行是通过id获取元数据类
|
|
209
|
-
* * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
|
|
210
|
-
*/
|
|
211
|
-
constructor(metaMetadataMap: Map<Class<Metadata>, MetaMetadata>);
|
|
212
|
-
/**
|
|
213
|
-
* * 根据cocoId获取元数据类
|
|
214
|
-
* * @param cocoId 元数据类id
|
|
215
|
-
* * @returns 元数据类
|
|
216
|
-
*/
|
|
217
|
-
getMetaClassById(cocoId: string): Class<Metadata>;
|
|
218
|
-
destructor(): void;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
declare class CocoidClassMap_2 {
|
|
222
|
-
private cocoidClassMap;
|
|
223
|
-
/**
|
|
224
|
-
* * 保存元数据类本身,方便运行是通过id获取元数据类
|
|
225
|
-
* * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
|
|
226
|
-
*/
|
|
227
|
-
constructor(metaMetadataMap: Map<Class<Metadata_2>, MetaMetadata_2>);
|
|
228
|
-
/**
|
|
229
|
-
* * 根据cocoId获取元数据类
|
|
230
|
-
* * @param cocoId 元数据类id
|
|
231
|
-
* * @returns 元数据类
|
|
232
|
-
*/
|
|
233
|
-
getMetaClassById(cocoId: string): Class<Metadata_2>;
|
|
234
|
-
destructor(): void;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
declare class CocoidClassMap_3 {
|
|
238
|
-
private cocoidClassMap;
|
|
239
|
-
/**
|
|
240
|
-
* * 保存元数据类本身,方便运行是通过id获取元数据类
|
|
241
|
-
* * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
|
|
242
|
-
*/
|
|
243
|
-
constructor(metaMetadataMap: Map<Class<Metadata_4>, MetaMetadata_3>);
|
|
244
|
-
/**
|
|
245
|
-
* * 根据cocoId获取元数据类
|
|
246
|
-
* * @param cocoId 元数据类id
|
|
247
|
-
* * @returns 元数据类
|
|
248
|
-
*/
|
|
249
|
-
getMetaClassById(cocoId: string): Class<Metadata_4>;
|
|
250
|
-
destructor(): void;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
196
|
/**
|
|
254
197
|
* Component不添加@scope(SCOPE.Singleton)的原因:
|
|
255
198
|
* 因为不设置默认就是singleton,还可以避免 scope <-> target 循环依赖的问题
|
|
@@ -585,11 +528,68 @@ export declare class HistoryRouter extends Router {
|
|
|
585
528
|
navigateTo(url: string): void;
|
|
586
529
|
}
|
|
587
530
|
|
|
588
|
-
|
|
531
|
+
/**
|
|
532
|
+
* @public
|
|
533
|
+
*/
|
|
534
|
+
export declare class Id extends Metadata {
|
|
535
|
+
value: string;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export declare const id: (id: string) => Decorator<ClassMethodDecoratorContext>;
|
|
589
539
|
|
|
590
540
|
declare type Id_2 = string;
|
|
591
541
|
|
|
592
|
-
declare type
|
|
542
|
+
declare type Id_2_2 = string;
|
|
543
|
+
|
|
544
|
+
declare type Id_2_3 = string;
|
|
545
|
+
|
|
546
|
+
declare class IdClassMap {
|
|
547
|
+
private idClassMap;
|
|
548
|
+
/**
|
|
549
|
+
* * 保存元数据类本身,方便运行是通过id获取元数据类
|
|
550
|
+
* * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
|
|
551
|
+
*/
|
|
552
|
+
constructor(metaMetadataMap: Map<Class<Metadata>, MetaMetadata>);
|
|
553
|
+
/**
|
|
554
|
+
* * 根据cocoId获取元数据类
|
|
555
|
+
* * @param id 元数据类id
|
|
556
|
+
* * @returns 元数据类
|
|
557
|
+
*/
|
|
558
|
+
getMetaClassById(id: string): Class<Metadata>;
|
|
559
|
+
destructor(): void;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
declare class IdClassMap_2 {
|
|
563
|
+
private idClassMap;
|
|
564
|
+
/**
|
|
565
|
+
* * 保存元数据类本身,方便运行是通过id获取元数据类
|
|
566
|
+
* * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
|
|
567
|
+
*/
|
|
568
|
+
constructor(metaMetadataMap: Map<Class<Metadata_2>, MetaMetadata_2>);
|
|
569
|
+
/**
|
|
570
|
+
* * 根据cocoId获取元数据类
|
|
571
|
+
* * @param id 元数据类id
|
|
572
|
+
* * @returns 元数据类
|
|
573
|
+
*/
|
|
574
|
+
getMetaClassById(id: string): Class<Metadata_2>;
|
|
575
|
+
destructor(): void;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
declare class IdClassMap_3 {
|
|
579
|
+
private idClassMap;
|
|
580
|
+
/**
|
|
581
|
+
* * 保存元数据类本身,方便运行是通过id获取元数据类
|
|
582
|
+
* * @param metaMetadataMap 元数据类映射map,key是元数据类,value是元数据类的元数据列表
|
|
583
|
+
*/
|
|
584
|
+
constructor(metaMetadataMap: Map<Class<Metadata_4>, MetaMetadata_3>);
|
|
585
|
+
/**
|
|
586
|
+
* * 根据cocoId获取元数据类
|
|
587
|
+
* * @param id 元数据类id
|
|
588
|
+
* * @returns 元数据类
|
|
589
|
+
*/
|
|
590
|
+
getMetaClassById(id: string): Class<Metadata_4>;
|
|
591
|
+
destructor(): void;
|
|
592
|
+
}
|
|
593
593
|
|
|
594
594
|
declare interface IGetter {
|
|
595
595
|
(): any;
|
|
@@ -603,7 +603,7 @@ declare interface IGetter {
|
|
|
603
603
|
* 3. 项目中通过@component方法装饰注册的组件
|
|
604
604
|
*/
|
|
605
605
|
declare interface IocComDef<T> {
|
|
606
|
-
|
|
606
|
+
id: string;
|
|
607
607
|
cls: Class<T>;
|
|
608
608
|
isSingleton: boolean;
|
|
609
609
|
instantiateType: 'new' | 'method';
|
|
@@ -621,7 +621,7 @@ declare interface IocComDef<T> {
|
|
|
621
621
|
* 3. 项目中通过@component方法装饰注册的组件
|
|
622
622
|
*/
|
|
623
623
|
declare interface IocComDef_2<T> {
|
|
624
|
-
|
|
624
|
+
id: string;
|
|
625
625
|
cls: Class<T>;
|
|
626
626
|
isSingleton: boolean;
|
|
627
627
|
instantiateType: 'new' | 'method';
|
|
@@ -639,7 +639,7 @@ declare interface IocComDef_2<T> {
|
|
|
639
639
|
* 3. 项目中通过@component方法装饰注册的组件
|
|
640
640
|
*/
|
|
641
641
|
declare interface IocComDef_3<T> {
|
|
642
|
-
|
|
642
|
+
id: string;
|
|
643
643
|
cls: Class<T>;
|
|
644
644
|
isSingleton: boolean;
|
|
645
645
|
instantiateType: 'new' | 'method';
|
|
@@ -650,10 +650,10 @@ declare interface IocComDef_3<T> {
|
|
|
650
650
|
}
|
|
651
651
|
|
|
652
652
|
declare class IocComponentDefinition {
|
|
653
|
-
idDefinitionMap: Map<
|
|
653
|
+
idDefinitionMap: Map<Id_2, IocComDef<any>>;
|
|
654
654
|
clsDefinitionMap: Map<Class<any>, IocComDef<any>>;
|
|
655
|
-
newIocComponentDefinition<T>(
|
|
656
|
-
addDefinition(cls: Class<any>,
|
|
655
|
+
newIocComponentDefinition<T>(id: string, cls: Class<T>, isSingleton: boolean, instantiateType: 'new' | 'method'): IocComDef<T>;
|
|
656
|
+
addDefinition(cls: Class<any>, id: string, isSingleton: boolean, methodInstantiateOpts?: {
|
|
657
657
|
configurationCls: Class<any>;
|
|
658
658
|
method: string;
|
|
659
659
|
}): void;
|
|
@@ -663,17 +663,17 @@ declare class IocComponentDefinition {
|
|
|
663
663
|
* @param qualifier 如果存在多个后端类,需要通过qualifier指定具体的类id
|
|
664
664
|
* @returns 真正会实例化的类定义
|
|
665
665
|
*/
|
|
666
|
-
getInstantiateDefinition(ClsOrId: Class<any> |
|
|
667
|
-
getDefinition(ClsOrId: Class<any> |
|
|
668
|
-
existDefinition(ClsOrId: Class<any> |
|
|
666
|
+
getInstantiateDefinition(ClsOrId: Class<any> | Id_2, qualifier?: string): IocComDef<any>;
|
|
667
|
+
getDefinition(ClsOrId: Class<any> | Id_2): IocComDef<any>;
|
|
668
|
+
existDefinition(ClsOrId: Class<any> | Id_2): boolean;
|
|
669
669
|
destructor(): void;
|
|
670
670
|
}
|
|
671
671
|
|
|
672
672
|
declare class IocComponentDefinition_2 {
|
|
673
|
-
idDefinitionMap: Map<
|
|
673
|
+
idDefinitionMap: Map<Id_2_2, IocComDef_2<any>>;
|
|
674
674
|
clsDefinitionMap: Map<Class<any>, IocComDef_2<any>>;
|
|
675
|
-
newIocComponentDefinition<T>(
|
|
676
|
-
addDefinition(cls: Class<any>,
|
|
675
|
+
newIocComponentDefinition<T>(id: string, cls: Class<T>, isSingleton: boolean, instantiateType: 'new' | 'method'): IocComDef_2<T>;
|
|
676
|
+
addDefinition(cls: Class<any>, id: string, isSingleton: boolean, methodInstantiateOpts?: {
|
|
677
677
|
configurationCls: Class<any>;
|
|
678
678
|
method: string;
|
|
679
679
|
}): void;
|
|
@@ -683,17 +683,17 @@ declare class IocComponentDefinition_2 {
|
|
|
683
683
|
* @param qualifier 如果存在多个后端类,需要通过qualifier指定具体的类id
|
|
684
684
|
* @returns 真正会实例化的类定义
|
|
685
685
|
*/
|
|
686
|
-
getInstantiateDefinition(ClsOrId: Class<any> |
|
|
687
|
-
getDefinition(ClsOrId: Class<any> |
|
|
688
|
-
existDefinition(ClsOrId: Class<any> |
|
|
686
|
+
getInstantiateDefinition(ClsOrId: Class<any> | Id_2_2, qualifier?: string): IocComDef_2<any>;
|
|
687
|
+
getDefinition(ClsOrId: Class<any> | Id_2_2): IocComDef_2<any>;
|
|
688
|
+
existDefinition(ClsOrId: Class<any> | Id_2_2): boolean;
|
|
689
689
|
destructor(): void;
|
|
690
690
|
}
|
|
691
691
|
|
|
692
692
|
declare class IocComponentDefinition_3 {
|
|
693
|
-
idDefinitionMap: Map<
|
|
693
|
+
idDefinitionMap: Map<Id_2_3, IocComDef_3<any>>;
|
|
694
694
|
clsDefinitionMap: Map<Class<any>, IocComDef_3<any>>;
|
|
695
|
-
newIocComponentDefinition<T>(
|
|
696
|
-
addDefinition(cls: Class<any>,
|
|
695
|
+
newIocComponentDefinition<T>(id: string, cls: Class<T>, isSingleton: boolean, instantiateType: 'new' | 'method'): IocComDef_3<T>;
|
|
696
|
+
addDefinition(cls: Class<any>, id: string, isSingleton: boolean, methodInstantiateOpts?: {
|
|
697
697
|
configurationCls: Class<any>;
|
|
698
698
|
method: string;
|
|
699
699
|
}): void;
|
|
@@ -703,9 +703,9 @@ declare class IocComponentDefinition_3 {
|
|
|
703
703
|
* @param qualifier 如果存在多个后端类,需要通过qualifier指定具体的类id
|
|
704
704
|
* @returns 真正会实例化的类定义
|
|
705
705
|
*/
|
|
706
|
-
getInstantiateDefinition(ClsOrId: Class<any> |
|
|
707
|
-
getDefinition(ClsOrId: Class<any> |
|
|
708
|
-
existDefinition(ClsOrId: Class<any> |
|
|
706
|
+
getInstantiateDefinition(ClsOrId: Class<any> | Id_2_3, qualifier?: string): IocComDef_3<any>;
|
|
707
|
+
getDefinition(ClsOrId: Class<any> | Id_2_3): IocComDef_3<any>;
|
|
708
|
+
existDefinition(ClsOrId: Class<any> | Id_2_3): boolean;
|
|
709
709
|
destructor(): void;
|
|
710
710
|
}
|
|
711
711
|
|