@eggjs/dynamic-inject 4.0.0-beta.34 → 4.0.0-beta.36
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.
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { EggAbstractClazz, ImplDecorator, ImplTypeEnum, QualifierAttribute } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/QualifierImplDecoratorUtil.d.ts
|
|
4
|
+
declare class QualifierImplDecoratorUtil {
|
|
5
|
+
static generatorDecorator<T extends object, Enum extends ImplTypeEnum>(abstractClazz: EggAbstractClazz<T>, attribute: QualifierAttribute): ImplDecorator<T, Enum>;
|
|
4
6
|
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { QualifierImplDecoratorUtil };
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { QualifierUtil } from '@eggjs/core-decorator';
|
|
2
1
|
import { QualifierImplUtil } from "./QualifierImplUtil.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
2
|
+
import { QualifierUtil } from "@eggjs/core-decorator";
|
|
3
|
+
|
|
4
|
+
//#region src/QualifierImplDecoratorUtil.ts
|
|
5
|
+
var QualifierImplDecoratorUtil = class {
|
|
6
|
+
static generatorDecorator(abstractClazz, attribute) {
|
|
7
|
+
return function(type) {
|
|
8
|
+
return function(clazz) {
|
|
9
|
+
QualifierImplUtil.addQualifierImpl(abstractClazz, type, clazz);
|
|
10
|
+
QualifierUtil.addProtoQualifier(clazz, attribute, type);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { QualifierImplDecoratorUtil };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { EggAbstractClazz, EggProtoImplClass, QualifierValue } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/QualifierImplUtil.d.ts
|
|
4
|
+
declare class QualifierImplUtil {
|
|
5
|
+
static addQualifierImpl(abstractClazz: EggAbstractClazz, qualifierValue: QualifierValue, implClazz: EggProtoImplClass): void;
|
|
6
|
+
static getQualifierImp(abstractClazz: EggAbstractClazz, qualifierValue: QualifierValue): EggProtoImplClass | undefined;
|
|
7
|
+
static getQualifierImpMap(abstractClazz: EggAbstractClazz): Map<QualifierValue, EggProtoImplClass>;
|
|
6
8
|
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { QualifierImplUtil };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { MetadataUtil } from
|
|
2
|
-
import { QUALIFIER_IMPL_MAP } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//#
|
|
1
|
+
import { MetadataUtil } from "@eggjs/core-decorator";
|
|
2
|
+
import { QUALIFIER_IMPL_MAP } from "@eggjs/tegg-types";
|
|
3
|
+
|
|
4
|
+
//#region src/QualifierImplUtil.ts
|
|
5
|
+
var QualifierImplUtil = class {
|
|
6
|
+
static addQualifierImpl(abstractClazz, qualifierValue, implClazz) {
|
|
7
|
+
MetadataUtil.initOwnMapMetaData(QUALIFIER_IMPL_MAP, abstractClazz, /* @__PURE__ */ new Map()).set(qualifierValue, implClazz);
|
|
8
|
+
}
|
|
9
|
+
static getQualifierImp(abstractClazz, qualifierValue) {
|
|
10
|
+
return MetadataUtil.getMetaData(QUALIFIER_IMPL_MAP, abstractClazz)?.get(qualifierValue);
|
|
11
|
+
}
|
|
12
|
+
static getQualifierImpMap(abstractClazz) {
|
|
13
|
+
return MetadataUtil.getMetaData(QUALIFIER_IMPL_MAP, abstractClazz) || /* @__PURE__ */ new Map();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { QualifierImplUtil };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from
|
|
1
|
+
import { QualifierImplUtil } from "./QualifierImplUtil.js";
|
|
2
|
+
import { QualifierImplDecoratorUtil } from "./QualifierImplDecoratorUtil.js";
|
|
3
|
+
export * from "@eggjs/tegg-types/dynamic-inject";
|
|
4
|
+
export { QualifierImplDecoratorUtil, QualifierImplUtil };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { QualifierImplUtil } from "./QualifierImplUtil.js";
|
|
2
|
+
import { QualifierImplDecoratorUtil } from "./QualifierImplDecoratorUtil.js";
|
|
3
|
+
|
|
4
|
+
export * from "@eggjs/tegg-types/dynamic-inject"
|
|
5
|
+
|
|
6
|
+
export { QualifierImplDecoratorUtil, QualifierImplUtil };
|
package/package.json
CHANGED
|
@@ -1,55 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/dynamic-inject",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.36",
|
|
4
4
|
"description": "tegg dynamic inject decorator",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": "./dist/index.js",
|
|
8
|
-
"./package.json": "./package.json"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
5
|
"keywords": [
|
|
14
6
|
"egg",
|
|
15
|
-
"typescript",
|
|
16
7
|
"runtime",
|
|
17
|
-
"tegg"
|
|
8
|
+
"tegg",
|
|
9
|
+
"typescript"
|
|
18
10
|
],
|
|
19
|
-
"author": "killagu <killa123@126.com>",
|
|
20
|
-
"license": "MIT",
|
|
21
11
|
"homepage": "https://github.com/eggjs/egg/tree/next/tegg/core/dynamic-inject",
|
|
22
12
|
"bugs": {
|
|
23
13
|
"url": "https://github.com/eggjs/egg/issues"
|
|
24
14
|
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "killagu <killa123@126.com>",
|
|
25
17
|
"repository": {
|
|
26
18
|
"type": "git",
|
|
27
|
-
"url": "git
|
|
19
|
+
"url": "git+https://github.com/eggjs/egg.git",
|
|
28
20
|
"directory": "tegg/core/dynamic-inject"
|
|
29
21
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.js",
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@eggjs/core-decorator": "4.0.0-beta.
|
|
38
|
-
"@eggjs/tegg-types": "4.0.0-beta.
|
|
37
|
+
"@eggjs/core-decorator": "4.0.0-beta.36",
|
|
38
|
+
"@eggjs/tegg-types": "4.0.0-beta.36"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@types/node": "^24.
|
|
41
|
+
"@types/node": "^24.10.2",
|
|
42
42
|
"coffee": "5",
|
|
43
|
-
"typescript": "^5.9.3"
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
"typescript": "^5.9.3"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=22.18.0"
|
|
46
47
|
},
|
|
47
|
-
"main": "./dist/index.js",
|
|
48
|
-
"module": "./dist/index.js",
|
|
49
|
-
"types": "./dist/index.d.ts",
|
|
50
48
|
"scripts": {
|
|
51
|
-
"
|
|
52
|
-
"build": "tsdown && npm run clean && tsc -p tsconfig.build.json",
|
|
53
|
-
"typecheck": "tsc --noEmit"
|
|
49
|
+
"typecheck": "tsgo --noEmit"
|
|
54
50
|
}
|
|
55
51
|
}
|