@antelopejs/core 0.0.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/LICENSE +190 -0
- package/README.md +52 -0
- package/dist/cli/common.d.ts +21 -0
- package/dist/cli/common.js +86 -0
- package/dist/cli/common.js.map +1 -0
- package/dist/cli/config/get.d.ts +2 -0
- package/dist/cli/config/get.js +36 -0
- package/dist/cli/config/get.js.map +1 -0
- package/dist/cli/config/index.d.ts +2 -0
- package/dist/cli/config/index.js +20 -0
- package/dist/cli/config/index.js.map +1 -0
- package/dist/cli/config/reset.d.ts +2 -0
- package/dist/cli/config/reset.js +88 -0
- package/dist/cli/config/reset.js.map +1 -0
- package/dist/cli/config/set.d.ts +2 -0
- package/dist/cli/config/set.js +46 -0
- package/dist/cli/config/set.js.map +1 -0
- package/dist/cli/config/show.d.ts +2 -0
- package/dist/cli/config/show.js +27 -0
- package/dist/cli/config/show.js.map +1 -0
- package/dist/cli/git.d.ts +49 -0
- package/dist/cli/git.js +248 -0
- package/dist/cli/git.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +61 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/module/exports/generate.d.ts +2 -0
- package/dist/cli/module/exports/generate.js +178 -0
- package/dist/cli/module/exports/generate.js.map +1 -0
- package/dist/cli/module/exports/index.d.ts +2 -0
- package/dist/cli/module/exports/index.js +16 -0
- package/dist/cli/module/exports/index.js.map +1 -0
- package/dist/cli/module/exports/set.d.ts +2 -0
- package/dist/cli/module/exports/set.js +43 -0
- package/dist/cli/module/exports/set.js.map +1 -0
- package/dist/cli/module/imports/add.d.ts +9 -0
- package/dist/cli/module/imports/add.js +127 -0
- package/dist/cli/module/imports/add.js.map +1 -0
- package/dist/cli/module/imports/index.d.ts +2 -0
- package/dist/cli/module/imports/index.js +20 -0
- package/dist/cli/module/imports/index.js.map +1 -0
- package/dist/cli/module/imports/list.d.ts +2 -0
- package/dist/cli/module/imports/list.js +89 -0
- package/dist/cli/module/imports/list.js.map +1 -0
- package/dist/cli/module/imports/remove.d.ts +2 -0
- package/dist/cli/module/imports/remove.js +97 -0
- package/dist/cli/module/imports/remove.js.map +1 -0
- package/dist/cli/module/imports/update.d.ts +2 -0
- package/dist/cli/module/imports/update.js +157 -0
- package/dist/cli/module/imports/update.js.map +1 -0
- package/dist/cli/module/index.d.ts +2 -0
- package/dist/cli/module/index.js +20 -0
- package/dist/cli/module/index.js.map +1 -0
- package/dist/cli/module/init.d.ts +7 -0
- package/dist/cli/module/init.js +120 -0
- package/dist/cli/module/init.js.map +1 -0
- package/dist/cli/module/test.d.ts +3 -0
- package/dist/cli/module/test.js +33 -0
- package/dist/cli/module/test.js.map +1 -0
- package/dist/cli/project/index.d.ts +2 -0
- package/dist/cli/project/index.js +20 -0
- package/dist/cli/project/index.js.map +1 -0
- package/dist/cli/project/init.d.ts +2 -0
- package/dist/cli/project/init.js +122 -0
- package/dist/cli/project/init.js.map +1 -0
- package/dist/cli/project/logging/index.d.ts +2 -0
- package/dist/cli/project/logging/index.js +16 -0
- package/dist/cli/project/logging/index.js.map +1 -0
- package/dist/cli/project/logging/set.d.ts +2 -0
- package/dist/cli/project/logging/set.js +352 -0
- package/dist/cli/project/logging/set.js.map +1 -0
- package/dist/cli/project/logging/show.d.ts +2 -0
- package/dist/cli/project/logging/show.js +92 -0
- package/dist/cli/project/logging/show.js.map +1 -0
- package/dist/cli/project/modules/add.d.ts +11 -0
- package/dist/cli/project/modules/add.js +157 -0
- package/dist/cli/project/modules/add.js.map +1 -0
- package/dist/cli/project/modules/fix.d.ts +2 -0
- package/dist/cli/project/modules/fix.js +201 -0
- package/dist/cli/project/modules/fix.js.map +1 -0
- package/dist/cli/project/modules/index.d.ts +2 -0
- package/dist/cli/project/modules/index.js +20 -0
- package/dist/cli/project/modules/index.js.map +1 -0
- package/dist/cli/project/modules/remove.d.ts +9 -0
- package/dist/cli/project/modules/remove.js +102 -0
- package/dist/cli/project/modules/remove.js.map +1 -0
- package/dist/cli/project/modules/update.d.ts +2 -0
- package/dist/cli/project/modules/update.js +117 -0
- package/dist/cli/project/modules/update.js.map +1 -0
- package/dist/cli/project/run.d.ts +2 -0
- package/dist/cli/project/run.js +107 -0
- package/dist/cli/project/run.js.map +1 -0
- package/dist/common/cache.d.ts +14 -0
- package/dist/common/cache.js +100 -0
- package/dist/common/cache.js.map +1 -0
- package/dist/common/config.d.ts +54 -0
- package/dist/common/config.js +160 -0
- package/dist/common/config.js.map +1 -0
- package/dist/common/downloader/git.d.ts +8 -0
- package/dist/common/downloader/git.js +61 -0
- package/dist/common/downloader/git.js.map +1 -0
- package/dist/common/downloader/index.d.ts +10 -0
- package/dist/common/downloader/index.js +57 -0
- package/dist/common/downloader/index.js.map +1 -0
- package/dist/common/downloader/local.d.ts +11 -0
- package/dist/common/downloader/local.js +58 -0
- package/dist/common/downloader/local.js.map +1 -0
- package/dist/common/downloader/package.d.ts +6 -0
- package/dist/common/downloader/package.js +53 -0
- package/dist/common/downloader/package.js.map +1 -0
- package/dist/common/manifest.d.ts +45 -0
- package/dist/common/manifest.js +116 -0
- package/dist/common/manifest.js.map +1 -0
- package/dist/eslint.config.d.mts +2 -0
- package/dist/eslint.config.mjs +85 -0
- package/dist/eslint.config.mjs.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/core/1/decorators.d.ts +29 -0
- package/dist/interfaces/core/1/decorators.js +72 -0
- package/dist/interfaces/core/1/decorators.js.map +1 -0
- package/dist/interfaces/core/1/index.d.ts +54 -0
- package/dist/interfaces/core/1/index.js +237 -0
- package/dist/interfaces/core/1/index.js.map +1 -0
- package/dist/interfaces/core/1/modules.d.ts +26 -0
- package/dist/interfaces/core/1/modules.js +31 -0
- package/dist/interfaces/core/1/modules.js.map +1 -0
- package/dist/interfaces/core/beta/decorators.d.ts +29 -0
- package/dist/interfaces/core/beta/decorators.js +72 -0
- package/dist/interfaces/core/beta/decorators.js.map +1 -0
- package/dist/interfaces/core/beta/index.d.ts +54 -0
- package/dist/interfaces/core/beta/index.js +237 -0
- package/dist/interfaces/core/beta/index.js.map +1 -0
- package/dist/interfaces/core/beta/modules.d.ts +26 -0
- package/dist/interfaces/core/beta/modules.js +31 -0
- package/dist/interfaces/core/beta/modules.js.map +1 -0
- package/dist/interfaces/logging/1/index.d.ts +16 -0
- package/dist/interfaces/logging/1/index.js +49 -0
- package/dist/interfaces/logging/1/index.js.map +1 -0
- package/dist/interfaces/logging/1/listener.d.ts +9 -0
- package/dist/interfaces/logging/1/listener.js +5 -0
- package/dist/interfaces/logging/1/listener.js.map +1 -0
- package/dist/interfaces/logging/beta/index.d.ts +16 -0
- package/dist/interfaces/logging/beta/index.js +49 -0
- package/dist/interfaces/logging/beta/index.js.map +1 -0
- package/dist/interfaces/logging/beta/listener.d.ts +9 -0
- package/dist/interfaces/logging/beta/listener.js +5 -0
- package/dist/interfaces/logging/beta/listener.js.map +1 -0
- package/dist/loader/index.d.ts +45 -0
- package/dist/loader/index.js +472 -0
- package/dist/loader/index.js.map +1 -0
- package/dist/loader/module.d.ts +29 -0
- package/dist/loader/module.js +142 -0
- package/dist/loader/module.js.map +1 -0
- package/dist/logging/index.d.ts +5 -0
- package/dist/logging/index.js +124 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/src/cli/common.d.ts +18 -0
- package/dist/src/cli/common.js +105 -0
- package/dist/src/cli/common.js.map +1 -0
- package/dist/src/cli/config/get.d.ts +2 -0
- package/dist/src/cli/config/get.js +36 -0
- package/dist/src/cli/config/get.js.map +1 -0
- package/dist/src/cli/config/index.d.ts +2 -0
- package/dist/src/cli/config/index.js +20 -0
- package/dist/src/cli/config/index.js.map +1 -0
- package/dist/src/cli/config/reset.d.ts +2 -0
- package/dist/src/cli/config/reset.js +88 -0
- package/dist/src/cli/config/reset.js.map +1 -0
- package/dist/src/cli/config/set.d.ts +2 -0
- package/dist/src/cli/config/set.js +42 -0
- package/dist/src/cli/config/set.js.map +1 -0
- package/dist/src/cli/config/show.d.ts +2 -0
- package/dist/src/cli/config/show.js +27 -0
- package/dist/src/cli/config/show.js.map +1 -0
- package/dist/src/cli/git.d.ts +43 -0
- package/dist/src/cli/git.js +227 -0
- package/dist/src/cli/git.js.map +1 -0
- package/dist/src/cli/index.d.ts +2 -0
- package/dist/src/cli/index.js +43 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/module/exports/generate.d.ts +2 -0
- package/dist/src/cli/module/exports/generate.js +71 -0
- package/dist/src/cli/module/exports/generate.js.map +1 -0
- package/dist/src/cli/module/exports/index.d.ts +2 -0
- package/dist/src/cli/module/exports/index.js +16 -0
- package/dist/src/cli/module/exports/index.js.map +1 -0
- package/dist/src/cli/module/exports/set.d.ts +2 -0
- package/dist/src/cli/module/exports/set.js +43 -0
- package/dist/src/cli/module/exports/set.js.map +1 -0
- package/dist/src/cli/module/imports/add.d.ts +9 -0
- package/dist/src/cli/module/imports/add.js +98 -0
- package/dist/src/cli/module/imports/add.js.map +1 -0
- package/dist/src/cli/module/imports/index.d.ts +2 -0
- package/dist/src/cli/module/imports/index.js +20 -0
- package/dist/src/cli/module/imports/index.js.map +1 -0
- package/dist/src/cli/module/imports/list.d.ts +2 -0
- package/dist/src/cli/module/imports/list.js +89 -0
- package/dist/src/cli/module/imports/list.js.map +1 -0
- package/dist/src/cli/module/imports/remove.d.ts +2 -0
- package/dist/src/cli/module/imports/remove.js +97 -0
- package/dist/src/cli/module/imports/remove.js.map +1 -0
- package/dist/src/cli/module/imports/update.d.ts +2 -0
- package/dist/src/cli/module/imports/update.js +129 -0
- package/dist/src/cli/module/imports/update.js.map +1 -0
- package/dist/src/cli/module/index.d.ts +2 -0
- package/dist/src/cli/module/index.js +20 -0
- package/dist/src/cli/module/index.js.map +1 -0
- package/dist/src/cli/module/init.d.ts +7 -0
- package/dist/src/cli/module/init.js +136 -0
- package/dist/src/cli/module/init.js.map +1 -0
- package/dist/src/cli/module/test.d.ts +6 -0
- package/dist/src/cli/module/test.js +20 -0
- package/dist/src/cli/module/test.js.map +1 -0
- package/dist/src/cli/project/index.d.ts +2 -0
- package/dist/src/cli/project/index.js +20 -0
- package/dist/src/cli/project/index.js.map +1 -0
- package/dist/src/cli/project/init.d.ts +2 -0
- package/dist/src/cli/project/init.js +116 -0
- package/dist/src/cli/project/init.js.map +1 -0
- package/dist/src/cli/project/logging/index.d.ts +2 -0
- package/dist/src/cli/project/logging/index.js +16 -0
- package/dist/src/cli/project/logging/index.js.map +1 -0
- package/dist/src/cli/project/logging/set.d.ts +2 -0
- package/dist/src/cli/project/logging/set.js +353 -0
- package/dist/src/cli/project/logging/set.js.map +1 -0
- package/dist/src/cli/project/logging/show.d.ts +2 -0
- package/dist/src/cli/project/logging/show.js +93 -0
- package/dist/src/cli/project/logging/show.js.map +1 -0
- package/dist/src/cli/project/modules/add.d.ts +11 -0
- package/dist/src/cli/project/modules/add.js +161 -0
- package/dist/src/cli/project/modules/add.js.map +1 -0
- package/dist/src/cli/project/modules/fix.d.ts +2 -0
- package/dist/src/cli/project/modules/fix.js +224 -0
- package/dist/src/cli/project/modules/fix.js.map +1 -0
- package/dist/src/cli/project/modules/index.d.ts +2 -0
- package/dist/src/cli/project/modules/index.js +20 -0
- package/dist/src/cli/project/modules/index.js.map +1 -0
- package/dist/src/cli/project/modules/remove.d.ts +9 -0
- package/dist/src/cli/project/modules/remove.js +102 -0
- package/dist/src/cli/project/modules/remove.js.map +1 -0
- package/dist/src/cli/project/modules/update.d.ts +2 -0
- package/dist/src/cli/project/modules/update.js +117 -0
- package/dist/src/cli/project/modules/update.js.map +1 -0
- package/dist/src/cli/project/run.d.ts +2 -0
- package/dist/src/cli/project/run.js +60 -0
- package/dist/src/cli/project/run.js.map +1 -0
- package/dist/src/common/cache.d.ts +14 -0
- package/dist/src/common/cache.js +99 -0
- package/dist/src/common/cache.js.map +1 -0
- package/dist/src/common/config.d.ts +58 -0
- package/dist/src/common/config.js +159 -0
- package/dist/src/common/config.js.map +1 -0
- package/dist/src/common/downloader/git.d.ts +8 -0
- package/dist/src/common/downloader/git.js +64 -0
- package/dist/src/common/downloader/git.js.map +1 -0
- package/dist/src/common/downloader/index.d.ts +10 -0
- package/dist/src/common/downloader/index.js +50 -0
- package/dist/src/common/downloader/index.js.map +1 -0
- package/dist/src/common/downloader/local.d.ts +11 -0
- package/dist/src/common/downloader/local.js +39 -0
- package/dist/src/common/downloader/local.js.map +1 -0
- package/dist/src/common/downloader/package.d.ts +6 -0
- package/dist/src/common/downloader/package.js +79 -0
- package/dist/src/common/downloader/package.js.map +1 -0
- package/dist/src/common/manifest.d.ts +45 -0
- package/dist/src/common/manifest.js +114 -0
- package/dist/src/common/manifest.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +117 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interfaces/core/1/decorators.d.ts +29 -0
- package/dist/src/interfaces/core/1/decorators.js +72 -0
- package/dist/src/interfaces/core/1/decorators.js.map +1 -0
- package/dist/src/interfaces/core/1/index.d.ts +54 -0
- package/dist/src/interfaces/core/1/index.js +237 -0
- package/dist/src/interfaces/core/1/index.js.map +1 -0
- package/dist/src/interfaces/core/1/modules.d.ts +26 -0
- package/dist/src/interfaces/core/1/modules.js +31 -0
- package/dist/src/interfaces/core/1/modules.js.map +1 -0
- package/dist/src/interfaces/logging/1/index.d.ts +16 -0
- package/dist/src/interfaces/logging/1/index.js +49 -0
- package/dist/src/interfaces/logging/1/index.js.map +1 -0
- package/dist/src/interfaces/logging/1/listener.d.ts +9 -0
- package/dist/src/interfaces/logging/1/listener.js +5 -0
- package/dist/src/interfaces/logging/1/listener.js.map +1 -0
- package/dist/src/loader/index.d.ts +42 -0
- package/dist/src/loader/index.js +428 -0
- package/dist/src/loader/index.js.map +1 -0
- package/dist/src/loader/module.d.ts +29 -0
- package/dist/src/loader/module.js +139 -0
- package/dist/src/loader/module.js.map +1 -0
- package/dist/src/logging/index.d.ts +5 -0
- package/dist/src/logging/index.js +118 -0
- package/dist/src/logging/index.js.map +1 -0
- package/dist/src/utils/cli-ui.d.ts +34 -0
- package/dist/src/utils/cli-ui.js +173 -0
- package/dist/src/utils/cli-ui.js.map +1 -0
- package/dist/src/utils/command.d.ts +3 -0
- package/dist/src/utils/command.js +33 -0
- package/dist/src/utils/command.js.map +1 -0
- package/dist/src/utils/object.d.ts +2 -0
- package/dist/src/utils/object.js +26 -0
- package/dist/src/utils/object.js.map +1 -0
- package/dist/src/utils/promise.d.ts +3 -0
- package/dist/src/utils/promise.js +24 -0
- package/dist/src/utils/promise.js.map +1 -0
- package/dist/utils/antelope-runner.d.ts +1 -0
- package/dist/utils/antelope-runner.js +29 -0
- package/dist/utils/antelope-runner.js.map +1 -0
- package/dist/utils/cli-ui.d.ts +34 -0
- package/dist/utils/cli-ui.js +173 -0
- package/dist/utils/cli-ui.js.map +1 -0
- package/dist/utils/command.d.ts +2 -0
- package/dist/utils/command.js +19 -0
- package/dist/utils/command.js.map +1 -0
- package/dist/utils/logger.d.ts +5 -0
- package/dist/utils/logger.js +14 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/object.d.ts +2 -0
- package/dist/utils/object.js +26 -0
- package/dist/utils/object.js.map +1 -0
- package/dist/utils/package-manager.d.ts +3 -0
- package/dist/utils/package-manager.js +39 -0
- package/dist/utils/package-manager.js.map +1 -0
- package/dist/utils/promise.d.ts +3 -0
- package/dist/utils/promise.js +24 -0
- package/dist/utils/promise.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.internal = exports.EventProxy = exports.RegisteringProxy = exports.AsyncProxy = void 0;
|
|
4
|
+
exports.GetResponsibleModule = GetResponsibleModule;
|
|
5
|
+
exports.GetMetadata = GetMetadata;
|
|
6
|
+
exports.InterfaceFunction = InterfaceFunction;
|
|
7
|
+
exports.ImplementInterface = ImplementInterface;
|
|
8
|
+
exports.GetInterfaceInstances = GetInterfaceInstances;
|
|
9
|
+
exports.GetInterfaceInstance = GetInterfaceInstance;
|
|
10
|
+
require("reflect-metadata");
|
|
11
|
+
class AsyncProxy {
|
|
12
|
+
callback;
|
|
13
|
+
queue = [];
|
|
14
|
+
onCall(callback, manualDetach) {
|
|
15
|
+
this.callback = callback;
|
|
16
|
+
if (!manualDetach) {
|
|
17
|
+
const caller = GetResponsibleModule();
|
|
18
|
+
if (caller) {
|
|
19
|
+
internal.addAsyncProxy(caller, this);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (this.queue.length > 0) {
|
|
23
|
+
this.queue.forEach(({ args, resolve, reject }) => {
|
|
24
|
+
try {
|
|
25
|
+
resolve(callback(...args));
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
reject(err);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
this.queue.splice(0, this.queue.length);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
detach() {
|
|
35
|
+
this.callback = undefined;
|
|
36
|
+
}
|
|
37
|
+
call(...args) {
|
|
38
|
+
if (this.callback) {
|
|
39
|
+
return Promise.resolve(this.callback(...args));
|
|
40
|
+
}
|
|
41
|
+
return new Promise((resolve, reject) => this.queue.push({ args, resolve, reject }));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.AsyncProxy = AsyncProxy;
|
|
45
|
+
class RegisteringProxy {
|
|
46
|
+
registerCallback;
|
|
47
|
+
unregisterCallback;
|
|
48
|
+
registered = new Map();
|
|
49
|
+
onRegister(callback, manualDetach) {
|
|
50
|
+
this.registerCallback = callback;
|
|
51
|
+
if (!manualDetach) {
|
|
52
|
+
const caller = GetResponsibleModule();
|
|
53
|
+
if (caller) {
|
|
54
|
+
internal.addRegisteringProxy(caller, this);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
for (const [id, { args }] of this.registered) {
|
|
58
|
+
callback(id, ...args);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
onUnregister(callback) {
|
|
62
|
+
this.unregisterCallback = callback;
|
|
63
|
+
}
|
|
64
|
+
detach() {
|
|
65
|
+
this.registerCallback = undefined;
|
|
66
|
+
this.unregisterCallback = undefined;
|
|
67
|
+
}
|
|
68
|
+
register(id, ...args) {
|
|
69
|
+
const module = GetResponsibleModule();
|
|
70
|
+
this.registered.set(id, { module, args });
|
|
71
|
+
if (this.registerCallback) {
|
|
72
|
+
this.registerCallback(id, ...args);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
unregister(id) {
|
|
76
|
+
if (this.registered.has(id)) {
|
|
77
|
+
if (this.unregisterCallback) {
|
|
78
|
+
this.unregisterCallback(id);
|
|
79
|
+
}
|
|
80
|
+
this.registered.delete(id);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
unregisterModule(mod) {
|
|
84
|
+
for (const [id, { module }] of this.registered) {
|
|
85
|
+
if (module === mod) {
|
|
86
|
+
if (this.unregisterCallback) {
|
|
87
|
+
this.unregisterCallback(id);
|
|
88
|
+
}
|
|
89
|
+
this.registered.delete(id);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.RegisteringProxy = RegisteringProxy;
|
|
95
|
+
class EventProxy {
|
|
96
|
+
registered = [];
|
|
97
|
+
constructor() {
|
|
98
|
+
internal.knownEvents.push(this);
|
|
99
|
+
}
|
|
100
|
+
emit(...args) {
|
|
101
|
+
for (const { func } of this.registered) {
|
|
102
|
+
func(...args);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
register(func) {
|
|
106
|
+
const module = GetResponsibleModule();
|
|
107
|
+
this.registered.push({ module, func });
|
|
108
|
+
}
|
|
109
|
+
unregister(fn) {
|
|
110
|
+
this.registered = this.registered.filter(({ func }) => func !== fn);
|
|
111
|
+
}
|
|
112
|
+
unregisterModule(mod) {
|
|
113
|
+
this.registered = this.registered.filter(({ module }) => module !== mod);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.EventProxy = EventProxy;
|
|
117
|
+
var internal;
|
|
118
|
+
(function (internal) {
|
|
119
|
+
internal.moduleByFolder = new Array();
|
|
120
|
+
internal.knownAsync = new Map();
|
|
121
|
+
internal.knownRegisters = new Map();
|
|
122
|
+
internal.knownEvents = new Array();
|
|
123
|
+
function addAsyncProxy(module, proxy) {
|
|
124
|
+
if (!internal.knownAsync.has(module)) {
|
|
125
|
+
internal.knownAsync.set(module, []);
|
|
126
|
+
}
|
|
127
|
+
internal.knownAsync.get(module).push(proxy);
|
|
128
|
+
}
|
|
129
|
+
internal.addAsyncProxy = addAsyncProxy;
|
|
130
|
+
function addRegisteringProxy(module, proxy) {
|
|
131
|
+
if (!internal.knownRegisters.has(module)) {
|
|
132
|
+
internal.knownRegisters.set(module, []);
|
|
133
|
+
}
|
|
134
|
+
internal.knownRegisters.get(module).push(proxy);
|
|
135
|
+
}
|
|
136
|
+
internal.addRegisteringProxy = addRegisteringProxy;
|
|
137
|
+
internal.interfaceConnections = {};
|
|
138
|
+
})(internal || (exports.internal = internal = {}));
|
|
139
|
+
function GetResponsibleModule(ignoreInterfaces = true, startFrame = 0) {
|
|
140
|
+
const oldHandler = Error.prepareStackTrace;
|
|
141
|
+
const oldLimit = Error.stackTraceLimit;
|
|
142
|
+
Error.stackTraceLimit = Infinity;
|
|
143
|
+
Error.prepareStackTrace = (_, trace) => trace.map((site) => site.getFileName());
|
|
144
|
+
const errObj = {};
|
|
145
|
+
Error.captureStackTrace(errObj, GetResponsibleModule);
|
|
146
|
+
const trace = errObj.stack;
|
|
147
|
+
Error.prepareStackTrace = oldHandler;
|
|
148
|
+
Error.stackTraceLimit = oldLimit;
|
|
149
|
+
let currentFound = '';
|
|
150
|
+
let currentBestMatch = 0;
|
|
151
|
+
for (let i = startFrame; i < trace.length; ++i) {
|
|
152
|
+
const fileName = trace[i];
|
|
153
|
+
if (!fileName || fileName.match(/[/\\]node_modules[/\\]/)) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
for (const { dir, id, interfaceDir } of internal.moduleByFolder) {
|
|
157
|
+
if (ignoreInterfaces && fileName.startsWith(interfaceDir)) {
|
|
158
|
+
currentFound = '';
|
|
159
|
+
currentBestMatch = 0;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
if (fileName.startsWith(dir) && dir.length > currentBestMatch) {
|
|
163
|
+
currentFound = id;
|
|
164
|
+
currentBestMatch = dir.length;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (currentFound) {
|
|
168
|
+
return currentFound;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function GetMetadata(target, meta, inherit = true) {
|
|
173
|
+
let data = Reflect.getOwnMetadata(meta.key, target);
|
|
174
|
+
if (!data) {
|
|
175
|
+
data = new meta(target);
|
|
176
|
+
const proto = Object.getPrototypeOf(target);
|
|
177
|
+
if (inherit && proto) {
|
|
178
|
+
const parent = GetMetadata(proto, meta, true);
|
|
179
|
+
if ('inherit' in data && typeof data.inherit === 'function') {
|
|
180
|
+
data.inherit(parent);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
for (const key of Object.getOwnPropertyNames(parent)) {
|
|
184
|
+
if (!(key in data)) {
|
|
185
|
+
data[key] = parent[key];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
Reflect.defineMetadata(meta.key, data, target);
|
|
191
|
+
}
|
|
192
|
+
return data;
|
|
193
|
+
}
|
|
194
|
+
function InterfaceFunction() {
|
|
195
|
+
const proxy = new AsyncProxy();
|
|
196
|
+
const func = (...args) => proxy.call(...args);
|
|
197
|
+
func.proxy = proxy;
|
|
198
|
+
return func;
|
|
199
|
+
}
|
|
200
|
+
async function ImplementInterface(declaration, implementation) {
|
|
201
|
+
const decl = await declaration;
|
|
202
|
+
const impl = (await implementation);
|
|
203
|
+
for (const key in decl) {
|
|
204
|
+
if (key in impl) {
|
|
205
|
+
const val = decl[key];
|
|
206
|
+
if (val instanceof RegisteringProxy) {
|
|
207
|
+
val.onRegister(impl[key].register);
|
|
208
|
+
val.onUnregister(impl[key].unregister);
|
|
209
|
+
}
|
|
210
|
+
else if (typeof val === 'function' && val.proxy instanceof AsyncProxy) {
|
|
211
|
+
val.proxy.onCall(impl[key]);
|
|
212
|
+
}
|
|
213
|
+
else if (val instanceof AsyncProxy) {
|
|
214
|
+
val.onCall(impl[key]);
|
|
215
|
+
}
|
|
216
|
+
else if (!(val instanceof EventProxy)) {
|
|
217
|
+
ImplementInterface(val, impl[key]);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return { declaration: decl, implementation: impl };
|
|
222
|
+
}
|
|
223
|
+
function GetInterfaceInstances(interfaceID) {
|
|
224
|
+
const module = GetResponsibleModule();
|
|
225
|
+
if (!module || !(module in internal.interfaceConnections))
|
|
226
|
+
return [];
|
|
227
|
+
const connections = internal.interfaceConnections[module];
|
|
228
|
+
return connections[interfaceID] ?? [];
|
|
229
|
+
}
|
|
230
|
+
function GetInterfaceInstance(interfaceID, connectionID) {
|
|
231
|
+
const module = GetResponsibleModule();
|
|
232
|
+
if (!module || !(module in internal.interfaceConnections))
|
|
233
|
+
return;
|
|
234
|
+
const connections = internal.interfaceConnections[module];
|
|
235
|
+
return (connections[interfaceID] ?? []).find((connection) => connection.id == connectionID);
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/core/1/index.ts"],"names":[],"mappings":";;;AA0RA,oDAkCC;AAaD,kCAwBC;AAUD,8CAOC;AA6BD,gDAsBC;AAUD,sDAKC;AAWD,oDAKC;AApcD,4BAA0B;AAqB1B,MAAa,UAAU;IACb,QAAQ,CAAK;IACb,KAAK,GAIR,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AAmB;IACvD,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,QAAQ,CAAC,oBAAoB,CAAC;QAAE,OAAO,EAAE,CAAC;IACrE,MAAM,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC1D,OAAO,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC;AAWD,SAAgB,oBAAoB,CAAC,WAAmB,EAAE,YAAoB;IAC5E,MAAM,MAAM,GAAG,oBAAoB,EAAE,CAAC;IACtC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,QAAQ,CAAC,oBAAoB,CAAC;QAAE,OAAO;IAClE,MAAM,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC1D,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,IAAI,YAAY,CAAC,CAAC;AAC9F,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EventProxy } from '.';
|
|
2
|
+
export declare namespace Events {
|
|
3
|
+
const ModuleConstructed: EventProxy<(module: string) => void>;
|
|
4
|
+
const ModuleStarted: EventProxy<(module: string) => void>;
|
|
5
|
+
const ModuleStopped: EventProxy<(module: string) => void>;
|
|
6
|
+
const ModuleDestroyed: EventProxy<(module: string) => void>;
|
|
7
|
+
}
|
|
8
|
+
export interface ModuleDefinition {
|
|
9
|
+
source: {
|
|
10
|
+
type: string;
|
|
11
|
+
} & Record<string, any>;
|
|
12
|
+
config?: unknown;
|
|
13
|
+
importOverrides?: Record<string, string[]>;
|
|
14
|
+
disabledExports?: string[];
|
|
15
|
+
}
|
|
16
|
+
export type ModuleInfo = Required<ModuleDefinition> & {
|
|
17
|
+
status: 'loaded' | 'constructed' | 'active' | 'unknown';
|
|
18
|
+
localPath: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const ListModules: () => Promise<string[]>;
|
|
21
|
+
export declare const GetModuleInfo: (module: string) => Promise<ModuleInfo>;
|
|
22
|
+
export declare const LoadModule: (module: string, configuration: ModuleDefinition, autostart?: boolean | undefined) => Promise<void>;
|
|
23
|
+
export declare const StartModule: (module: string) => Promise<void>;
|
|
24
|
+
export declare const StopModule: (module: string) => Promise<void>;
|
|
25
|
+
export declare const DestroyModule: (module: string) => Promise<void>;
|
|
26
|
+
export declare const ReloadModule: (module: string) => Promise<void>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReloadModule = exports.DestroyModule = exports.StopModule = exports.StartModule = exports.LoadModule = exports.GetModuleInfo = exports.ListModules = exports.Events = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
var Events;
|
|
6
|
+
(function (Events) {
|
|
7
|
+
Events.ModuleConstructed = new _1.EventProxy();
|
|
8
|
+
Events.ModuleStarted = new _1.EventProxy();
|
|
9
|
+
Events.ModuleStopped = new _1.EventProxy();
|
|
10
|
+
Events.ModuleDestroyed = new _1.EventProxy();
|
|
11
|
+
})(Events || (exports.Events = Events = {}));
|
|
12
|
+
Events.ModuleDestroyed.register((module) => {
|
|
13
|
+
if (_1.internal.knownAsync.has(module)) {
|
|
14
|
+
_1.internal.knownAsync.get(module).forEach((proxy) => proxy.detach());
|
|
15
|
+
}
|
|
16
|
+
if (_1.internal.knownRegisters.has(module)) {
|
|
17
|
+
_1.internal.knownRegisters.get(module).forEach((proxy) => proxy.detach());
|
|
18
|
+
}
|
|
19
|
+
for (const [, proxies] of _1.internal.knownRegisters) {
|
|
20
|
+
proxies.forEach((proxy) => proxy.unregisterModule(module));
|
|
21
|
+
}
|
|
22
|
+
_1.internal.knownEvents.forEach((proxy) => proxy.unregisterModule(module));
|
|
23
|
+
});
|
|
24
|
+
exports.ListModules = (0, _1.InterfaceFunction)();
|
|
25
|
+
exports.GetModuleInfo = (0, _1.InterfaceFunction)();
|
|
26
|
+
exports.LoadModule = (0, _1.InterfaceFunction)();
|
|
27
|
+
exports.StartModule = (0, _1.InterfaceFunction)();
|
|
28
|
+
exports.StopModule = (0, _1.InterfaceFunction)();
|
|
29
|
+
exports.DestroyModule = (0, _1.InterfaceFunction)();
|
|
30
|
+
exports.ReloadModule = (0, _1.InterfaceFunction)();
|
|
31
|
+
//# sourceMappingURL=modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../../../src/interfaces/core/1/modules.ts"],"names":[],"mappings":";;;AAAA,wBAA4D;AAQ5D,IAAiB,MAAM,CAwCtB;AAxCD,WAAiB,MAAM;IASR,wBAAiB,GAAG,IAAI,aAAU,EAA4B,CAAC;IAU/D,oBAAa,GAAG,IAAI,aAAU,EAA4B,CAAC;IAU3D,oBAAa,GAAG,IAAI,aAAU,EAA4B,CAAC;IAU3D,sBAAe,GAAG,IAAI,aAAU,EAA4B,CAAC;AAC5E,CAAC,EAxCgB,MAAM,sBAAN,MAAM,QAwCtB;AAGD,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,EAAE;IACzC,IAAI,WAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,WAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,WAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACxC,WAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,WAAQ,CAAC,cAAc,EAAE,CAAC;QAClD,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,WAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC;AA+DU,QAAA,WAAW,GAAG,IAAA,oBAAiB,GAAkB,CAAC;AAWlD,QAAA,aAAa,GAAG,IAAA,oBAAiB,GAAkC,CAAC;AAYpE,QAAA,UAAU,GACrB,IAAA,oBAAiB,GAAkF,CAAC;AAWzF,QAAA,WAAW,GAAG,IAAA,oBAAiB,GAA4B,CAAC;AAW5D,QAAA,UAAU,GAAG,IAAA,oBAAiB,GAA4B,CAAC;AAW3D,QAAA,aAAa,GAAG,IAAA,oBAAiB,GAA4B,CAAC;AAY9D,QAAA,YAAY,GAAG,IAAA,oBAAiB,GAA4B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type Func<A extends any[] = any[], R = any> = (...args: A) => R;
|
|
2
|
+
export type Class<T = any, A extends any[] = any[]> = {
|
|
3
|
+
new (...args: A): T;
|
|
4
|
+
};
|
|
5
|
+
export type ClassDecorator<C = Class> = (t: C) => any;
|
|
6
|
+
export type PropertyDecorator = (t: any, key: PropertyKey) => void;
|
|
7
|
+
export type MethodDecorator = (t: any, key: PropertyKey, descriptor: PropertyDescriptor) => void;
|
|
8
|
+
export type ParameterDecorator = (t: any, key: PropertyKey, index: number) => void;
|
|
9
|
+
type MergeArray<A extends any[], B extends any[]> = A extends [infer P, ...infer PR] ? B extends [infer Q, ...infer QR] ? [P | Q, ...MergeArray<PR, QR>] : [P | undefined, ...MergeArray<PR, []>] : B extends [infer Q, ...infer QR] ? [Q | undefined, ...MergeArray<[], QR>] : [];
|
|
10
|
+
type UnwrapFunctions<T extends Func[]> = T extends [infer F] ? Parameters<F extends Func ? F : never> : T extends [infer F1, ...infer F2] ? MergeArray<Parameters<F1 extends Func ? F1 : never>, UnwrapFunctions<F2 extends Func[] ? F2 : never>> : [];
|
|
11
|
+
type Function1<T extends Func[], A extends any[], R = void, AR extends any[] = UnwrapFunctions<T>> = (a1: AR[0], ...args: A) => R;
|
|
12
|
+
type Function2<T extends Func[], A extends any[], R = void, AR extends any[] = UnwrapFunctions<T>> = (a1: AR[0], a2: AR[1], ...args: A) => R;
|
|
13
|
+
type Function3<T extends Func[], A extends any[], R = void, AR extends any[] = UnwrapFunctions<T>> = (a1: AR[0], a2: AR[1], a3: AR[2], ...args: A) => R;
|
|
14
|
+
export declare function MakeClassDecorator<T extends any[]>(handler: Function1<[ClassDecorator], T, any>): (...args: T) => ClassDecorator<Class<any, any[]>>;
|
|
15
|
+
export declare function MakePropertyDecorator<T extends any[]>(handler: Function2<[PropertyDecorator], T, void>): (...args: T) => PropertyDecorator;
|
|
16
|
+
export declare function MakePropertyAndClassDecorator<T extends any[]>(handler: Function2<[PropertyDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & PropertyDecorator;
|
|
17
|
+
export declare function MakeMethodDecorator<T extends any[]>(handler: Function3<[MethodDecorator], T, void>): (...args: T) => MethodDecorator;
|
|
18
|
+
export declare function MakeMethodAndClassDecorator<T extends any[]>(handler: Function3<[MethodDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & MethodDecorator;
|
|
19
|
+
export declare function MakeMethodAndPropertyDecorator<T extends any[]>(handler: Function3<[MethodDecorator, PropertyDecorator], T, void>): (...args: T) => PropertyDecorator & MethodDecorator;
|
|
20
|
+
export declare function MakeMethodAndPropertyAndClassDecorator<T extends any[]>(handler: Function3<[MethodDecorator, PropertyDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & PropertyDecorator & MethodDecorator;
|
|
21
|
+
export declare function MakeParameterDecorator<T extends any[]>(handler: Function3<[ParameterDecorator], T, void>): (...args: T) => ParameterDecorator;
|
|
22
|
+
export declare function MakeParameterAndClassDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & ParameterDecorator;
|
|
23
|
+
export declare function MakeParameterAndPropertyDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, PropertyDecorator], T, void>): (...args: T) => PropertyDecorator & ParameterDecorator;
|
|
24
|
+
export declare function MakeParameterAndPropertyAndClassDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, PropertyDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & PropertyDecorator & ParameterDecorator;
|
|
25
|
+
export declare function MakeParameterAndMethodDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, MethodDecorator], T, void>): (...args: T) => MethodDecorator & ParameterDecorator;
|
|
26
|
+
export declare function MakeParameterAndMethodAndClassDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, MethodDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & MethodDecorator & ParameterDecorator;
|
|
27
|
+
export declare function MakeParameterAndMethodAndPropertyDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, MethodDecorator, PropertyDecorator], T, void>): (...args: T) => PropertyDecorator & MethodDecorator & ParameterDecorator;
|
|
28
|
+
export declare function MakeParameterAndMethodAndPropertyAndClassDecorator<T extends any[]>(handler: Function3<[ParameterDecorator, MethodDecorator, PropertyDecorator, ClassDecorator], T, any | undefined>): (...args: T) => ClassDecorator<Class<any, any[]>> & PropertyDecorator & MethodDecorator & ParameterDecorator;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MakeClassDecorator = MakeClassDecorator;
|
|
4
|
+
exports.MakePropertyDecorator = MakePropertyDecorator;
|
|
5
|
+
exports.MakePropertyAndClassDecorator = MakePropertyAndClassDecorator;
|
|
6
|
+
exports.MakeMethodDecorator = MakeMethodDecorator;
|
|
7
|
+
exports.MakeMethodAndClassDecorator = MakeMethodAndClassDecorator;
|
|
8
|
+
exports.MakeMethodAndPropertyDecorator = MakeMethodAndPropertyDecorator;
|
|
9
|
+
exports.MakeMethodAndPropertyAndClassDecorator = MakeMethodAndPropertyAndClassDecorator;
|
|
10
|
+
exports.MakeParameterDecorator = MakeParameterDecorator;
|
|
11
|
+
exports.MakeParameterAndClassDecorator = MakeParameterAndClassDecorator;
|
|
12
|
+
exports.MakeParameterAndPropertyDecorator = MakeParameterAndPropertyDecorator;
|
|
13
|
+
exports.MakeParameterAndPropertyAndClassDecorator = MakeParameterAndPropertyAndClassDecorator;
|
|
14
|
+
exports.MakeParameterAndMethodDecorator = MakeParameterAndMethodDecorator;
|
|
15
|
+
exports.MakeParameterAndMethodAndClassDecorator = MakeParameterAndMethodAndClassDecorator;
|
|
16
|
+
exports.MakeParameterAndMethodAndPropertyDecorator = MakeParameterAndMethodAndPropertyDecorator;
|
|
17
|
+
exports.MakeParameterAndMethodAndPropertyAndClassDecorator = MakeParameterAndMethodAndPropertyAndClassDecorator;
|
|
18
|
+
function Decorator1(handler) {
|
|
19
|
+
return (...args) => (a) => handler(a, ...args);
|
|
20
|
+
}
|
|
21
|
+
function Decorator2(handler) {
|
|
22
|
+
return (...args) => (a, b) => handler(a, b, ...args);
|
|
23
|
+
}
|
|
24
|
+
function Decorator3(handler) {
|
|
25
|
+
return (...args) => (a, b, c) => handler(a, b, c, ...args);
|
|
26
|
+
}
|
|
27
|
+
function MakeClassDecorator(handler) {
|
|
28
|
+
return Decorator1(handler);
|
|
29
|
+
}
|
|
30
|
+
function MakePropertyDecorator(handler) {
|
|
31
|
+
return Decorator2(handler);
|
|
32
|
+
}
|
|
33
|
+
function MakePropertyAndClassDecorator(handler) {
|
|
34
|
+
return Decorator2(handler);
|
|
35
|
+
}
|
|
36
|
+
function MakeMethodDecorator(handler) {
|
|
37
|
+
return Decorator3(handler);
|
|
38
|
+
}
|
|
39
|
+
function MakeMethodAndClassDecorator(handler) {
|
|
40
|
+
return Decorator3(handler);
|
|
41
|
+
}
|
|
42
|
+
function MakeMethodAndPropertyDecorator(handler) {
|
|
43
|
+
return Decorator3(handler);
|
|
44
|
+
}
|
|
45
|
+
function MakeMethodAndPropertyAndClassDecorator(handler) {
|
|
46
|
+
return Decorator3(handler);
|
|
47
|
+
}
|
|
48
|
+
function MakeParameterDecorator(handler) {
|
|
49
|
+
return Decorator3(handler);
|
|
50
|
+
}
|
|
51
|
+
function MakeParameterAndClassDecorator(handler) {
|
|
52
|
+
return Decorator3(handler);
|
|
53
|
+
}
|
|
54
|
+
function MakeParameterAndPropertyDecorator(handler) {
|
|
55
|
+
return Decorator3(handler);
|
|
56
|
+
}
|
|
57
|
+
function MakeParameterAndPropertyAndClassDecorator(handler) {
|
|
58
|
+
return Decorator3(handler);
|
|
59
|
+
}
|
|
60
|
+
function MakeParameterAndMethodDecorator(handler) {
|
|
61
|
+
return Decorator3(handler);
|
|
62
|
+
}
|
|
63
|
+
function MakeParameterAndMethodAndClassDecorator(handler) {
|
|
64
|
+
return Decorator3(handler);
|
|
65
|
+
}
|
|
66
|
+
function MakeParameterAndMethodAndPropertyDecorator(handler) {
|
|
67
|
+
return Decorator3(handler);
|
|
68
|
+
}
|
|
69
|
+
function MakeParameterAndMethodAndPropertyAndClassDecorator(handler) {
|
|
70
|
+
return Decorator3(handler);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../../src/interfaces/core/beta/decorators.ts"],"names":[],"mappings":";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AC;AACpF,CAAC;AAUD,SAAgB,8BAA8B,CAC5C,OAAiE;IAEjE,OAAO,UAAU,CAAgD,OAAO,CAAC,CAAC;AAC5E,CAAC;AAUD,SAAgB,sCAAsC,CACpD,OAA4F;IAE5F,OAAO,UAAU,CAA2E,OAAO,CAAC,CAAC;AACvG,CAAC;AAUD,SAAgB,sBAAsB,CAAkB,OAAiD;IACvG,OAAO,UAAU,CAAgC,OAAO,CAAC,CAAC;AAC5D,CAAC;AAUD,SAAgB,8BAA8B,CAC5C,OAA4E;IAE5E,OAAO,UAAU,CAA2D,OAAO,CAAC,CAAC;AACvF,CAAC;AAUD,SAAgB,iCAAiC,CAC/C,OAAoE;IAEpE,OAAO,UAAU,CAAmD,OAAO,CAAC,CAAC;AAC/E,CAAC;AAUD,SAAgB,yCAAyC,CACvD,OAA+F;IAE/F,OAAO,UAAU,CAA8E,OAAO,CAAC,CAAC;AAC1G,CAAC;AAUD,SAAgB,+BAA+B,CAC7C,OAAkE;IAElE,OAAO,UAAU,CAAiD,OAAO,CAAC,CAAC;AAC7E,CAAC;AAUD,SAAgB,uCAAuC,CACrD,OAA6F;IAE7F,OAAO,UAAU,CAA4E,OAAO,CAAC,CAAC;AACxG,CAAC;AAUD,SAAgB,0CAA0C,CACxD,OAAqF;IAErF,OAAO,UAAU,CAAoE,OAAO,CAAC,CAAC;AAChG,CAAC;AAUD,SAAgB,kDAAkD,CAChE,OAAgH;IAEhH,OAAO,UAAU,CACf,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { Class } from './decorators';
|
|
3
|
+
interface InterfaceConnection {
|
|
4
|
+
id?: string;
|
|
5
|
+
path: string;
|
|
6
|
+
}
|
|
7
|
+
type Func<A extends any[] = any[], R = any> = (...args: A) => R;
|
|
8
|
+
export declare class AsyncProxy<T extends Func = Func, R = Awaited<ReturnType<T>>> {
|
|
9
|
+
private callback?;
|
|
10
|
+
private queue;
|
|
11
|
+
onCall(callback: T, manualDetach?: boolean): void;
|
|
12
|
+
detach(): void;
|
|
13
|
+
call(...args: Parameters<T>): Promise<R>;
|
|
14
|
+
}
|
|
15
|
+
type RegisterFunction = (id: any, ...args: any[]) => void;
|
|
16
|
+
type RID<T> = T extends (id: infer P, ...args: any[]) => void ? P : never;
|
|
17
|
+
type RArgs<T> = T extends (id: any, ...args: infer P) => void ? P : never;
|
|
18
|
+
export declare class RegisteringProxy<T extends RegisterFunction = RegisterFunction> {
|
|
19
|
+
private registerCallback?;
|
|
20
|
+
private unregisterCallback?;
|
|
21
|
+
private registered;
|
|
22
|
+
onRegister(callback: T, manualDetach?: boolean): void;
|
|
23
|
+
onUnregister(callback: (id: RID<T>) => void): void;
|
|
24
|
+
detach(): void;
|
|
25
|
+
register(id: RID<T>, ...args: RArgs<T>): void;
|
|
26
|
+
unregister(id: RID<T>): void;
|
|
27
|
+
}
|
|
28
|
+
type EventFunction = (...args: any[]) => void;
|
|
29
|
+
export declare class EventProxy<T extends EventFunction = EventFunction> {
|
|
30
|
+
private registered;
|
|
31
|
+
constructor();
|
|
32
|
+
emit(...args: Parameters<T>): void;
|
|
33
|
+
register(func: T): void;
|
|
34
|
+
unregister(fn: T): void;
|
|
35
|
+
}
|
|
36
|
+
export declare function GetResponsibleModule(ignoreInterfaces?: boolean, startFrame?: number): string | undefined;
|
|
37
|
+
export declare function GetMetadata<T extends Record<string, any>, U extends Record<string, any>>(target: U, meta: Class<T, [U]> & {
|
|
38
|
+
key: symbol;
|
|
39
|
+
}, inherit?: boolean): T;
|
|
40
|
+
export declare function InterfaceFunction<T extends Func = Func, R = Awaited<ReturnType<T>>>(): (...args: Parameters<T>) => Promise<R>;
|
|
41
|
+
type InterfaceImplType<T> = T extends RegisteringProxy<infer P> ? {
|
|
42
|
+
register: P;
|
|
43
|
+
unregister: (id: RID<P>) => void;
|
|
44
|
+
} : T extends EventProxy ? never : T extends (...args: any[]) => any ? T : T extends Record<string, any> ? InterfaceToImpl<T> : never;
|
|
45
|
+
type InterfaceToImpl<T> = T extends infer P ? {
|
|
46
|
+
[K in keyof P]?: InterfaceImplType<P[K]>;
|
|
47
|
+
} : never;
|
|
48
|
+
export declare function ImplementInterface<T, T2 = InterfaceToImpl<Awaited<T>>>(declaration: T, implementation: T2 | Promise<T2>): Promise<{
|
|
49
|
+
declaration: Awaited<T>;
|
|
50
|
+
implementation: T2;
|
|
51
|
+
}>;
|
|
52
|
+
export declare function GetInterfaceInstances(interfaceID: string): InterfaceConnection[];
|
|
53
|
+
export declare function GetInterfaceInstance(interfaceID: string, connectionID: string): InterfaceConnection | undefined;
|
|
54
|
+
export {};
|