@adaas/a-concept 0.1.24 → 0.1.25
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 +3 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +3952 -0
- package/dist/index.d.ts +3952 -50
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +5 -6
- package/src/global/A-Abstraction/A-Abstraction-Extend.decorator.ts +2 -1
- package/src/global/A-Context/A-Context.class.ts +81 -7
- package/src/global/A-Context/A-Context.error.ts +4 -0
- package/src/global/A-Dependency/A-Dependency-Default.decorator.ts +75 -0
- package/src/global/A-Dependency/A-Dependency-Load.decorator.ts +80 -0
- package/src/global/A-Dependency/A-Dependency-Require.decorator.ts +68 -0
- package/src/global/A-Dependency/A-Dependency.class.ts +33 -0
- package/src/global/A-Dependency/A-Dependency.error.ts +13 -0
- package/src/global/A-Dependency/A-Dependency.types.ts +28 -0
- package/src/global/A-Feature/A-Feature-Define.decorator.ts +2 -1
- package/src/global/A-Feature/A-Feature-Extend.decorator.ts +2 -1
- package/src/global/A-Feature/A-Feature.class.ts +11 -0
- package/src/global/A-Inject/A-Inject.decorator.ts +4 -2
- package/src/global/A-Inject/A-Inject.types.ts +5 -3
- package/src/global/A-Scope/A-Scope.class.ts +85 -57
- package/src/global/A-Stage/A-Stage.class.ts +22 -2
- package/src/global/A-Stage/A-Stage.error.ts +2 -0
- package/src/helpers/A_Common.helper.ts +101 -0
- package/src/helpers/A_TypeGuards.helper.ts +8 -0
- package/src/index.ts +88 -0
- package/tests/A-Component.test.ts +1 -1
- package/tests/A-Concept.test.ts +5 -6
- package/tests/A-Dependency.test.ts +93 -0
- package/tests/A-Feature.test.ts +7 -7
- package/tests/A-Scope.test.ts +10 -10
- package/tsconfig.json +2 -2
- package/tsup.config.ts +32 -0
- package/dist/index.js +0 -112
- package/dist/index.js.map +0 -1
- package/dist/src/constants/env.constants.d.ts +0 -33
- package/dist/src/constants/env.constants.js +0 -47
- package/dist/src/constants/env.constants.js.map +0 -1
- package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.d.ts +0 -23
- package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.js +0 -96
- package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.js.map +0 -1
- package/dist/src/global/A-Abstraction/A-Abstraction.class.d.ts +0 -74
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js +0 -130
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js.map +0 -1
- package/dist/src/global/A-Abstraction/A-Abstraction.error.d.ts +0 -7
- package/dist/src/global/A-Abstraction/A-Abstraction.error.js +0 -12
- package/dist/src/global/A-Abstraction/A-Abstraction.error.js.map +0 -1
- package/dist/src/global/A-Abstraction/A-Abstraction.types.d.ts +0 -38
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js +0 -3
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js.map +0 -1
- package/dist/src/global/A-Caller/A_Caller.class.d.ts +0 -33
- package/dist/src/global/A-Caller/A_Caller.class.js +0 -44
- package/dist/src/global/A-Caller/A_Caller.class.js.map +0 -1
- package/dist/src/global/A-Caller/A_Caller.error.d.ts +0 -7
- package/dist/src/global/A-Caller/A_Caller.error.js +0 -12
- package/dist/src/global/A-Caller/A_Caller.error.js.map +0 -1
- package/dist/src/global/A-Caller/A_Caller.types.d.ts +0 -18
- package/dist/src/global/A-Caller/A_Caller.types.js +0 -3
- package/dist/src/global/A-Caller/A_Caller.types.js.map +0 -1
- package/dist/src/global/A-Component/A-Component.class.d.ts +0 -34
- package/dist/src/global/A-Component/A-Component.class.js +0 -56
- package/dist/src/global/A-Component/A-Component.class.js.map +0 -1
- package/dist/src/global/A-Component/A-Component.constants.d.ts +0 -6
- package/dist/src/global/A-Component/A-Component.constants.js +0 -11
- package/dist/src/global/A-Component/A-Component.constants.js.map +0 -1
- package/dist/src/global/A-Component/A-Component.meta.d.ts +0 -34
- package/dist/src/global/A-Component/A-Component.meta.js +0 -78
- package/dist/src/global/A-Component/A-Component.meta.js.map +0 -1
- package/dist/src/global/A-Component/A-Component.types.d.ts +0 -76
- package/dist/src/global/A-Component/A-Component.types.js +0 -4
- package/dist/src/global/A-Component/A-Component.types.js.map +0 -1
- package/dist/src/global/A-Concept/A-Concept.class.d.ts +0 -153
- package/dist/src/global/A-Concept/A-Concept.class.js +0 -260
- package/dist/src/global/A-Concept/A-Concept.class.js.map +0 -1
- package/dist/src/global/A-Concept/A-Concept.constants.d.ts +0 -33
- package/dist/src/global/A-Concept/A-Concept.constants.js +0 -39
- package/dist/src/global/A-Concept/A-Concept.constants.js.map +0 -1
- package/dist/src/global/A-Concept/A-Concept.meta.d.ts +0 -6
- package/dist/src/global/A-Concept/A-Concept.meta.js +0 -12
- package/dist/src/global/A-Concept/A-Concept.meta.js.map +0 -1
- package/dist/src/global/A-Concept/A-Concept.types.d.ts +0 -66
- package/dist/src/global/A-Concept/A-Concept.types.js +0 -3
- package/dist/src/global/A-Concept/A-Concept.types.js.map +0 -1
- package/dist/src/global/A-Container/A-Container.class.d.ts +0 -52
- package/dist/src/global/A-Container/A-Container.class.js +0 -78
- package/dist/src/global/A-Container/A-Container.class.js.map +0 -1
- package/dist/src/global/A-Container/A-Container.constants.d.ts +0 -6
- package/dist/src/global/A-Container/A-Container.constants.js +0 -11
- package/dist/src/global/A-Container/A-Container.constants.js.map +0 -1
- package/dist/src/global/A-Container/A-Container.meta.d.ts +0 -35
- package/dist/src/global/A-Container/A-Container.meta.js +0 -76
- package/dist/src/global/A-Container/A-Container.meta.js.map +0 -1
- package/dist/src/global/A-Container/A-Container.types.d.ts +0 -75
- package/dist/src/global/A-Container/A-Container.types.js +0 -4
- package/dist/src/global/A-Container/A-Container.types.js.map +0 -1
- package/dist/src/global/A-Context/A-Context.class.d.ts +0 -361
- package/dist/src/global/A-Context/A-Context.class.js +0 -603
- package/dist/src/global/A-Context/A-Context.class.js.map +0 -1
- package/dist/src/global/A-Context/A-Context.error.d.ts +0 -20
- package/dist/src/global/A-Context/A-Context.error.js +0 -25
- package/dist/src/global/A-Context/A-Context.error.js.map +0 -1
- package/dist/src/global/A-Context/A-Context.types.d.ts +0 -5
- package/dist/src/global/A-Context/A-Context.types.js +0 -3
- package/dist/src/global/A-Context/A-Context.types.js.map +0 -1
- package/dist/src/global/A-Dependency/A-DependencyReference.class.d.ts +0 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js +0 -49
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js.map +0 -1
- package/dist/src/global/A-Dependency/A-DependencyReference.types.d.ts +0 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.types.js +0 -58
- package/dist/src/global/A-Dependency/A-DependencyReference.types.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.class.d.ts +0 -214
- package/dist/src/global/A-Entity/A-Entity.class.js +0 -282
- package/dist/src/global/A-Entity/A-Entity.class.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.constants.d.ts +0 -11
- package/dist/src/global/A-Entity/A-Entity.constants.js +0 -17
- package/dist/src/global/A-Entity/A-Entity.constants.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.error.d.ts +0 -7
- package/dist/src/global/A-Entity/A-Entity.error.js +0 -12
- package/dist/src/global/A-Entity/A-Entity.error.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.meta.d.ts +0 -11
- package/dist/src/global/A-Entity/A-Entity.meta.js +0 -18
- package/dist/src/global/A-Entity/A-Entity.meta.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.types.d.ts +0 -56
- package/dist/src/global/A-Entity/A-Entity.types.js +0 -5
- package/dist/src/global/A-Entity/A-Entity.types.js.map +0 -1
- package/dist/src/global/A-Error/A_Error.class.d.ts +0 -229
- package/dist/src/global/A-Error/A_Error.class.js +0 -296
- package/dist/src/global/A-Error/A_Error.class.js.map +0 -1
- package/dist/src/global/A-Error/A_Error.constants.d.ts +0 -5
- package/dist/src/global/A-Error/A_Error.constants.js +0 -9
- package/dist/src/global/A-Error/A_Error.constants.js.map +0 -1
- package/dist/src/global/A-Error/A_Error.types.d.ts +0 -93
- package/dist/src/global/A-Error/A_Error.types.js +0 -3
- package/dist/src/global/A-Error/A_Error.types.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature-Define.decorator.d.ts +0 -15
- package/dist/src/global/A-Feature/A-Feature-Define.decorator.js +0 -76
- package/dist/src/global/A-Feature/A-Feature-Define.decorator.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature-Extend.decorator.d.ts +0 -56
- package/dist/src/global/A-Feature/A-Feature-Extend.decorator.js +0 -128
- package/dist/src/global/A-Feature/A-Feature-Extend.decorator.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature.class.d.ts +0 -175
- package/dist/src/global/A-Feature/A-Feature.class.js +0 -318
- package/dist/src/global/A-Feature/A-Feature.class.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature.error.d.ts +0 -25
- package/dist/src/global/A-Feature/A-Feature.error.js +0 -33
- package/dist/src/global/A-Feature/A-Feature.error.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature.types.d.ts +0 -334
- package/dist/src/global/A-Feature/A-Feature.types.js +0 -26
- package/dist/src/global/A-Feature/A-Feature.types.js.map +0 -1
- package/dist/src/global/A-Fragment/A-Fragment.class.d.ts +0 -36
- package/dist/src/global/A-Fragment/A-Fragment.class.js +0 -46
- package/dist/src/global/A-Fragment/A-Fragment.class.js.map +0 -1
- package/dist/src/global/A-Fragment/A-Fragment.types.d.ts +0 -21
- package/dist/src/global/A-Fragment/A-Fragment.types.js +0 -6
- package/dist/src/global/A-Fragment/A-Fragment.types.js.map +0 -1
- package/dist/src/global/A-Inject/A-Inject.decorator.d.ts +0 -80
- package/dist/src/global/A-Inject/A-Inject.decorator.js +0 -49
- package/dist/src/global/A-Inject/A-Inject.decorator.js.map +0 -1
- package/dist/src/global/A-Inject/A-Inject.error.d.ts +0 -5
- package/dist/src/global/A-Inject/A-Inject.error.js +0 -10
- package/dist/src/global/A-Inject/A-Inject.error.js.map +0 -1
- package/dist/src/global/A-Inject/A-Inject.types.d.ts +0 -42
- package/dist/src/global/A-Inject/A-Inject.types.js +0 -3
- package/dist/src/global/A-Inject/A-Inject.types.js.map +0 -1
- package/dist/src/global/A-Meta/A-Meta.class.d.ts +0 -97
- package/dist/src/global/A-Meta/A-Meta.class.js +0 -164
- package/dist/src/global/A-Meta/A-Meta.class.js.map +0 -1
- package/dist/src/global/A-Meta/A-Meta.types.d.ts +0 -14
- package/dist/src/global/A-Meta/A-Meta.types.js +0 -3
- package/dist/src/global/A-Meta/A-Meta.types.js.map +0 -1
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +0 -466
- package/dist/src/global/A-Scope/A-Scope.class.js +0 -791
- package/dist/src/global/A-Scope/A-Scope.class.js.map +0 -1
- package/dist/src/global/A-Scope/A-Scope.error.d.ts +0 -8
- package/dist/src/global/A-Scope/A-Scope.error.js +0 -13
- package/dist/src/global/A-Scope/A-Scope.error.js.map +0 -1
- package/dist/src/global/A-Scope/A-Scope.types.d.ts +0 -81
- package/dist/src/global/A-Scope/A-Scope.types.js +0 -3
- package/dist/src/global/A-Scope/A-Scope.types.js.map +0 -1
- package/dist/src/global/A-Stage/A-Stage.class.d.ts +0 -112
- package/dist/src/global/A-Stage/A-Stage.class.js +0 -240
- package/dist/src/global/A-Stage/A-Stage.class.js.map +0 -1
- package/dist/src/global/A-Stage/A-Stage.error.d.ts +0 -4
- package/dist/src/global/A-Stage/A-Stage.error.js +0 -11
- package/dist/src/global/A-Stage/A-Stage.error.js.map +0 -1
- package/dist/src/global/A-Stage/A-Stage.types.d.ts +0 -101
- package/dist/src/global/A-Stage/A-Stage.types.js +0 -43
- package/dist/src/global/A-Stage/A-Stage.types.js.map +0 -1
- package/dist/src/global/A-StepManager/A-StepManager.class.d.ts +0 -20
- package/dist/src/global/A-StepManager/A-StepManager.class.js +0 -112
- package/dist/src/global/A-StepManager/A-StepManager.class.js.map +0 -1
- package/dist/src/global/A-StepManager/A-StepManager.error.d.ts +0 -4
- package/dist/src/global/A-StepManager/A-StepManager.error.js +0 -9
- package/dist/src/global/A-StepManager/A-StepManager.error.js.map +0 -1
- package/dist/src/global/ASEID/ASEID.class.d.ts +0 -130
- package/dist/src/global/ASEID/ASEID.class.js +0 -167
- package/dist/src/global/ASEID/ASEID.class.js.map +0 -1
- package/dist/src/global/ASEID/ASEID.constants.d.ts +0 -0
- package/dist/src/global/ASEID/ASEID.constants.js +0 -2
- package/dist/src/global/ASEID/ASEID.constants.js.map +0 -1
- package/dist/src/global/ASEID/ASEID.error.d.ts +0 -5
- package/dist/src/global/ASEID/ASEID.error.js +0 -10
- package/dist/src/global/ASEID/ASEID.error.js.map +0 -1
- package/dist/src/global/ASEID/ASEID.types.d.ts +0 -65
- package/dist/src/global/ASEID/ASEID.types.js +0 -5
- package/dist/src/global/ASEID/ASEID.types.js.map +0 -1
- package/dist/src/helpers/A_Common.helper.d.ts +0 -28
- package/dist/src/helpers/A_Common.helper.js +0 -170
- package/dist/src/helpers/A_Common.helper.js.map +0 -1
- package/dist/src/helpers/A_Formatter.helper.d.ts +0 -35
- package/dist/src/helpers/A_Formatter.helper.js +0 -62
- package/dist/src/helpers/A_Formatter.helper.js.map +0 -1
- package/dist/src/helpers/A_Identity.helper.d.ts +0 -29
- package/dist/src/helpers/A_Identity.helper.js +0 -43
- package/dist/src/helpers/A_Identity.helper.js.map +0 -1
- package/dist/src/helpers/A_TypeGuards.helper.d.ts +0 -207
- package/dist/src/helpers/A_TypeGuards.helper.js +0 -296
- package/dist/src/helpers/A_TypeGuards.helper.js.map +0 -1
- package/dist/src/types/A_Common.types.d.ts +0 -36
- package/dist/src/types/A_Common.types.js +0 -3
- package/dist/src/types/A_Common.types.js.map +0 -1
- package/index.ts +0 -81
- package/src/global/A-Dependency/A-DependencyReference.class.ts +0 -61
- package/src/global/A-Dependency/A-DependencyReference.types.ts +0 -61
- package/trace-require.js +0 -46
- package/tsconfig.build.json +0 -58
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.A_FeatureError = void 0;
|
|
4
|
-
const A_Error_class_1 = require("../A-Error/A_Error.class");
|
|
5
|
-
class A_FeatureError extends A_Error_class_1.A_Error {
|
|
6
|
-
}
|
|
7
|
-
exports.A_FeatureError = A_FeatureError;
|
|
8
|
-
/**
|
|
9
|
-
* Indicates that the Feature has been interrupted
|
|
10
|
-
*/
|
|
11
|
-
A_FeatureError.Interruption = 'Feature Interrupted';
|
|
12
|
-
/**
|
|
13
|
-
* Indicates that there was an error initializing the Feature
|
|
14
|
-
*
|
|
15
|
-
* Failed during the A-Feature initialization process
|
|
16
|
-
*/
|
|
17
|
-
A_FeatureError.FeatureInitializationError = 'Unable to initialize A-Feature';
|
|
18
|
-
// =======================================================================
|
|
19
|
-
// ---------------------- Decorator Errors -----------------------------
|
|
20
|
-
// =======================================================================
|
|
21
|
-
/**
|
|
22
|
-
* Indicates that there was an error defining the Feature
|
|
23
|
-
*
|
|
24
|
-
* Failed during the @A_Feature.Define() decorator execution
|
|
25
|
-
*/
|
|
26
|
-
A_FeatureError.FeatureDefinitionError = 'Unable to define A-Feature';
|
|
27
|
-
/**
|
|
28
|
-
* Indicates that there was an error extending the Feature
|
|
29
|
-
*
|
|
30
|
-
* Failed during the @A_Feature.Extend() decorator execution
|
|
31
|
-
*/
|
|
32
|
-
A_FeatureError.FeatureExtensionError = 'Unable to extend A-Feature';
|
|
33
|
-
//# sourceMappingURL=A-Feature.error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"A-Feature.error.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.error.ts"],"names":[],"mappings":";;;AAAA,4DAAmD;AAInD,MAAa,cAAe,SAAQ,uBAAO;;AAA3C,wCA4BC;AA1BG;;GAEG;AACa,2BAAY,GAAG,qBAAqB,CAAC;AACrD;;;;GAIG;AACa,yCAA0B,GAAG,gCAAgC,CAAC;AAE9E,0EAA0E;AAC1E,wEAAwE;AACxE,0EAA0E;AAC1E;;;;GAIG;AACa,qCAAsB,GAAG,4BAA4B,CAAC;AACtE;;;;GAIG;AACa,oCAAqB,GAAG,4BAA4B,CAAC"}
|
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
import { A_TYPES__A_StageStep, A_TYPES_StageExecutionBehavior } from "../A-Stage/A-Stage.types";
|
|
2
|
-
import { A_Entity } from "../A-Entity/A-Entity.class";
|
|
3
|
-
import { A_Container } from "../A-Container/A-Container.class";
|
|
4
|
-
import { A_Component } from "../A-Component/A-Component.class";
|
|
5
|
-
import { A_TYPES__Component_Constructor } from "../A-Component/A-Component.types";
|
|
6
|
-
import { A_TYPES__Container_Constructor } from "../A-Container/A-Container.types";
|
|
7
|
-
import { A_TYPES__Entity_Constructor } from "../A-Entity/A-Entity.types";
|
|
8
|
-
import { A_Feature } from "./A-Feature.class";
|
|
9
|
-
import { A_TYPES__Required } from "../../types/A_Common.types";
|
|
10
|
-
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
11
|
-
/**
|
|
12
|
-
* Feature constructor type
|
|
13
|
-
* Uses the generic type T to specify the type of the feature
|
|
14
|
-
*/
|
|
15
|
-
export type A_TYPES__Feature_Constructor<T = A_Feature> = new (...args: any[]) => T;
|
|
16
|
-
/**
|
|
17
|
-
* Feature initialization type
|
|
18
|
-
*/
|
|
19
|
-
export type A_TYPES__Feature_Init<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = A_TYPES__Feature_InitWithComponent<T> | A_TYPES__Feature_InitWithTemplate<T>;
|
|
20
|
-
/**
|
|
21
|
-
* Feature initialization type using component
|
|
22
|
-
*/
|
|
23
|
-
export type A_TYPES__Feature_InitWithComponent<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = {
|
|
24
|
-
/**
|
|
25
|
-
* Feature Name
|
|
26
|
-
*/
|
|
27
|
-
name: string;
|
|
28
|
-
/**
|
|
29
|
-
* The component from where the feature is calling. It's important for proper scoping.
|
|
30
|
-
* Based on the component would be retrieved connected components, entities and containers.
|
|
31
|
-
*
|
|
32
|
-
* [!] Could be Container, Entity, Component or Command
|
|
33
|
-
*/
|
|
34
|
-
component: T;
|
|
35
|
-
/**
|
|
36
|
-
* In case when Entity is not attached to the scope can be used to transparently show dependencies
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*/
|
|
40
|
-
scope?: A_Scope;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Feature initialization type using template
|
|
44
|
-
*/
|
|
45
|
-
export type A_TYPES__Feature_InitWithTemplate<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = {
|
|
46
|
-
/**
|
|
47
|
-
* Feature Name
|
|
48
|
-
*/
|
|
49
|
-
name: string;
|
|
50
|
-
/**
|
|
51
|
-
* The scope from where to retrieve dependent components, entities and containers.
|
|
52
|
-
*
|
|
53
|
-
* [!] Important for proper scoping.
|
|
54
|
-
*/
|
|
55
|
-
scope: A_Scope;
|
|
56
|
-
/**
|
|
57
|
-
* The component from where the feature is calling. It's important for proper scoping.
|
|
58
|
-
* Based on the component would be retrieved connected components, entities and containers.
|
|
59
|
-
*
|
|
60
|
-
* [!] Could be Container, Entity, Component or Command
|
|
61
|
-
*/
|
|
62
|
-
component?: T;
|
|
63
|
-
/**
|
|
64
|
-
* Optional Feature template to be used instead of building it from decorators
|
|
65
|
-
*/
|
|
66
|
-
template: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Feature serialized type
|
|
70
|
-
*/
|
|
71
|
-
export type A_TYPES__Feature_Serialized = {};
|
|
72
|
-
/**
|
|
73
|
-
* Feature lifecycle states
|
|
74
|
-
*/
|
|
75
|
-
export declare enum A_TYPES__FeatureState {
|
|
76
|
-
/**
|
|
77
|
-
* The feature has been initialized
|
|
78
|
-
*/
|
|
79
|
-
INITIALIZED = "INITIALIZED",
|
|
80
|
-
/**
|
|
81
|
-
* The feature is currently being processed
|
|
82
|
-
*/
|
|
83
|
-
PROCESSING = "PROCESSING",
|
|
84
|
-
/**
|
|
85
|
-
* The feature has been completed
|
|
86
|
-
*/
|
|
87
|
-
COMPLETED = "COMPLETED",
|
|
88
|
-
/**
|
|
89
|
-
* The feature has been interrupted
|
|
90
|
-
*/
|
|
91
|
-
INTERRUPTED = "INTERRUPTED"
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* A list of component where features can be Defined
|
|
95
|
-
*
|
|
96
|
-
* [!] On this component Feature Definition is Available
|
|
97
|
-
*/
|
|
98
|
-
export type A_TYPES__FeatureAvailableComponents = InstanceType<A_TYPES__FeatureAvailableConstructors>;
|
|
99
|
-
/**
|
|
100
|
-
* A list of constructors where features can be Defined
|
|
101
|
-
*
|
|
102
|
-
* [!] On this component Feature Definition is Available
|
|
103
|
-
*/
|
|
104
|
-
export type A_TYPES__FeatureAvailableConstructors = A_TYPES__Component_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Container_Constructor;
|
|
105
|
-
/**
|
|
106
|
-
* Indicates a type of Feature Define decorator
|
|
107
|
-
*/
|
|
108
|
-
export type A_TYPES__FeatureDefineDecoratorDescriptor = TypedPropertyDescriptor<(...args: any[]) => any> | TypedPropertyDescriptor<(...args: any[]) => any> | TypedPropertyDescriptor<(...args: any[]) => Promise<any>> | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>;
|
|
109
|
-
/**
|
|
110
|
-
* Describes additional configuration properties to be used in Feature Define decorator
|
|
111
|
-
*/
|
|
112
|
-
export type A_TYPES__FeatureDefineDecoratorConfig = {
|
|
113
|
-
/**
|
|
114
|
-
* Feature name
|
|
115
|
-
*
|
|
116
|
-
* [!] By default uses the method name
|
|
117
|
-
*/
|
|
118
|
-
name: string;
|
|
119
|
-
/**
|
|
120
|
-
* Indicates a default behavior of the feature. If true the feature will be automatically attached to the execution.
|
|
121
|
-
*
|
|
122
|
-
* [!] Before feature execution the method itself will be called to prepare the feature template
|
|
123
|
-
* [!] Default is false
|
|
124
|
-
*/
|
|
125
|
-
invoke: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Allows to add a default behavior or number of steps that will be part of the feature
|
|
128
|
-
*/
|
|
129
|
-
template: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>;
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* Describes a single template item used in Feature Define decorator
|
|
133
|
-
*/
|
|
134
|
-
export type A_TYPES__FeatureDefineDecoratorTemplateItem = A_TYPES__Required<Partial<A_TYPES__A_StageStep>, ['name', 'handler', 'component']>;
|
|
135
|
-
/**
|
|
136
|
-
* Describes a target where Feature Define decorator can be applied
|
|
137
|
-
*
|
|
138
|
-
* [!] The feature can be defined on Container, Entity, Component or Command
|
|
139
|
-
*/
|
|
140
|
-
export type A_TYPES__FeatureDefineDecoratorTarget = A_Container | A_Entity | A_Component;
|
|
141
|
-
/**
|
|
142
|
-
* A type of Meta information stored by Feature Define decorator
|
|
143
|
-
* This information then uses by A-Context to build a proper feature template
|
|
144
|
-
*/
|
|
145
|
-
export type A_TYPES__FeatureDefineDecoratorMeta = {
|
|
146
|
-
/**
|
|
147
|
-
* Feature name
|
|
148
|
-
* mainly it's a unique combination of the class name and method name
|
|
149
|
-
*/
|
|
150
|
-
name: string;
|
|
151
|
-
/**
|
|
152
|
-
* Actual method name in the class
|
|
153
|
-
*/
|
|
154
|
-
handler: string;
|
|
155
|
-
/**
|
|
156
|
-
* Indicates a default behavior of the feature. If true the feature will be automatically attached to the execution.
|
|
157
|
-
*
|
|
158
|
-
* [!] Before feature execution the method itself will be called to prepare the feature template
|
|
159
|
-
* [!] Default is false
|
|
160
|
-
*/
|
|
161
|
-
invoke: boolean;
|
|
162
|
-
/**
|
|
163
|
-
* Allows to add a default behavior or number of steps that will be part of the feature
|
|
164
|
-
*/
|
|
165
|
-
template: Array<A_TYPES__A_StageStep>;
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* Descriptor type for A_Extend decorator
|
|
169
|
-
*/
|
|
170
|
-
export type A_TYPES__FeatureExtendDecoratorDescriptor = TypedPropertyDescriptor<() => any> | TypedPropertyDescriptor<(...args: any[]) => any> | TypedPropertyDescriptor<(...args: any[]) => Promise<any>> | TypedPropertyDescriptor<() => Promise<any>>;
|
|
171
|
-
/**
|
|
172
|
-
* Target type for A_Extend decorator
|
|
173
|
-
*
|
|
174
|
-
* [!] Can be applied only on A-Components
|
|
175
|
-
*/
|
|
176
|
-
export type A_TYPES__FeatureExtendDecoratorTarget = A_Component;
|
|
177
|
-
/**
|
|
178
|
-
* Configuration type for A_Extend decorator
|
|
179
|
-
*
|
|
180
|
-
* This is an INPUT parameter provided by the user
|
|
181
|
-
*/
|
|
182
|
-
export type A_TYPES__FeatureExtendDecoratorConfig = {
|
|
183
|
-
/**
|
|
184
|
-
* Name of the container Lifecycle method to be extended.
|
|
185
|
-
*
|
|
186
|
-
* [!] If not provided will be used the name of the method.
|
|
187
|
-
* [!!] If name contains "." dot it will be considered as a path to the method.
|
|
188
|
-
*/
|
|
189
|
-
name: string;
|
|
190
|
-
/**
|
|
191
|
-
* Container class or container name uses to identify the proper container in case when the name is not unique.
|
|
192
|
-
*
|
|
193
|
-
* [!] If not provided will be applied to all containers with the same name.
|
|
194
|
-
* [!!] By default uses OR to join all provided items. If you need more complex Logic, please use Regexp instead
|
|
195
|
-
*
|
|
196
|
-
* [!!!] In case if you need to exclude some containers, entities or components, please use "exclude" property
|
|
197
|
-
*
|
|
198
|
-
* Example:
|
|
199
|
-
*
|
|
200
|
-
* ```ts
|
|
201
|
-
* @A_Feature.Extend({
|
|
202
|
-
* name: 'load',
|
|
203
|
-
* scope: {
|
|
204
|
-
* include: [A_Container1, A_Entity1],
|
|
205
|
-
* exclude: [A_Component1]
|
|
206
|
-
* }
|
|
207
|
-
* })
|
|
208
|
-
* ```
|
|
209
|
-
*/
|
|
210
|
-
scope: Array<A_TYPES__FeatureExtendDecoratorScopeItem> | Partial<A_TYPES__FeatureExtendDecoratorScopeConfig>;
|
|
211
|
-
/**
|
|
212
|
-
* The behavior of the method.
|
|
213
|
-
* In case its async it will be executed independently from the main thread.
|
|
214
|
-
*
|
|
215
|
-
* [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.
|
|
216
|
-
*
|
|
217
|
-
*/
|
|
218
|
-
behavior: A_TYPES_StageExecutionBehavior;
|
|
219
|
-
/**
|
|
220
|
-
* Allows to define the order of the execution of the method.
|
|
221
|
-
*
|
|
222
|
-
* [!] It applies for the following structure :'Component.methodName'
|
|
223
|
-
* [!] In case the method has circular dependencies it will Throw an error.
|
|
224
|
-
*
|
|
225
|
-
* Example:
|
|
226
|
-
* ```ts
|
|
227
|
-
* @A_Feature.Extend({
|
|
228
|
-
* name: 'load',
|
|
229
|
-
* before: ['Component1.methodName', 'Component2.methodName2']
|
|
230
|
-
* })
|
|
231
|
-
* // OR
|
|
232
|
-
* @A_Feature.Extend({
|
|
233
|
-
* name: 'load',
|
|
234
|
-
* before: /Component2\..+/
|
|
235
|
-
* })
|
|
236
|
-
* ```
|
|
237
|
-
*/
|
|
238
|
-
before: Array<string> | RegExp;
|
|
239
|
-
/**
|
|
240
|
-
* Allows to define the order of the execution of the method.
|
|
241
|
-
*
|
|
242
|
-
* [!] It applies for the following structure :'Component.methodName'
|
|
243
|
-
* [!] In case the method has circular dependencies it will Throw an error.
|
|
244
|
-
*
|
|
245
|
-
* Example:
|
|
246
|
-
* ```ts
|
|
247
|
-
* @A_Feature.Extend({
|
|
248
|
-
* name: 'load',
|
|
249
|
-
* after: ['Component1.methodName', 'Component2.methodName2']
|
|
250
|
-
* })
|
|
251
|
-
* // OR
|
|
252
|
-
* @A_Feature.Extend({
|
|
253
|
-
* name: 'load',
|
|
254
|
-
* after: /Component2\..+/
|
|
255
|
-
* })
|
|
256
|
-
* ```
|
|
257
|
-
*
|
|
258
|
-
*/
|
|
259
|
-
after: Array<string> | RegExp;
|
|
260
|
-
/**
|
|
261
|
-
* Indicates whether to throw an error if the step fails.
|
|
262
|
-
*
|
|
263
|
-
* [!] By default is true
|
|
264
|
-
*/
|
|
265
|
-
throwOnError: boolean;
|
|
266
|
-
/**
|
|
267
|
-
* Allows to override particular steps in the feature sequence by provided names [Component].[Method] or by regexp
|
|
268
|
-
*/
|
|
269
|
-
override: Array<string> | RegExp;
|
|
270
|
-
};
|
|
271
|
-
/**
|
|
272
|
-
* Scope item that can be used in A_Extend decorator configuration
|
|
273
|
-
*/
|
|
274
|
-
export type A_TYPES__FeatureExtendDecoratorScopeConfig = {
|
|
275
|
-
/**
|
|
276
|
-
* A list of components, entities or containers to include in the scope of the extension
|
|
277
|
-
*/
|
|
278
|
-
include?: Array<A_TYPES__FeatureExtendDecoratorScopeItem>;
|
|
279
|
-
/**
|
|
280
|
-
* A list of components, entities or containers to exclude from the scope of the extension
|
|
281
|
-
*/
|
|
282
|
-
exclude?: Array<A_TYPES__FeatureExtendDecoratorScopeItem>;
|
|
283
|
-
};
|
|
284
|
-
/**
|
|
285
|
-
* A single item that can be used in scope configuration
|
|
286
|
-
*/
|
|
287
|
-
export type A_TYPES__FeatureExtendDecoratorScopeItem = A_TYPES__Container_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Component_Constructor;
|
|
288
|
-
/**
|
|
289
|
-
* Meta type for A_Extend decorator
|
|
290
|
-
*/
|
|
291
|
-
export type A_TYPES__FeatureExtendDecoratorMeta = {
|
|
292
|
-
/**
|
|
293
|
-
* Original Feature Extension name
|
|
294
|
-
*
|
|
295
|
-
* [!] could be string or regex
|
|
296
|
-
*/
|
|
297
|
-
name: string;
|
|
298
|
-
/**
|
|
299
|
-
* Actual method name in the class
|
|
300
|
-
*/
|
|
301
|
-
handler: string;
|
|
302
|
-
/**
|
|
303
|
-
* The behavior of the method.
|
|
304
|
-
* In case its async it will be executed independently from the main thread.
|
|
305
|
-
*
|
|
306
|
-
* [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.
|
|
307
|
-
*
|
|
308
|
-
*/
|
|
309
|
-
behavior: A_TYPES_StageExecutionBehavior;
|
|
310
|
-
/**
|
|
311
|
-
* Allows to define the order of the execution of the method.
|
|
312
|
-
*
|
|
313
|
-
* [!] In case the method has circular dependencies it will Throw an error.
|
|
314
|
-
*
|
|
315
|
-
*/
|
|
316
|
-
before: string;
|
|
317
|
-
/**
|
|
318
|
-
* Allows to define the order of the execution of the method.
|
|
319
|
-
*
|
|
320
|
-
* [!] In case the method has circular dependencies it will Throw an error.
|
|
321
|
-
*
|
|
322
|
-
*/
|
|
323
|
-
after: string;
|
|
324
|
-
/**
|
|
325
|
-
* Indicates whether to throw an error if the step fails.
|
|
326
|
-
*
|
|
327
|
-
* [!] By default is true
|
|
328
|
-
*/
|
|
329
|
-
throwOnError: boolean;
|
|
330
|
-
/**
|
|
331
|
-
* Allows to override particular steps in the feature sequence by provided names [Component].[Method] or by regexp
|
|
332
|
-
*/
|
|
333
|
-
override: string;
|
|
334
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.A_TYPES__FeatureState = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Feature lifecycle states
|
|
6
|
-
*/
|
|
7
|
-
var A_TYPES__FeatureState;
|
|
8
|
-
(function (A_TYPES__FeatureState) {
|
|
9
|
-
/**
|
|
10
|
-
* The feature has been initialized
|
|
11
|
-
*/
|
|
12
|
-
A_TYPES__FeatureState["INITIALIZED"] = "INITIALIZED";
|
|
13
|
-
/**
|
|
14
|
-
* The feature is currently being processed
|
|
15
|
-
*/
|
|
16
|
-
A_TYPES__FeatureState["PROCESSING"] = "PROCESSING";
|
|
17
|
-
/**
|
|
18
|
-
* The feature has been completed
|
|
19
|
-
*/
|
|
20
|
-
A_TYPES__FeatureState["COMPLETED"] = "COMPLETED";
|
|
21
|
-
/**
|
|
22
|
-
* The feature has been interrupted
|
|
23
|
-
*/
|
|
24
|
-
A_TYPES__FeatureState["INTERRUPTED"] = "INTERRUPTED";
|
|
25
|
-
})(A_TYPES__FeatureState || (exports.A_TYPES__FeatureState = A_TYPES__FeatureState = {}));
|
|
26
|
-
//# sourceMappingURL=A-Feature.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"A-Feature.types.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.types.ts"],"names":[],"mappings":";;;AAiFA;;GAEG;AACH,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAC7B;;OAEG;IACH,oDAA2B,CAAA;IAC3B;;OAEG;IACH,kDAAyB,CAAA;IACzB;;OAEG;IACH,gDAAuB,CAAA;IACvB;;OAEG;IACH,oDAA2B,CAAA;AAC/B,CAAC,EAjBW,qBAAqB,qCAArB,qBAAqB,QAiBhC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
2
|
-
import { A_TYPES__Fragment_Init } from "./A-Fragment.types";
|
|
3
|
-
export declare class A_Fragment<_MemoryItems extends Record<string, any> = any> {
|
|
4
|
-
/**
|
|
5
|
-
* Fragment Name
|
|
6
|
-
*/
|
|
7
|
-
name: string;
|
|
8
|
-
/**
|
|
9
|
-
* Memory storage for the Fragment instance
|
|
10
|
-
*/
|
|
11
|
-
protected _meta: A_Meta<_MemoryItems>;
|
|
12
|
-
/**
|
|
13
|
-
* A-Fragment is a singleton, a piece of execution Context that can be shared between the Components/Entities/Commands
|
|
14
|
-
* For every A_Scope can be defined only One A_Fragment of the same type.
|
|
15
|
-
* This class is useful for the design purpose and maintainance of the application
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* [!] Every A_Fragment is a Memory Class that can store data in memory between the steps of the pipeline.
|
|
19
|
-
* [!] So if it necessary to store some information in the Execution Context - use memory of the Fragment
|
|
20
|
-
*/
|
|
21
|
-
constructor(params?: Partial<A_TYPES__Fragment_Init>);
|
|
22
|
-
/**
|
|
23
|
-
* Returns the Meta object that allows to store data in the Fragment memory
|
|
24
|
-
*
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
get memory(): A_Meta<_MemoryItems>;
|
|
28
|
-
/**
|
|
29
|
-
* Returns the JSON representation of the Fragment
|
|
30
|
-
*
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
toJSON(): _MemoryItems & {
|
|
34
|
-
name: string;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.A_Fragment = void 0;
|
|
4
|
-
const A_Meta_class_1 = require("../A-Meta/A-Meta.class");
|
|
5
|
-
class A_Fragment {
|
|
6
|
-
/**
|
|
7
|
-
* A-Fragment is a singleton, a piece of execution Context that can be shared between the Components/Entities/Commands
|
|
8
|
-
* For every A_Scope can be defined only One A_Fragment of the same type.
|
|
9
|
-
* This class is useful for the design purpose and maintainance of the application
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* [!] Every A_Fragment is a Memory Class that can store data in memory between the steps of the pipeline.
|
|
13
|
-
* [!] So if it necessary to store some information in the Execution Context - use memory of the Fragment
|
|
14
|
-
*/
|
|
15
|
-
constructor(params = {}) {
|
|
16
|
-
/**
|
|
17
|
-
* Memory storage for the Fragment instance
|
|
18
|
-
*/
|
|
19
|
-
this._meta = new A_Meta_class_1.A_Meta();
|
|
20
|
-
/**
|
|
21
|
-
* Register the Namespace in the global Namespace provider
|
|
22
|
-
*/
|
|
23
|
-
this.name = params.name || this.constructor.name;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Returns the Meta object that allows to store data in the Fragment memory
|
|
27
|
-
*
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
get memory() {
|
|
31
|
-
return this._meta;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Returns the JSON representation of the Fragment
|
|
35
|
-
*
|
|
36
|
-
* @returns
|
|
37
|
-
*/
|
|
38
|
-
toJSON() {
|
|
39
|
-
return Object.assign({ name: this.name }, this.memory.toArray().reduce((acc, [key, value]) => {
|
|
40
|
-
acc[key] = value;
|
|
41
|
-
return acc;
|
|
42
|
-
}, {}));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.A_Fragment = A_Fragment;
|
|
46
|
-
//# sourceMappingURL=A-Fragment.class.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"A-Fragment.class.js","sourceRoot":"","sources":["../../../../src/global/A-Fragment/A-Fragment.class.ts"],"names":[],"mappings":";;;AAAA,yDAAgD;AAKhD,MAAa,UAAU;IAanB;;;;;;;;OAQG;IACH,YAAY,SAA0C,EAAE;QAfxD;;WAEG;QACO,UAAK,GAAyB,IAAI,qBAAM,EAAgB,CAAC;QAa/D;;WAEG;QACH,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAKD;;;;OAIG;IACH,MAAM;QACF,uBACI,IAAI,EAAE,IAAI,CAAC,IAAI,IACZ,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAClD,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACjB,OAAO,GAAG,CAAC;QACf,CAAC,EAAE,EAAkB,CAAC,EACxB;IACN,CAAC;CAEJ;AAxDD,gCAwDC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { A_Fragment } from "./A-Fragment.class";
|
|
2
|
-
/**
|
|
3
|
-
* Fragment constructor type
|
|
4
|
-
* Uses the generic type T to specify the type of the fragment
|
|
5
|
-
*/
|
|
6
|
-
export type A_TYPES__Fragment_Constructor<T = A_Fragment> = new (...args: any[]) => T;
|
|
7
|
-
/**
|
|
8
|
-
* Fragment initialization type
|
|
9
|
-
*/
|
|
10
|
-
export type A_TYPES__Fragment_Init = {
|
|
11
|
-
name: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Fragment serialized type
|
|
15
|
-
*/
|
|
16
|
-
export type A_TYPES__Fragment_Serialized = {
|
|
17
|
-
/**
|
|
18
|
-
* The ASEID of the fragment
|
|
19
|
-
*/
|
|
20
|
-
aseid: string;
|
|
21
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// ============================================================================
|
|
3
|
-
// --------------------------- Primary Types ----------------------------------
|
|
4
|
-
// ============================================================================
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
//# sourceMappingURL=A-Fragment.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"A-Fragment.types.js","sourceRoot":"","sources":["../../../../src/global/A-Fragment/A-Fragment.types.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { A_TYPES__A_InjectDecorator_EntityInjectionInstructions, A_TYPES__A_InjectDecoratorReturn } from "./A-Inject.types";
|
|
2
|
-
import { A_Component } from "../A-Component/A-Component.class";
|
|
3
|
-
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
4
|
-
import { A_TYPES__Component_Constructor } from "../A-Component/A-Component.types";
|
|
5
|
-
import { A_Entity } from "../A-Entity/A-Entity.class";
|
|
6
|
-
import { A_TYPES__Feature_Constructor } from "../A-Feature/A-Feature.types";
|
|
7
|
-
import { A_Caller } from "../A-Caller/A_Caller.class";
|
|
8
|
-
import { A_TYPES__Entity_Constructor } from "../A-Entity/A-Entity.types";
|
|
9
|
-
import { A_TYPES__Fragment_Constructor } from "../A-Fragment/A-Fragment.types";
|
|
10
|
-
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
11
|
-
import { A_TYPES__Scope_Constructor } from "../A-Scope/A-Scope.types";
|
|
12
|
-
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
13
|
-
/**
|
|
14
|
-
* A-Inject decorator
|
|
15
|
-
*
|
|
16
|
-
* This Decorator allows to inject dependencies into the module like
|
|
17
|
-
* - Namespaces
|
|
18
|
-
* - Other Concepts
|
|
19
|
-
* - or maybe Components
|
|
20
|
-
*
|
|
21
|
-
* @param params - see overloads
|
|
22
|
-
* @returns - decorator function
|
|
23
|
-
*/
|
|
24
|
-
export declare function A_Inject<T extends A_Scope>(
|
|
25
|
-
/***
|
|
26
|
-
* Provide the Scope constructor that will be associated with the injection.
|
|
27
|
-
*
|
|
28
|
-
* [!] It returns an instance of the Scope where the Entity/Component/Container is defined.
|
|
29
|
-
*/
|
|
30
|
-
scope: A_TYPES__Scope_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
|
|
31
|
-
export declare function A_Inject<T extends A_Feature>(
|
|
32
|
-
/**
|
|
33
|
-
* Provide the Feature constructor that will be associated with the injection.
|
|
34
|
-
*
|
|
35
|
-
* [!] It returns an Instance of the Feature what is executed.
|
|
36
|
-
*/
|
|
37
|
-
feature: A_TYPES__Feature_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
|
|
38
|
-
export declare function A_Inject<T extends A_Component>(
|
|
39
|
-
/**
|
|
40
|
-
* Provide the Component constructor that will be associated with the injection.
|
|
41
|
-
*
|
|
42
|
-
* [!] It returns an Instance of the Component from current Scope or from Parent Scopes.
|
|
43
|
-
*/
|
|
44
|
-
component: A_TYPES__Component_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
|
|
45
|
-
export declare function A_Inject(
|
|
46
|
-
/**
|
|
47
|
-
* Provide the A_Caller constructor to inject the Caller instance
|
|
48
|
-
*
|
|
49
|
-
* [!] It returns initiator of the call, e.g. Container/Component/Command who called Feature
|
|
50
|
-
*/
|
|
51
|
-
caller: typeof A_Caller): A_TYPES__A_InjectDecoratorReturn;
|
|
52
|
-
export declare function A_Inject<T extends A_Fragment>(
|
|
53
|
-
/**
|
|
54
|
-
* Provide the Fragment constructor to inject the Fragment instance
|
|
55
|
-
*
|
|
56
|
-
* [!] It returns the Fragment instance from current Scope or from Parent Scopes.
|
|
57
|
-
*/
|
|
58
|
-
fragment: A_TYPES__Fragment_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
|
|
59
|
-
export declare function A_Inject<T extends A_Entity>(
|
|
60
|
-
/**
|
|
61
|
-
* Provide the Entity constructor to inject the Entity instance
|
|
62
|
-
*
|
|
63
|
-
* [!] Note: It returns the Entity instance from current Scope or from Parent Scopes.
|
|
64
|
-
* [!] Note: If instance has more than one Entity of the same type It returns FIRST found Entity
|
|
65
|
-
* [!] Note: Use 'config' to specify to inject specific one or even Array of Entities
|
|
66
|
-
*/
|
|
67
|
-
entity: A_TYPES__Entity_Constructor<T>,
|
|
68
|
-
/**
|
|
69
|
-
* Provide additional instructions on how to perform the injection
|
|
70
|
-
*
|
|
71
|
-
* [!] Default Pagination is 1 if it's necessary to get multiple Entities please customize it in the instructions
|
|
72
|
-
*/
|
|
73
|
-
config?: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions<T>>): A_TYPES__A_InjectDecoratorReturn<T>;
|
|
74
|
-
export declare function A_Inject<T extends A_Component>(
|
|
75
|
-
/**
|
|
76
|
-
* Provide the name of Component constructor to inject the Component instance
|
|
77
|
-
*
|
|
78
|
-
* [!] You can use both customized one or original depending on your overriding strategy
|
|
79
|
-
*/
|
|
80
|
-
ctor: string): A_TYPES__A_InjectDecoratorReturn;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.A_Inject = A_Inject;
|
|
4
|
-
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
5
|
-
const A_Meta_class_1 = require("../A-Meta/A-Meta.class");
|
|
6
|
-
const A_Component_constants_1 = require("../A-Component/A-Component.constants");
|
|
7
|
-
const A_Container_constants_1 = require("../A-Container/A-Container.constants");
|
|
8
|
-
const A_TypeGuards_helper_1 = require("../../helpers/A_TypeGuards.helper");
|
|
9
|
-
const A_Inject_error_1 = require("./A-Inject.error");
|
|
10
|
-
function A_Inject(param1, param2) {
|
|
11
|
-
// pre call checks
|
|
12
|
-
if (!param1) {
|
|
13
|
-
throw new A_Inject_error_1.A_InjectError(A_Inject_error_1.A_InjectError.MissingInjectionTarget, `A-Inject decorator is missing the target to inject`);
|
|
14
|
-
}
|
|
15
|
-
return function (target, methodName, parameterIndex) {
|
|
16
|
-
// for Error handling purposes
|
|
17
|
-
const componentName = target.name || (target.constructor && target.constructor.name);
|
|
18
|
-
if (!A_TypeGuards_helper_1.A_TypeGuards.isTargetAvailableForInjection(target)) {
|
|
19
|
-
throw new A_Inject_error_1.A_InjectError(A_Inject_error_1.A_InjectError.InvalidInjectionTarget, `A-Inject cannot be used on the target of type ${typeof target} (${componentName})`);
|
|
20
|
-
}
|
|
21
|
-
// determine the method name or 'constructor' for constructor injections
|
|
22
|
-
const method = methodName ? String(methodName) : 'constructor';
|
|
23
|
-
let metaKey;
|
|
24
|
-
switch (true) {
|
|
25
|
-
case A_TypeGuards_helper_1.A_TypeGuards.isComponentConstructor(target) || A_TypeGuards_helper_1.A_TypeGuards.isComponentInstance(target):
|
|
26
|
-
metaKey = A_Component_constants_1.A_TYPES__ComponentMetaKey.INJECTIONS;
|
|
27
|
-
break;
|
|
28
|
-
case A_TypeGuards_helper_1.A_TypeGuards.isContainerInstance(target):
|
|
29
|
-
metaKey = A_Container_constants_1.A_TYPES__ContainerMetaKey.INJECTIONS;
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
// get existing meta or create a new one
|
|
33
|
-
const existedMeta = A_Context_class_1.A_Context.meta(target).get(metaKey) || new A_Meta_class_1.A_Meta();
|
|
34
|
-
// get existing injections for the method or create a new array
|
|
35
|
-
const paramsArray = existedMeta.get(method) || [];
|
|
36
|
-
// set the parameter injection info
|
|
37
|
-
paramsArray[parameterIndex] = {
|
|
38
|
-
target: param1,
|
|
39
|
-
instructions: param2
|
|
40
|
-
};
|
|
41
|
-
// save back the updated injections array
|
|
42
|
-
existedMeta.set(method, paramsArray);
|
|
43
|
-
// save back the updated meta info
|
|
44
|
-
A_Context_class_1.A_Context
|
|
45
|
-
.meta(target)
|
|
46
|
-
.set(metaKey, existedMeta);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=A-Inject.decorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"A-Inject.decorator.js","sourceRoot":"","sources":["../../../../src/global/A-Inject/A-Inject.decorator.ts"],"names":[],"mappings":";;AAsGA,4BAgEC;AA9JD,uFAA8E;AAE9E,8EAAqE;AAIrE,qGAAsG;AACtG,qGAAsG;AACtG,sFAA4E;AAC5E,qDAAiD;AAqFjD,SAAgB,QAAQ,CACpB,MAAuC,EACvC,MAAwE;IAGxE,mBAAmB;IACnB,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,MAAM,IAAI,8BAAa,CACnB,8BAAa,CAAC,sBAAsB,EACpC,oDAAoD,CACvD,CAAC;IACN,CAAC;IAGD,OAAO,UACH,MAAkC,EAClC,UAAuC,EACvC,cAAsB;QAEtB,8BAA8B;QAC9B,MAAM,aAAa,GAAI,MAAc,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,IAAK,MAAM,CAAC,WAAmB,CAAC,IAAI,CAAC,CAAC;QAEvG,IAAI,CAAC,kCAAY,CAAC,6BAA6B,CAAC,MAAM,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,8BAAa,CACnB,8BAAa,CAAC,sBAAsB,EACpC,iDAAiD,OAAO,MAAM,KAAK,aAAa,GAAG,CACtF,CAAC;QACN,CAAC;QAED,wEAAwE;QACxE,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;QAC/D,IAAI,OAAO,CAAC;QAEZ,QAAQ,IAAI,EAAE,CAAC;YACX,KAAK,kCAAY,CAAC,sBAAsB,CAAC,MAAM,CAAC,IAAI,kCAAY,CAAC,mBAAmB,CAAC,MAAM,CAAC;gBACxF,OAAO,GAAG,iDAAyB,CAAC,UAAU,CAAC;gBAC/C,MAAM;YAEV,KAAK,kCAAY,CAAC,mBAAmB,CAAC,MAAM,CAAC;gBACzC,OAAO,GAAG,iDAAyB,CAAC,UAAU,CAAC;gBAC/C,MAAM;QACd,CAAC;QAED,wCAAwC;QACxC,MAAM,WAAW,GAAG,2BAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,qBAAM,EAAE,CAAC;QACxE,+DAA+D;QAC/D,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAElD,mCAAmC;QACnC,WAAW,CAAC,cAAc,CAAC,GAAG;YAC1B,MAAM,EAAE,MAAM;YACd,YAAY,EAAE,MAAM;SACvB,CAAA;QACD,yCAAyC;QACzC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAErC,kCAAkC;QAClC,2BAAS;aACJ,IAAI,CAAC,MAAM,CAAC;aACZ,GAAG,CACA,OAAO,EACP,WAAW,CACd,CAAC;IACV,CAAC,CAAA;AACL,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { A_Error } from "../A-Error/A_Error.class";
|
|
2
|
-
export declare class A_InjectError extends A_Error {
|
|
3
|
-
static readonly InvalidInjectionTarget = "Invalid target for A-Inject decorator";
|
|
4
|
-
static readonly MissingInjectionTarget = "Missing target for A-Inject decorator";
|
|
5
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.A_InjectError = void 0;
|
|
4
|
-
const A_Error_class_1 = require("../A-Error/A_Error.class");
|
|
5
|
-
class A_InjectError extends A_Error_class_1.A_Error {
|
|
6
|
-
}
|
|
7
|
-
exports.A_InjectError = A_InjectError;
|
|
8
|
-
A_InjectError.InvalidInjectionTarget = 'Invalid target for A-Inject decorator';
|
|
9
|
-
A_InjectError.MissingInjectionTarget = 'Missing target for A-Inject decorator';
|
|
10
|
-
//# sourceMappingURL=A-Inject.error.js.map
|