@midwayjs/core 3.20.4 → 4.0.0-beta.1
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/baseFramework.d.ts +14 -39
- package/dist/baseFramework.js +19 -59
- package/dist/common/applicationManager.d.ts +6 -6
- package/dist/common/applicationManager.js +18 -35
- package/dist/common/asyncContextManager.d.ts +15 -0
- package/dist/common/asyncContextManager.js +51 -2
- package/dist/common/dataListener.d.ts +5 -3
- package/dist/common/dataListener.js +13 -4
- package/dist/common/dataSourceManager.d.ts +18 -9
- package/dist/common/dataSourceManager.js +121 -72
- package/dist/common/fileDetector.d.ts +9 -9
- package/dist/common/fileDetector.js +30 -28
- package/dist/common/filterManager.js +5 -4
- package/dist/common/guardManager.js +3 -2
- package/dist/common/middlewareManager.js +4 -3
- package/dist/common/performanceManager.js +1 -1
- package/dist/common/priorityManager.js +2 -2
- package/dist/common/serviceDiscovery/healthCheck.d.ts +66 -0
- package/dist/common/serviceDiscovery/healthCheck.js +207 -0
- package/dist/common/serviceDiscovery/loadBalancer.d.ts +21 -0
- package/dist/common/serviceDiscovery/loadBalancer.js +51 -0
- package/dist/common/serviceDiscovery/serviceDiscovery.d.ts +59 -0
- package/dist/common/serviceDiscovery/serviceDiscovery.js +104 -0
- package/dist/common/serviceFactory.d.ts +5 -2
- package/dist/common/serviceFactory.js +44 -9
- package/dist/common/webGenerator.js +4 -6
- package/dist/config/config.default.js +4 -1
- package/dist/constants.d.ts +2 -32
- package/dist/constants.js +3 -33
- package/dist/context/componentLoader.d.ts +20 -0
- package/dist/context/componentLoader.js +193 -0
- package/dist/context/container.d.ts +18 -32
- package/dist/context/container.js +74 -308
- package/dist/context/definitionRegistry.d.ts +5 -0
- package/dist/context/definitionRegistry.js +17 -26
- package/dist/context/dynamicContainer.d.ts +17 -0
- package/dist/context/dynamicContainer.js +202 -0
- package/dist/context/managedResolverFactory.d.ts +15 -41
- package/dist/context/managedResolverFactory.js +271 -349
- package/dist/context/requestContainer.d.ts +23 -12
- package/dist/context/requestContainer.js +46 -51
- package/dist/decorator/common/aspect.js +4 -4
- package/dist/decorator/common/autoload.js +1 -1
- package/dist/decorator/common/configuration.d.ts +1 -24
- package/dist/decorator/common/configuration.js +6 -1
- package/dist/decorator/common/filter.js +6 -6
- package/dist/decorator/common/framework.d.ts +46 -3
- package/dist/decorator/common/framework.js +43 -9
- package/dist/decorator/common/guard.js +4 -9
- package/dist/decorator/common/inject.d.ts +4 -2
- package/dist/decorator/common/inject.js +87 -4
- package/dist/decorator/common/mock.js +1 -1
- package/dist/decorator/common/objectDef.d.ts +0 -5
- package/dist/decorator/common/objectDef.js +8 -20
- package/dist/decorator/common/provide.d.ts +1 -1
- package/dist/decorator/common/provide.js +1 -1
- package/dist/decorator/common/scope.d.ts +6 -0
- package/dist/decorator/common/scope.js +21 -0
- package/dist/decorator/constant.d.ts +14 -17
- package/dist/decorator/constant.js +23 -35
- package/dist/decorator/decoratorManager.d.ts +21 -294
- package/dist/decorator/decoratorManager.js +127 -694
- package/dist/decorator/faas/serverlessTrigger.js +5 -5
- package/dist/decorator/index.d.ts +2 -3
- package/dist/decorator/index.js +6 -4
- package/dist/decorator/metadataManager.d.ts +131 -0
- package/dist/decorator/metadataManager.js +465 -0
- package/dist/decorator/microservice/consumer.js +3 -2
- package/dist/decorator/microservice/kafkaListener.js +2 -1
- package/dist/decorator/microservice/provider.js +6 -5
- package/dist/decorator/microservice/rabbitmqListener.js +2 -1
- package/dist/decorator/task/queue.js +3 -2
- package/dist/decorator/task/schedule.js +3 -2
- package/dist/decorator/task/task.js +4 -3
- package/dist/decorator/task/taskLocal.js +4 -3
- package/dist/decorator/web/controller.js +3 -2
- package/dist/decorator/web/paramMapping.js +2 -2
- package/dist/decorator/web/requestMapping.js +5 -5
- package/dist/decorator/web/response.js +6 -5
- package/dist/decorator/ws/webSocketController.js +3 -2
- package/dist/decorator/ws/webSocketEvent.js +7 -6
- package/dist/definitions/functionDefinition.d.ts +3 -3
- package/dist/definitions/functionDefinition.js +12 -11
- package/dist/definitions/objectCreator.d.ts +5 -11
- package/dist/definitions/objectCreator.js +6 -28
- package/dist/definitions/objectDefinition.d.ts +2 -3
- package/dist/definitions/objectDefinition.js +1 -3
- package/dist/error/base.js +2 -2
- package/dist/error/framework.d.ts +2 -9
- package/dist/error/framework.js +13 -27
- package/dist/error/http.js +1 -1
- package/dist/functional/configuration.d.ts +14 -15
- package/dist/functional/configuration.js +37 -47
- package/dist/functional/hooks.d.ts +12 -0
- package/dist/functional/hooks.js +78 -0
- package/dist/functional/index.d.ts +3 -0
- package/dist/functional/index.js +22 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +10 -7
- package/dist/interface.d.ts +261 -137
- package/dist/interface.js +23 -33
- package/dist/legacy/constants.d.ts +29 -0
- package/dist/legacy/constants.js +33 -0
- package/dist/legacy/decorator.d.ts +255 -0
- package/dist/legacy/decorator.js +468 -0
- package/dist/legacy/index.d.ts +3 -0
- package/dist/legacy/index.js +19 -0
- package/dist/legacy/types.d.ts +2 -0
- package/dist/legacy/types.js +3 -0
- package/dist/service/aspectService.js +11 -12
- package/dist/service/configService.d.ts +1 -1
- package/dist/service/configService.js +5 -4
- package/dist/service/decoratorService.d.ts +3 -3
- package/dist/service/decoratorService.js +14 -10
- package/dist/service/environmentService.js +2 -2
- package/dist/service/frameworkService.d.ts +5 -4
- package/dist/service/frameworkService.js +30 -28
- package/dist/service/healthService.d.ts +2 -0
- package/dist/service/healthService.js +19 -8
- package/dist/service/informationService.d.ts +3 -0
- package/dist/service/informationService.js +13 -4
- package/dist/service/lifeCycleService.d.ts +13 -7
- package/dist/service/lifeCycleService.js +54 -48
- package/dist/service/loggerService.js +3 -4
- package/dist/service/middlewareService.js +7 -8
- package/dist/service/mockService.js +9 -15
- package/dist/service/slsFunctionService.d.ts +1 -14
- package/dist/service/slsFunctionService.js +33 -81
- package/dist/service/webRouterService.js +11 -11
- package/dist/setup.d.ts +5 -5
- package/dist/setup.js +83 -94
- package/dist/util/contextUtil.d.ts +2 -2
- package/dist/util/httpclient.d.ts +2 -2
- package/dist/util/index.d.ts +16 -17
- package/dist/util/index.js +153 -78
- package/dist/util/network.d.ts +10 -0
- package/dist/util/network.js +40 -0
- package/dist/util/pathFileUtil.d.ts +15 -2
- package/dist/util/pathFileUtil.js +27 -6
- package/dist/util/timeout.d.ts +57 -0
- package/dist/util/timeout.js +144 -0
- package/dist/util/webRouterParam.js +2 -2
- package/package.json +24 -6
- package/dist/decorator/common/pipeline.d.ts +0 -3
- package/dist/decorator/common/pipeline.js +0 -12
- package/dist/decorator/rpc/hsf.d.ts +0 -13
- package/dist/decorator/rpc/hsf.js +0 -20
- package/dist/definitions/properties.d.ts +0 -7
- package/dist/definitions/properties.js +0 -19
- package/dist/service/pipelineService.d.ts +0 -168
- package/dist/service/pipelineService.js +0 -254
package/dist/interface.js
CHANGED
|
@@ -1,54 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ServiceDiscoveryHealthCheckType = exports.LoadBalancerType = exports.MidwayProcessTypeEnum = exports.ObjectLifeCycleEvent = exports.ServerlessTriggerType = exports.MSListenerType = exports.MSProviderType = exports.InjectModeEnum = exports.ScopeEnum = void 0;
|
|
4
4
|
var ScopeEnum;
|
|
5
5
|
(function (ScopeEnum) {
|
|
6
6
|
ScopeEnum["Singleton"] = "Singleton";
|
|
7
7
|
ScopeEnum["Request"] = "Request";
|
|
8
8
|
ScopeEnum["Prototype"] = "Prototype";
|
|
9
|
-
})(ScopeEnum
|
|
9
|
+
})(ScopeEnum || (exports.ScopeEnum = ScopeEnum = {}));
|
|
10
10
|
var InjectModeEnum;
|
|
11
11
|
(function (InjectModeEnum) {
|
|
12
12
|
InjectModeEnum["Identifier"] = "Identifier";
|
|
13
13
|
InjectModeEnum["Class"] = "Class";
|
|
14
|
-
InjectModeEnum["
|
|
15
|
-
})(InjectModeEnum
|
|
14
|
+
InjectModeEnum["SelfName"] = "SelfName";
|
|
15
|
+
})(InjectModeEnum || (exports.InjectModeEnum = InjectModeEnum = {}));
|
|
16
16
|
var MSProviderType;
|
|
17
17
|
(function (MSProviderType) {
|
|
18
18
|
MSProviderType["DUBBO"] = "dubbo";
|
|
19
19
|
MSProviderType["GRPC"] = "gRPC";
|
|
20
|
-
})(MSProviderType
|
|
20
|
+
})(MSProviderType || (exports.MSProviderType = MSProviderType = {}));
|
|
21
21
|
var MSListenerType;
|
|
22
22
|
(function (MSListenerType) {
|
|
23
23
|
MSListenerType["RABBITMQ"] = "rabbitmq";
|
|
24
24
|
MSListenerType["MQTT"] = "mqtt";
|
|
25
25
|
MSListenerType["KAFKA"] = "kafka";
|
|
26
26
|
MSListenerType["REDIS"] = "redis";
|
|
27
|
-
})(MSListenerType
|
|
28
|
-
class FrameworkType {
|
|
29
|
-
}
|
|
30
|
-
exports.FrameworkType = FrameworkType;
|
|
31
|
-
class MidwayFrameworkType extends FrameworkType {
|
|
32
|
-
constructor(name) {
|
|
33
|
-
super();
|
|
34
|
-
this.name = name;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.MidwayFrameworkType = MidwayFrameworkType;
|
|
38
|
-
MidwayFrameworkType.WEB = new MidwayFrameworkType('@midwayjs/web');
|
|
39
|
-
MidwayFrameworkType.WEB_KOA = new MidwayFrameworkType('@midwayjs/web-koa');
|
|
40
|
-
MidwayFrameworkType.WEB_EXPRESS = new MidwayFrameworkType('@midwayjs/express');
|
|
41
|
-
MidwayFrameworkType.FAAS = new MidwayFrameworkType('@midwayjs/faas');
|
|
42
|
-
MidwayFrameworkType.MS_GRPC = new MidwayFrameworkType('@midwayjs/grpc');
|
|
43
|
-
MidwayFrameworkType.MS_RABBITMQ = new MidwayFrameworkType('@midwayjs/rabbitmq');
|
|
44
|
-
MidwayFrameworkType.MS_KAFKA = new MidwayFrameworkType('@midwayjs/kafka');
|
|
45
|
-
MidwayFrameworkType.WS_IO = new MidwayFrameworkType('@midwayjs/socketio');
|
|
46
|
-
MidwayFrameworkType.WS = new MidwayFrameworkType('@midwayjs/ws');
|
|
47
|
-
MidwayFrameworkType.SERVERLESS_APP = new MidwayFrameworkType('@midwayjs/serverless-app');
|
|
48
|
-
MidwayFrameworkType.CUSTOM = new MidwayFrameworkType('');
|
|
49
|
-
MidwayFrameworkType.EMPTY = new MidwayFrameworkType('empty');
|
|
50
|
-
MidwayFrameworkType.LIGHT = new MidwayFrameworkType('light');
|
|
51
|
-
MidwayFrameworkType.TASK = new MidwayFrameworkType('@midwayjs/task');
|
|
27
|
+
})(MSListenerType || (exports.MSListenerType = MSListenerType = {}));
|
|
52
28
|
var ServerlessTriggerType;
|
|
53
29
|
(function (ServerlessTriggerType) {
|
|
54
30
|
ServerlessTriggerType["EVENT"] = "event";
|
|
@@ -63,7 +39,7 @@ var ServerlessTriggerType;
|
|
|
63
39
|
ServerlessTriggerType["HSF"] = "hsf";
|
|
64
40
|
ServerlessTriggerType["MTOP"] = "mtop";
|
|
65
41
|
ServerlessTriggerType["SSR"] = "ssr";
|
|
66
|
-
})(ServerlessTriggerType
|
|
42
|
+
})(ServerlessTriggerType || (exports.ServerlessTriggerType = ServerlessTriggerType = {}));
|
|
67
43
|
var ObjectLifeCycleEvent;
|
|
68
44
|
(function (ObjectLifeCycleEvent) {
|
|
69
45
|
ObjectLifeCycleEvent["BEFORE_BIND"] = "beforeBind";
|
|
@@ -71,10 +47,24 @@ var ObjectLifeCycleEvent;
|
|
|
71
47
|
ObjectLifeCycleEvent["AFTER_CREATED"] = "afterObjectCreated";
|
|
72
48
|
ObjectLifeCycleEvent["AFTER_INIT"] = "afterObjectInit";
|
|
73
49
|
ObjectLifeCycleEvent["BEFORE_DESTROY"] = "beforeObjectDestroy";
|
|
74
|
-
})(ObjectLifeCycleEvent
|
|
50
|
+
})(ObjectLifeCycleEvent || (exports.ObjectLifeCycleEvent = ObjectLifeCycleEvent = {}));
|
|
75
51
|
var MidwayProcessTypeEnum;
|
|
76
52
|
(function (MidwayProcessTypeEnum) {
|
|
77
53
|
MidwayProcessTypeEnum["APPLICATION"] = "APPLICATION";
|
|
78
54
|
MidwayProcessTypeEnum["AGENT"] = "AGENT";
|
|
79
|
-
})(MidwayProcessTypeEnum
|
|
55
|
+
})(MidwayProcessTypeEnum || (exports.MidwayProcessTypeEnum = MidwayProcessTypeEnum = {}));
|
|
56
|
+
/**
|
|
57
|
+
* 负载均衡策略类型
|
|
58
|
+
*/
|
|
59
|
+
exports.LoadBalancerType = {
|
|
60
|
+
RANDOM: 'random',
|
|
61
|
+
ROUND_ROBIN: 'roundRobin',
|
|
62
|
+
};
|
|
63
|
+
exports.ServiceDiscoveryHealthCheckType = {
|
|
64
|
+
SELF: 'self',
|
|
65
|
+
TTL: 'ttl',
|
|
66
|
+
HTTP: 'http',
|
|
67
|
+
TCP: 'tcp',
|
|
68
|
+
CUSTOM: 'custom'
|
|
69
|
+
};
|
|
80
70
|
//# sourceMappingURL=interface.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use OBJECT_DEFINITION_KEY instead
|
|
3
|
+
*/
|
|
4
|
+
export declare const OBJ_DEF_CLS = "common:object_definition";
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use PROPERTY_INJECT_KEY instead
|
|
7
|
+
*/
|
|
8
|
+
export declare const INJECT_TAG = "common:property_inject";
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use ALL_VALUE_KEY instead
|
|
11
|
+
*/
|
|
12
|
+
export declare const ALL = "common:all_value_key";
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use CUSTOM_PROPERTY_INJECT_KEY instead
|
|
15
|
+
*/
|
|
16
|
+
export declare const INJECT_CUSTOM_PROPERTY = "common:custom_property_inject";
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use CUSTOM_METHOD_INJECT_KEY instead
|
|
19
|
+
*/
|
|
20
|
+
export declare const INJECT_CUSTOM_METHOD = "common:custom_method_inject";
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use CUSTOM_PARAM_INJECT_KEY instead
|
|
23
|
+
*/
|
|
24
|
+
export declare const INJECT_CUSTOM_PARAM = "common:custom_param_inject";
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use PROVIDE_KEY instead
|
|
27
|
+
*/
|
|
28
|
+
export declare const TAGGED_CLS = "common:provide";
|
|
29
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TAGGED_CLS = exports.INJECT_CUSTOM_PARAM = exports.INJECT_CUSTOM_METHOD = exports.INJECT_CUSTOM_PROPERTY = exports.ALL = exports.INJECT_TAG = exports.OBJ_DEF_CLS = void 0;
|
|
4
|
+
const decorator_1 = require("../decorator");
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use OBJECT_DEFINITION_KEY instead
|
|
7
|
+
*/
|
|
8
|
+
exports.OBJ_DEF_CLS = decorator_1.OBJECT_DEFINITION_KEY;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use PROPERTY_INJECT_KEY instead
|
|
11
|
+
*/
|
|
12
|
+
exports.INJECT_TAG = decorator_1.PROPERTY_INJECT_KEY;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use ALL_VALUE_KEY instead
|
|
15
|
+
*/
|
|
16
|
+
exports.ALL = decorator_1.ALL_VALUE_KEY;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use CUSTOM_PROPERTY_INJECT_KEY instead
|
|
19
|
+
*/
|
|
20
|
+
exports.INJECT_CUSTOM_PROPERTY = decorator_1.CUSTOM_PROPERTY_INJECT_KEY;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use CUSTOM_METHOD_INJECT_KEY instead
|
|
23
|
+
*/
|
|
24
|
+
exports.INJECT_CUSTOM_METHOD = decorator_1.CUSTOM_METHOD_INJECT_KEY;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use CUSTOM_PARAM_INJECT_KEY instead
|
|
27
|
+
*/
|
|
28
|
+
exports.INJECT_CUSTOM_PARAM = decorator_1.CUSTOM_PARAM_INJECT_KEY;
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Use PROVIDE_KEY instead
|
|
31
|
+
*/
|
|
32
|
+
exports.TAGGED_CLS = decorator_1.PROVIDE_KEY;
|
|
33
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { MethodDecoratorOptions, ObjectDefinitionOptions, ObjectIdentifier, ParamDecoratorOptions, TagPropsMetadata } from '../interface';
|
|
2
|
+
/**
|
|
3
|
+
* save data to class
|
|
4
|
+
* @param decoratorNameKey
|
|
5
|
+
* @param data
|
|
6
|
+
* @param target
|
|
7
|
+
* @param mergeIfExist
|
|
8
|
+
* @since 2.3.0
|
|
9
|
+
* @deprecated Use MetadataManager.defineMetadata instead
|
|
10
|
+
*/
|
|
11
|
+
export declare function saveClassMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, mergeIfExist?: boolean): void;
|
|
12
|
+
/**
|
|
13
|
+
* attach data to class
|
|
14
|
+
* @param decoratorNameKey
|
|
15
|
+
* @param data
|
|
16
|
+
* @param target
|
|
17
|
+
* @param groupBy
|
|
18
|
+
* @since 2.3.0
|
|
19
|
+
* @deprecated Use MetadataManager.attachMetadata instead
|
|
20
|
+
*/
|
|
21
|
+
export declare function attachClassMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, groupBy?: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* get data from class and proto
|
|
24
|
+
* @param decoratorNameKey
|
|
25
|
+
* @param target
|
|
26
|
+
* @param propertyName
|
|
27
|
+
* @param useCache
|
|
28
|
+
* @since 2.3.0
|
|
29
|
+
* @deprecated Use MetadataManager.getMetadata instead
|
|
30
|
+
*/
|
|
31
|
+
export declare function getClassExtendedMetadata<T = any>(decoratorNameKey: ObjectIdentifier, target: any, propertyName?: string, useCache?: boolean): T;
|
|
32
|
+
/**
|
|
33
|
+
* get data from class
|
|
34
|
+
* @param decoratorNameKey
|
|
35
|
+
* @param target
|
|
36
|
+
* @since 2.3.0
|
|
37
|
+
* @deprecated Use MetadataManager.getOwnMetadata instead
|
|
38
|
+
*/
|
|
39
|
+
export declare function getClassMetadata<T = any>(decoratorNameKey: ObjectIdentifier, target: any): T;
|
|
40
|
+
/**
|
|
41
|
+
* save property data to class
|
|
42
|
+
* @param decoratorNameKey
|
|
43
|
+
* @param data
|
|
44
|
+
* @param target
|
|
45
|
+
* @param propertyName
|
|
46
|
+
* @since 2.3.0
|
|
47
|
+
* @deprecated Use MetadataManager.defineMetadata instead
|
|
48
|
+
*/
|
|
49
|
+
export declare function savePropertyDataToClass(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any): void;
|
|
50
|
+
/**
|
|
51
|
+
* attach property data to class
|
|
52
|
+
* @param decoratorNameKey
|
|
53
|
+
* @param data
|
|
54
|
+
* @param target
|
|
55
|
+
* @param propertyName
|
|
56
|
+
* @since 2.3.0
|
|
57
|
+
* @deprecated
|
|
58
|
+
*/
|
|
59
|
+
export declare function attachPropertyDataToClass(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any): void;
|
|
60
|
+
/**
|
|
61
|
+
* get property data from class
|
|
62
|
+
* @param decoratorNameKey
|
|
63
|
+
* @param target
|
|
64
|
+
* @param propertyName
|
|
65
|
+
* @since 2.3.0
|
|
66
|
+
* @deprecated Use MetadataManager.getOwnMetadata instead
|
|
67
|
+
*/
|
|
68
|
+
export declare function getPropertyDataFromClass<T = any>(decoratorNameKey: ObjectIdentifier, target: any, propertyName: any): T;
|
|
69
|
+
/**
|
|
70
|
+
* list property data from class
|
|
71
|
+
* @param decoratorNameKey
|
|
72
|
+
* @param target
|
|
73
|
+
* @since 2.3.0
|
|
74
|
+
* @deprecated
|
|
75
|
+
*/
|
|
76
|
+
export declare function listPropertyDataFromClass(decoratorNameKey: ObjectIdentifier, target: any): any[];
|
|
77
|
+
/**
|
|
78
|
+
* save property data
|
|
79
|
+
* @param decoratorNameKey
|
|
80
|
+
* @param data
|
|
81
|
+
* @param target
|
|
82
|
+
* @param propertyName
|
|
83
|
+
* @since 2.3.0
|
|
84
|
+
* @deprecated Use MetadataManager.defineMetadata instead
|
|
85
|
+
*/
|
|
86
|
+
export declare function savePropertyMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any): void;
|
|
87
|
+
/**
|
|
88
|
+
* attach property data
|
|
89
|
+
* @param decoratorNameKey
|
|
90
|
+
* @param data
|
|
91
|
+
* @param target
|
|
92
|
+
* @param propertyName
|
|
93
|
+
* @since 2.3.0
|
|
94
|
+
* @deprecated
|
|
95
|
+
*/
|
|
96
|
+
export declare function attachPropertyMetadata(decoratorNameKey: ObjectIdentifier, data: any, target: any, propertyName: any): void;
|
|
97
|
+
/**
|
|
98
|
+
* get property data
|
|
99
|
+
* @param decoratorNameKey
|
|
100
|
+
* @param target
|
|
101
|
+
* @param propertyName
|
|
102
|
+
* @since 2.3.0
|
|
103
|
+
* @deprecated Use MetadataManager.getOwnMetadata instead
|
|
104
|
+
*/
|
|
105
|
+
export declare function getPropertyMetadata<T = any>(decoratorNameKey: ObjectIdentifier, target: any, propertyName: any): T;
|
|
106
|
+
/**
|
|
107
|
+
* save preload module by target
|
|
108
|
+
* @param target
|
|
109
|
+
* @since 2.0.0
|
|
110
|
+
* @deprecated Use DecoratorManager.savePreStartModule instead
|
|
111
|
+
*/
|
|
112
|
+
export declare function savePreloadModule(target: any): void;
|
|
113
|
+
/**
|
|
114
|
+
* list preload module
|
|
115
|
+
* @since 2.0.0
|
|
116
|
+
* @deprecated Use DecoratorManager.listPreStartModule instead
|
|
117
|
+
*/
|
|
118
|
+
export declare function listPreloadModule(): any[];
|
|
119
|
+
/**
|
|
120
|
+
* save module to inner map
|
|
121
|
+
* @param decoratorNameKey
|
|
122
|
+
* @param target
|
|
123
|
+
* @since 2.0.0
|
|
124
|
+
* @deprecated Use DecoratorManager.saveModule instead
|
|
125
|
+
*/
|
|
126
|
+
export declare function saveModule(decoratorNameKey: ObjectIdentifier, target: any): void;
|
|
127
|
+
/**
|
|
128
|
+
* list module from decorator key
|
|
129
|
+
* @param decoratorNameKey
|
|
130
|
+
* @param filter
|
|
131
|
+
* @since 2.0.0
|
|
132
|
+
* @deprecated Use DecoratorManager.listModule instead
|
|
133
|
+
*/
|
|
134
|
+
export declare function listModule(decoratorNameKey: ObjectIdentifier, filter?: (module: any) => boolean): any[];
|
|
135
|
+
/**
|
|
136
|
+
* reset module
|
|
137
|
+
* @param decoratorNameKey
|
|
138
|
+
* @since 2.0.0
|
|
139
|
+
* @deprecated Use DecoratorManager.resetModule instead
|
|
140
|
+
*/
|
|
141
|
+
export declare function resetModule(decoratorNameKey: ObjectIdentifier): void;
|
|
142
|
+
/**
|
|
143
|
+
* clear all module
|
|
144
|
+
* @since 3.0.0
|
|
145
|
+
* @deprecated Use DecoratorManager.clearAllModule instead
|
|
146
|
+
*/
|
|
147
|
+
export declare function clearAllModule(): void;
|
|
148
|
+
/**
|
|
149
|
+
* class provider id
|
|
150
|
+
* @since 2.3.0
|
|
151
|
+
* @deprecated Use DecoratorManager.saveProviderId instead
|
|
152
|
+
*/
|
|
153
|
+
export declare function saveProviderId(identifier: ObjectIdentifier, target: any): import("../interface").ClassType;
|
|
154
|
+
/**
|
|
155
|
+
* get provider id from module
|
|
156
|
+
* @since 3.0.0
|
|
157
|
+
* @deprecated Use DecoratorManager.getProviderId instead
|
|
158
|
+
*/
|
|
159
|
+
export declare function getProviderId(module: any): string;
|
|
160
|
+
/**
|
|
161
|
+
* @since 3.0.0
|
|
162
|
+
* @deprecated Use DecoratorManager.getProviderName instead
|
|
163
|
+
*/
|
|
164
|
+
export declare function getProviderName(module: any): string;
|
|
165
|
+
/**
|
|
166
|
+
* get provider uuid from module
|
|
167
|
+
* @since 3.0.0
|
|
168
|
+
* @deprecated Use DecoratorManager.getProviderUUId instead
|
|
169
|
+
*/
|
|
170
|
+
export declare function getProviderUUId(module: any): string;
|
|
171
|
+
/**
|
|
172
|
+
* use @Provide decorator or not
|
|
173
|
+
* @since 3.0.0
|
|
174
|
+
* @deprecated Use DecoratorManager.isProvide instead
|
|
175
|
+
*/
|
|
176
|
+
export declare function isProvide(target: any): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Create a custom property inject
|
|
179
|
+
* @param decoratorKey
|
|
180
|
+
* @param metadata
|
|
181
|
+
* @param impl default true, configuration need decoratorService.registerMethodHandler
|
|
182
|
+
* @since 3.0.0
|
|
183
|
+
* @deprecated Use DecoratorManager.createCustomPropertyDecorator instead
|
|
184
|
+
*/
|
|
185
|
+
export declare function createCustomPropertyDecorator(decoratorKey: string, metadata: any, impl?: boolean): PropertyDecorator;
|
|
186
|
+
/**
|
|
187
|
+
* Create a custom method decorator
|
|
188
|
+
* @param decoratorKey
|
|
189
|
+
* @param metadata
|
|
190
|
+
* @param implOrOptions
|
|
191
|
+
* @since 3.0.0
|
|
192
|
+
* @deprecated Use DecoratorManager.createCustomMethodDecorator instead
|
|
193
|
+
*/
|
|
194
|
+
export declare function createCustomMethodDecorator(decoratorKey: string, metadata: any, implOrOptions?: boolean | MethodDecoratorOptions): MethodDecorator;
|
|
195
|
+
/**
|
|
196
|
+
* Create a custom param decorator
|
|
197
|
+
* @param decoratorKey
|
|
198
|
+
* @param metadata
|
|
199
|
+
* @param implOrOptions
|
|
200
|
+
* @since 3.0.0
|
|
201
|
+
* @deprecated Use DecoratorManager.createCustomParamDecorator instead
|
|
202
|
+
*/
|
|
203
|
+
export declare function createCustomParamDecorator(decoratorKey: string, metadata: any, implOrOptions?: boolean | ParamDecoratorOptions): ParameterDecorator;
|
|
204
|
+
/**
|
|
205
|
+
* get property(method) type from metadata
|
|
206
|
+
* @param target
|
|
207
|
+
* @param methodName
|
|
208
|
+
* @since 3.0.0
|
|
209
|
+
* @deprecated Use MetadataManager.getPropertyType instead
|
|
210
|
+
*/
|
|
211
|
+
export declare function getPropertyType(target: any, methodName: string | symbol): import("../interface").TSDesignType<unknown>;
|
|
212
|
+
/**
|
|
213
|
+
* get parameters type by reflect-metadata
|
|
214
|
+
* @since 3.0.0
|
|
215
|
+
* @deprecated Use MetadataManager.getMethodParamTypes instead
|
|
216
|
+
*/
|
|
217
|
+
export declare function getMethodParamTypes(target: any, methodName: string | symbol): any;
|
|
218
|
+
/**
|
|
219
|
+
* save property inject args
|
|
220
|
+
* @param opts 参数
|
|
221
|
+
* @since 2.3.0
|
|
222
|
+
* @deprecated Use MetadataManager.attachMetadata instead
|
|
223
|
+
*/
|
|
224
|
+
export declare function savePropertyInject(opts: {
|
|
225
|
+
identifier: ObjectIdentifier;
|
|
226
|
+
target: any;
|
|
227
|
+
targetKey: string;
|
|
228
|
+
args?: any;
|
|
229
|
+
}): void;
|
|
230
|
+
/**
|
|
231
|
+
* get property inject args
|
|
232
|
+
* @param target
|
|
233
|
+
* @param useCache
|
|
234
|
+
* @since 2.3.0
|
|
235
|
+
* @deprecated Use MetadataManager.getMetadata instead
|
|
236
|
+
*/
|
|
237
|
+
export declare function getPropertyInject(target: any, useCache?: boolean): {
|
|
238
|
+
[methodName: string]: TagPropsMetadata;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* save class object definition
|
|
242
|
+
* @param target class
|
|
243
|
+
* @param props property data
|
|
244
|
+
* @since 2.3.0
|
|
245
|
+
* @deprecated Use MetadataManager.attachMetadata instead
|
|
246
|
+
*/
|
|
247
|
+
export declare function saveObjectDefinition(target: any, props?: {}): any;
|
|
248
|
+
/**
|
|
249
|
+
* get class object definition from metadata
|
|
250
|
+
* @param target
|
|
251
|
+
* @since 2.3.0
|
|
252
|
+
* @deprecated Use MetadataManager.getPropertiesWithMetadata instead
|
|
253
|
+
*/
|
|
254
|
+
export declare function getObjectDefinition(target: any): ObjectDefinitionOptions;
|
|
255
|
+
//# sourceMappingURL=decorator.d.ts.map
|