@adaas/a-concept 0.0.39 → 0.0.41
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/src/decorators/A-Feature/A-Feature-Define.decorator.js +1 -0
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -1
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js +10 -0
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js.map +1 -1
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +1 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.class.d.ts +8 -2
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js +5 -1
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js.map +1 -1
- package/dist/src/global/A-Abstraction/A-Abstraction.types.d.ts +13 -4
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.class.d.ts +11 -4
- package/dist/src/global/A-Component/A-Component.class.js +13 -4
- package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.class.d.ts +11 -10
- package/dist/src/global/A-Concept/A_Concept.class.js +24 -20
- package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.meta.d.ts +4 -4
- package/dist/src/global/A-Concept/A_Concept.meta.js +14 -6
- package/dist/src/global/A-Concept/A_Concept.meta.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.class.d.ts +3 -4
- package/dist/src/global/A-Container/A-Container.class.js +8 -8
- package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.class.d.ts +6 -11
- package/dist/src/global/A-Context/A-Context.class.js +32 -32
- package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.class.d.ts +2 -2
- package/dist/src/global/A-Entity/A-Entity.class.js +4 -4
- package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.class.d.ts +10 -8
- package/dist/src/global/A-Feature/A-Feature.class.js +20 -28
- package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.types.d.ts +13 -2
- package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -1
- package/dist/src/global/A-Meta/A-Meta.class.d.ts +6 -0
- package/dist/src/global/A-Meta/A-Meta.class.js +8 -0
- package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +14 -0
- package/dist/src/global/A-Scope/A-Scope.class.js +48 -5
- package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
- package/dist/src/global/A-Stage/A-Stage.class.d.ts +3 -2
- package/dist/src/global/A-Stage/A-Stage.class.js +18 -5
- package/dist/src/global/A-Stage/A-Stage.class.js.map +1 -1
- package/dist/src/global/A-Stage/A-Stage.error.d.ts +3 -0
- package/dist/src/global/A-Stage/A-Stage.error.js +8 -0
- package/dist/src/global/A-Stage/A-Stage.error.js.map +1 -0
- package/dist/src/helpers/StepsManager.class.d.ts +17 -0
- package/dist/src/helpers/StepsManager.class.js +41 -3
- package/dist/src/helpers/StepsManager.class.js.map +1 -1
- package/examples/simple/components/A.component.ts +12 -3
- package/examples/simple/concept.ts +10 -4
- package/examples/simple/containers/Main.container.ts +6 -5
- package/examples/simple-http-server/concept.ts +1 -0
- package/examples/simple-http-server/containers/http-server.container.ts +4 -2
- package/package.json +1 -1
- package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +1 -0
- package/src/decorators/A-Feature/A-Feature-Extend.decorator.ts +17 -0
- package/src/decorators/A-Feature/A-Feature.decorator.types.ts +1 -0
- package/src/global/A-Abstraction/A-Abstraction.class.ts +11 -3
- package/src/global/A-Abstraction/A-Abstraction.types.ts +13 -6
- package/src/global/A-Component/A-Component.class.ts +12 -7
- package/src/global/A-Concept/A_Concept.class.ts +29 -21
- package/src/global/A-Concept/A_Concept.meta.ts +8 -15
- package/src/global/A-Container/A-Container.class.ts +13 -11
- package/src/global/A-Context/A-Context.class.ts +37 -99
- package/src/global/A-Entity/A-Entity.class.ts +5 -4
- package/src/global/A-Feature/A-Feature.class.ts +40 -36
- package/src/global/A-Feature/A-Feature.types.ts +14 -2
- package/src/global/A-Meta/A-Meta.class.ts +10 -0
- package/src/global/A-Scope/A-Scope.class.ts +61 -5
- package/src/global/A-Stage/A-Stage.class.ts +34 -11
- package/src/global/A-Stage/A-Stage.error.ts +9 -0
- package/src/helpers/StepsManager.class.ts +63 -3
|
@@ -47,6 +47,7 @@ function A_Feature_Define(config = {}) {
|
|
|
47
47
|
existedMeta.set(propertyKey, {
|
|
48
48
|
name: `${target.constructor.name}.${handlerName}`,
|
|
49
49
|
handler: handlerName,
|
|
50
|
+
invoke: invoke,
|
|
50
51
|
template: config.template && config.template.length ? config.template.map(item => (Object.assign(Object.assign({}, item), { before: item.before || [], after: item.after || [], behavior: item.behavior || 'sync' }))) : [],
|
|
51
52
|
channel: config.channel || []
|
|
52
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Feature-Define.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature-Define.decorator.ts"],"names":[],"mappings":";;AA8BA,
|
|
1
|
+
{"version":3,"file":"A-Feature-Define.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature-Define.decorator.ts"],"names":[],"mappings":";;AA8BA,4CA4FC;AArHD,oFAA2E;AAC3E,uFAA8E;AAC9E,6FAAoF;AACpF,6FAAoF;AACpF,6FAAkG;AAIlG,oFAAyF;AACzF,6FAAkG;AAClG,8EAAqE;AAErE;;;;;;;;;;;;GAYG;AACH,SAAgB,gBAAgB,CAC5B,SAAqD,EAAE;IAEvD,OAAO,UACH,MAA4C,EAC5C,WAAmB,EACnB,UAAiD;QAGjD,MAAM,IAAI,GAAqD,2BAAS,CA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EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;SAChC,CAAC,CAAC;QAEH,wEAAwE;QACxE,2BAAS;aACJ,IAAI,CAAC,MAAM,CAAC,WAAkB,CAAC;aAC/B,GAAG,CACA,OAAO,EACP,WAAW,CACd,CAAC;QAGN,MAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAC;QAIzC,qDAAqD;QACrD,0FAA0F;QAC1F,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAW;YAEvC,2BAA2B;YAC3B,IAAI,CAAC,MAAM;gBACP,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;gBAExC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAErC,0CAA0C;YAC1C,IAAI,OAAQ,IAAY,CAAC,IAAI,KAAK,UAAU,IAAI,MAAM;gBAClD,OAAQ,IAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE/C,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -27,11 +27,21 @@ function A_Feature_Extend(param1) {
|
|
|
27
27
|
else {
|
|
28
28
|
targetRegexp = new RegExp(`^.*\\.${propertyKey}$`);
|
|
29
29
|
}
|
|
30
|
+
const existedDefinitions = A_Context_class_1.A_Context
|
|
31
|
+
.meta(target)
|
|
32
|
+
.get(A_Component_types_1.A_TYPES__ComponentMetaKey.FEATURES);
|
|
30
33
|
// Get the existed metadata or create a new one
|
|
31
34
|
const existedMeta = A_Context_class_1.A_Context
|
|
32
35
|
.meta(target)
|
|
33
36
|
.get(A_Component_types_1.A_TYPES__ComponentMetaKey.EXTENSIONS)
|
|
34
37
|
|| new A_Meta_class_1.A_Meta();
|
|
38
|
+
if (existedDefinitions
|
|
39
|
+
&& existedDefinitions.size()
|
|
40
|
+
&& existedDefinitions.has(propertyKey)
|
|
41
|
+
&& existedDefinitions.get(propertyKey).invoke) {
|
|
42
|
+
throw new Error(`A-Feature-Extend cannot be used on the method "${propertyKey}" because it is already defined as a Feature with "invoke" set to true.
|
|
43
|
+
Please remove the A-Feature-Extend decorator or set "invoke" to false in the A-Feature decorator.`);
|
|
44
|
+
}
|
|
35
45
|
const existedMetaValue = existedMeta.get(targetRegexp.source) || [];
|
|
36
46
|
// Add the new method to the metadata
|
|
37
47
|
existedMetaValue.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Feature-Extend.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature-Extend.decorator.ts"],"names":[],"mappings":";;AA+CA,
|
|
1
|
+
{"version":3,"file":"A-Feature-Extend.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature-Extend.decorator.ts"],"names":[],"mappings":";;AA+CA,4CA8EC;AAxHD,6FAAkG;AAClG,uFAA8E;AAC9E,8EAAqE;AAwCrE,SAAgB,gBAAgB,CAC5B,MAA2D;IAE3D,OAAO,UACH,MAAmB,EACnB,WAAmB,EACnB,UAAgD;QAGhD,IAAI,YAAoB,CAAC;QACzB,IAAI,QAAQ,GAAqB,MAAM,CAAC;QACxC,IAAI,MAAM,GAAa,EAAE,CAAC;QAC1B,IAAI,KAAK,GAAa,EAAE,CAAC;QAGzB,kCAAkC;QAClC,IAAI,MAAM,YAAY,MAAM,EAAE,CAAC;YAC3B,YAAY,GAAG,MAAM,CAAC;QAC1B,CAAC;aACI,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;YAChB,YAAY,GAAG,IAAI,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK;gBACtC,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK;qBACb,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;qBAClB,IAAI,CAAC,GAAG,CAAC,GAAG;gBACjB,CAAC,CAAC,IACF,MAAM,MAAM,CAAC,IAAI,IAAI,WAAW,GAAG,CAAC,CAAC;YAEzC,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C;IAChE,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -20,6 +20,7 @@ export type A_TYPES__A_FeatureTemplateItem = A_TYPES__Required<Partial<A_TYPES__
|
|
|
20
20
|
export type A_TYPES__A_DefineDecorator_Meta = {
|
|
21
21
|
name: string;
|
|
22
22
|
handler: string;
|
|
23
|
+
invoke: boolean;
|
|
23
24
|
channel: Array<typeof A_Channel>;
|
|
24
25
|
template: Array<A_TYPES__A_StageStep>;
|
|
25
26
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { A_Abstraction_Extend } from "../../decorators/A-Abstraction/A-Abstraction-Extend.decorator";
|
|
2
2
|
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
3
3
|
import { A_TYPES__A_AbstractionConstructor, A_TYPES__AbstractionState } from "./A-Abstraction.types";
|
|
4
|
-
import { A_Error
|
|
4
|
+
import { A_Error } from "@adaas/a-utils";
|
|
5
|
+
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
5
6
|
export declare class A_Abstraction {
|
|
6
7
|
name: string;
|
|
7
8
|
protected features: A_Feature[];
|
|
@@ -9,11 +10,16 @@ export declare class A_Abstraction {
|
|
|
9
10
|
protected _index: number;
|
|
10
11
|
state: A_TYPES__AbstractionState;
|
|
11
12
|
error?: A_Error;
|
|
13
|
+
readonly Scope: A_Scope;
|
|
12
14
|
/**
|
|
13
15
|
* Define a new A-Abstraction
|
|
14
16
|
*/
|
|
15
17
|
static get Extend(): typeof A_Abstraction_Extend;
|
|
16
|
-
constructor(
|
|
18
|
+
constructor(
|
|
19
|
+
/**
|
|
20
|
+
* Parameters to define the A-Abstraction
|
|
21
|
+
*/
|
|
22
|
+
params: A_TYPES__A_AbstractionConstructor);
|
|
17
23
|
get feature(): A_Feature | undefined;
|
|
18
24
|
[Symbol.iterator](): Iterator<A_Feature, any>;
|
|
19
25
|
/**
|
|
@@ -20,7 +20,11 @@ class A_Abstraction {
|
|
|
20
20
|
static get Extend() {
|
|
21
21
|
return A_Abstraction_Extend_decorator_1.A_Abstraction_Extend;
|
|
22
22
|
}
|
|
23
|
-
constructor(
|
|
23
|
+
constructor(
|
|
24
|
+
/**
|
|
25
|
+
* Parameters to define the A-Abstraction
|
|
26
|
+
*/
|
|
27
|
+
params) {
|
|
24
28
|
this.features = [];
|
|
25
29
|
this._index = 0;
|
|
26
30
|
this.state = A_Abstraction_types_1.A_TYPES__AbstractionState.INITIALIZED;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Abstraction.class.js","sourceRoot":"","sources":["../../../../src/global/A-Abstraction/A-Abstraction.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6HAAgH;AAChH,kEAAyD;AACzD,+DAAqG;
|
|
1
|
+
{"version":3,"file":"A-Abstraction.class.js","sourceRoot":"","sources":["../../../../src/global/A-Abstraction/A-Abstraction.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6HAAgH;AAChH,kEAAyD;AACzD,+DAAqG;AAKrG,MAAa,aAAa;IAatB;;OAEG;IACH,MAAM,KAAK,MAAM;QACb,OAAO,qDAAoB,CAAC;IAChC,CAAC;IAGD;IACI;;OAEG;IACH,MAAyC;QAtBnC,aAAQ,GAAgB,EAAE,CAAC;QAE3B,WAAM,GAAW,CAAC,CAAC;QAE7B,UAAK,GAA8B,+CAAyB,CAAC,WAAW,CAAC;QAoBrE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QAExB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,2BAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QAE/D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAGD,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAGD,CAAC,MAAM,CAAC,QAAQ,CAAC;QACb,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CAAC,KAAK,KAAK,+CAAyB,CAAC,MAAM,CAAC;IAC3D,CAAC;IAGK,OAAO;;YACT,IAAI,IAAI,CAAC,MAAM,EAAE;gBACb,OAAO;YACX,IAAI,CAAC;gBACD,IAAI,CAAC,KAAK,GAAG,+CAAyB,CAAC,UAAU,CAAC;gBAElD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAElC,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC5B,CAAC;gBAED,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;YAE3B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC;QAEL,CAAC;KAAA;CACJ;AAlID,sCAkIC"}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import { A_TYPES__Required } from "@adaas/a-utils";
|
|
2
1
|
import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
|
|
3
|
-
import {
|
|
2
|
+
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
4
3
|
export type A_TYPES__A_AbstractionConstructor = {
|
|
4
|
+
/**
|
|
5
|
+
* Name of the A-Abstraction
|
|
6
|
+
*/
|
|
5
7
|
name: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Features that compose the A-Abstraction
|
|
10
|
+
*/
|
|
11
|
+
features: Array<A_TYPES__FeatureConstructor>;
|
|
12
|
+
/**
|
|
13
|
+
* Scope in which the A-Abstraction will be executed
|
|
14
|
+
*/
|
|
15
|
+
scope: A_Scope;
|
|
16
|
+
};
|
|
8
17
|
export declare enum A_TYPES__AbstractionState {
|
|
9
18
|
INITIALIZED = "INITIALIZED",
|
|
10
19
|
PROCESSING = "PROCESSING",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Abstraction.types.js","sourceRoot":"","sources":["../../../../src/global/A-Abstraction/A-Abstraction.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"A-Abstraction.types.js","sourceRoot":"","sources":["../../../../src/global/A-Abstraction/A-Abstraction.types.ts"],"names":[],"mappings":";;;AAsBA,IAAY,yBAMX;AAND,WAAY,yBAAyB;IACjC,wDAA2B,CAAA;IAC3B,sDAAyB,CAAA;IAEzB,oDAAuB,CAAA;IACvB,8CAAiB,CAAA;AACrB,CAAC,EANW,yBAAyB,yCAAzB,yBAAyB,QAMpC"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A_TYPES__FeatureCallParams } from "../A-Feature/A-Feature.types";
|
|
1
|
+
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
3
2
|
/**
|
|
4
3
|
* This element only contains the specific code
|
|
5
4
|
*
|
|
6
5
|
*/
|
|
7
6
|
export declare class A_Component {
|
|
8
|
-
constructor(
|
|
9
|
-
call(
|
|
7
|
+
constructor();
|
|
8
|
+
call(
|
|
9
|
+
/**
|
|
10
|
+
* Name of the feature to call
|
|
11
|
+
*/
|
|
12
|
+
feature: string,
|
|
13
|
+
/**
|
|
14
|
+
* Scope in which the feature will be executed
|
|
15
|
+
*/
|
|
16
|
+
scope?: A_Scope): Promise<any>;
|
|
10
17
|
}
|
|
@@ -16,12 +16,21 @@ const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
class A_Component {
|
|
19
|
-
constructor(
|
|
19
|
+
constructor() {
|
|
20
20
|
console.log('A-Component instance created', this);
|
|
21
21
|
}
|
|
22
|
-
call(
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
call(
|
|
23
|
+
/**
|
|
24
|
+
* Name of the feature to call
|
|
25
|
+
*/
|
|
26
|
+
feature,
|
|
27
|
+
/**
|
|
28
|
+
* Scope in which the feature will be executed
|
|
29
|
+
*/
|
|
30
|
+
scope) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
scope = scope ? scope.inherit(A_Context_class_1.A_Context.scope(this)) : A_Context_class_1.A_Context.scope(this);
|
|
33
|
+
const newFeature = A_Context_class_1.A_Context.feature(this, feature, scope);
|
|
25
34
|
return yield newFeature.process();
|
|
26
35
|
});
|
|
27
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Component.class.js","sourceRoot":"","sources":["../../../../src/global/A-Component/A-Component.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kEAAyD;
|
|
1
|
+
{"version":3,"file":"A-Component.class.js","sourceRoot":"","sources":["../../../../src/global/A-Component/A-Component.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kEAAyD;AAOzD;;;GAGG;AACH,MAAa,WAAW;IACpB;QACI,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC;IAEtD,CAAC;IAGK,IAAI;IACN;;OAEG;IACH,OAAe;IACf;;OAEG;IACH,KAAe;;YAEf,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,2BAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,2BAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAE7E,MAAM,UAAU,GAAG,2BAAS,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;YAE3D,OAAO,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;QACtC,CAAC;KAAA;CACJ;AAvBD,kCAuBC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A_TYPES__IConceptConstructor } from "./A_Concept.types";
|
|
2
2
|
import { A_Container } from "../A-Container/A-Container.class";
|
|
3
3
|
import { A_Abstraction_Extend } from "../../decorators/A-Abstraction/A-Abstraction-Extend.decorator";
|
|
4
|
+
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
4
5
|
/**
|
|
5
6
|
* A_Concept is a placeholder for the concept of the ani program.
|
|
6
7
|
*
|
|
@@ -53,41 +54,41 @@ export declare class A_Concept<_Imports extends A_Container[] = any> {
|
|
|
53
54
|
protected containers: A_Container[];
|
|
54
55
|
constructor(props: A_TYPES__IConceptConstructor<_Imports>);
|
|
55
56
|
get namespace(): string;
|
|
56
|
-
get Scope():
|
|
57
|
+
get Scope(): A_Scope;
|
|
57
58
|
/**
|
|
58
59
|
* Load the concept.
|
|
59
60
|
*/
|
|
60
|
-
load(
|
|
61
|
+
load(scope?: A_Scope): Promise<void>;
|
|
61
62
|
/**
|
|
62
63
|
* Run the concept.
|
|
63
64
|
*/
|
|
64
|
-
run(
|
|
65
|
+
run(scope?: A_Scope): Promise<void>;
|
|
65
66
|
/**
|
|
66
67
|
* Start the concept.
|
|
67
68
|
*
|
|
68
69
|
* @param params
|
|
69
70
|
*/
|
|
70
|
-
start(
|
|
71
|
+
start(scope?: A_Scope): Promise<void>;
|
|
71
72
|
/**
|
|
72
73
|
* Stop the concept.
|
|
73
74
|
*
|
|
74
75
|
* @param params
|
|
75
76
|
*/
|
|
76
|
-
stop(
|
|
77
|
+
stop(scope?: A_Scope): Promise<void>;
|
|
77
78
|
/**
|
|
78
79
|
* Build the concept.
|
|
79
80
|
*/
|
|
80
|
-
build(
|
|
81
|
+
build(scope?: A_Scope): Promise<void>;
|
|
81
82
|
/**
|
|
82
83
|
* Deploy the concept.
|
|
83
84
|
*/
|
|
84
|
-
deploy(
|
|
85
|
+
deploy(scope?: A_Scope): Promise<void>;
|
|
85
86
|
/**
|
|
86
87
|
* Publish the concept.
|
|
87
88
|
*/
|
|
88
|
-
publish(
|
|
89
|
+
publish(scope?: A_Scope): Promise<void>;
|
|
89
90
|
/**
|
|
90
91
|
* Call the specific method of the concept or included modules.
|
|
91
92
|
*/
|
|
92
|
-
call<K extends Record<_Imports[number]['name'], string>>(container: K[keyof K]
|
|
93
|
+
call<K extends Record<_Imports[number]['name'], string>>(container: K[keyof K]): Promise<void>;
|
|
93
94
|
}
|
|
@@ -81,13 +81,12 @@ class A_Concept {
|
|
|
81
81
|
constructor(props) {
|
|
82
82
|
this.props = props;
|
|
83
83
|
this.sharedBase = new A_Container_class_1.A_Container({
|
|
84
|
-
name: props.name
|
|
84
|
+
name: `${props.name}::base`,
|
|
85
85
|
fragments: props.fragments || [],
|
|
86
86
|
entities: props.entities || [],
|
|
87
|
-
// containers: props.containers
|
|
88
87
|
components: [
|
|
89
88
|
// A_Logger,
|
|
90
|
-
]
|
|
89
|
+
],
|
|
91
90
|
});
|
|
92
91
|
this.containers = (props.containers || []).map(container => {
|
|
93
92
|
container.Scope.parent(this.Scope);
|
|
@@ -107,19 +106,20 @@ class A_Concept {
|
|
|
107
106
|
/**
|
|
108
107
|
* Load the concept.
|
|
109
108
|
*/
|
|
110
|
-
load(
|
|
109
|
+
load(scope) {
|
|
111
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
|
|
111
|
+
scope = scope ? scope.inherit(this.Scope) : this.Scope;
|
|
112
|
+
const abstraction = this.meta.abstraction(A_Concept_types_1.A_TYPES__ConceptStage.Load, scope);
|
|
113
113
|
yield abstraction.process();
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Run the concept.
|
|
118
118
|
*/
|
|
119
|
-
run(
|
|
119
|
+
run(scope) {
|
|
120
120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
|
|
122
|
-
const abstraction = this.meta.abstraction(A_Concept_types_1.A_TYPES__ConceptStage.Run,
|
|
121
|
+
scope = scope ? scope.inherit(this.Scope) : this.Scope;
|
|
122
|
+
const abstraction = this.meta.abstraction(A_Concept_types_1.A_TYPES__ConceptStage.Run, scope);
|
|
123
123
|
yield abstraction.process();
|
|
124
124
|
});
|
|
125
125
|
}
|
|
@@ -128,10 +128,10 @@ class A_Concept {
|
|
|
128
128
|
*
|
|
129
129
|
* @param params
|
|
130
130
|
*/
|
|
131
|
-
start(
|
|
131
|
+
start(scope) {
|
|
132
132
|
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
|
|
134
|
-
const abstraction = this.meta.abstraction(A_Concept_types_1.A_TYPES__ConceptStage.Start,
|
|
133
|
+
scope = scope ? scope.inherit(this.Scope) : this.Scope;
|
|
134
|
+
const abstraction = this.meta.abstraction(A_Concept_types_1.A_TYPES__ConceptStage.Start, scope);
|
|
135
135
|
yield abstraction.process();
|
|
136
136
|
});
|
|
137
137
|
}
|
|
@@ -140,36 +140,40 @@ class A_Concept {
|
|
|
140
140
|
*
|
|
141
141
|
* @param params
|
|
142
142
|
*/
|
|
143
|
-
stop(
|
|
143
|
+
stop(scope) {
|
|
144
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
-
|
|
145
|
+
scope = scope ? scope.inherit(this.Scope) : this.Scope;
|
|
146
|
+
const abstraction = this.meta.abstraction(A_Concept_types_1.A_TYPES__ConceptStage.Stop, scope);
|
|
146
147
|
yield abstraction.process();
|
|
147
148
|
});
|
|
148
149
|
}
|
|
149
150
|
/**
|
|
150
151
|
* Build the concept.
|
|
151
152
|
*/
|
|
152
|
-
build(
|
|
153
|
+
build(scope) {
|
|
153
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
-
|
|
155
|
+
scope = scope ? scope.inherit(this.Scope) : this.Scope;
|
|
156
|
+
const abstraction = this.meta.abstraction(A_Concept_types_1.A_TYPES__ConceptStage.Build, scope);
|
|
155
157
|
yield abstraction.process();
|
|
156
158
|
});
|
|
157
159
|
}
|
|
158
160
|
/**
|
|
159
161
|
* Deploy the concept.
|
|
160
162
|
*/
|
|
161
|
-
deploy(
|
|
163
|
+
deploy(scope) {
|
|
162
164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
-
|
|
165
|
+
scope = scope ? scope.inherit(this.Scope) : this.Scope;
|
|
166
|
+
const abstraction = this.meta.abstraction(A_Concept_types_1.A_TYPES__ConceptStage.Deploy, scope);
|
|
164
167
|
yield abstraction.process();
|
|
165
168
|
});
|
|
166
169
|
}
|
|
167
170
|
/**
|
|
168
171
|
* Publish the concept.
|
|
169
172
|
*/
|
|
170
|
-
publish(
|
|
173
|
+
publish(scope) {
|
|
171
174
|
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
-
|
|
175
|
+
scope = scope ? scope.inherit(this.Scope) : this.Scope;
|
|
176
|
+
const abstraction = this.meta.abstraction(A_Concept_types_1.A_TYPES__ConceptStage.Publish, scope);
|
|
173
177
|
yield abstraction.process();
|
|
174
178
|
});
|
|
175
179
|
}
|
|
@@ -179,7 +183,7 @@ class A_Concept {
|
|
|
179
183
|
/**
|
|
180
184
|
* Call the specific method of the concept or included modules.
|
|
181
185
|
*/
|
|
182
|
-
call(container
|
|
186
|
+
call(container) {
|
|
183
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
188
|
// const definition = this.meta.abstractionDefinition(A_TYPES__ConceptStage.Run, {
|
|
185
189
|
// components: params?.components,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A_Concept.class.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAgK;AAChK,wEAA+D;AAC/D,8EAAqE;AACrE,qDAAiD;
|
|
1
|
+
{"version":3,"file":"A_Concept.class.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAgK;AAChK,wEAA+D;AAC/D,8EAAqE;AACrE,qDAAiD;AAKjD,wFAAwF;AAIxF;;;;;;;;;;;GAWG;AACH,MAAa,SAAS;IAIlB,iFAAiF;IACjF,iFAAiF;IACjF,iFAAiF;IACjF;;OAEG;IACH,MAAM,CAAC,IAAI;QACP,OAAO,mCAAa,CAAC,MAAM,CAAC,uCAAqB,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO;QACV,OAAO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EvD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,uCAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAEhF,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;QAChC,CAAC;KAAA;IAGD,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAG1E;;OAEG;IACG,IAAI,CAGN,SAAqB;;YAErB,kFAAkF;YAClF,sCAAsC;YACtC,oCAAoC;YACpC,MAAM;YAEN,6CAA6C;YAE7C,2BAA2B;QAC/B,CAAC;KAAA;CAEJ;AA5OD,8BA4OC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { A_Container } from "../A-Container/A-Container.class";
|
|
2
2
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
3
|
-
import {
|
|
4
|
-
import { A_TYPES__ConceptAbstractionCallParams, A_TYPES__ConceptStage } from "./A_Concept.types";
|
|
3
|
+
import { A_TYPES__ConceptStage } from "./A_Concept.types";
|
|
5
4
|
import { A_TYPES__A_AbstractionConstructor } from "../A-Abstraction/A-Abstraction.types";
|
|
6
5
|
import { A_Abstraction } from "../A-Abstraction/A-Abstraction.class";
|
|
6
|
+
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
7
7
|
export declare class A_ConceptMeta extends A_Meta<any> {
|
|
8
8
|
private containers;
|
|
9
9
|
private base;
|
|
10
10
|
constructor(containers: Array<A_Container>, base: A_Container);
|
|
11
|
-
abstractionDefinition(method: A_TYPES__ConceptStage,
|
|
12
|
-
abstraction(method: A_TYPES__ConceptStage,
|
|
11
|
+
abstractionDefinition(method: A_TYPES__ConceptStage, scope: A_Scope): A_TYPES__A_AbstractionConstructor;
|
|
12
|
+
abstraction(method: A_TYPES__ConceptStage, scope: A_Scope): A_Abstraction;
|
|
13
13
|
}
|
|
@@ -11,17 +11,25 @@ class A_ConceptMeta extends A_Meta_class_1.A_Meta {
|
|
|
11
11
|
this.containers = containers;
|
|
12
12
|
this.base = base;
|
|
13
13
|
}
|
|
14
|
-
abstractionDefinition(method,
|
|
15
|
-
const featureDefinitions = this.containers.map(container => A_Context_class_1.A_Context.abstractionDefinition(container
|
|
16
|
-
const definition =
|
|
14
|
+
abstractionDefinition(method, scope) {
|
|
15
|
+
const featureDefinitions = this.containers.map(container => A_Context_class_1.A_Context.abstractionDefinition(container, method, scope));
|
|
16
|
+
const definition = {
|
|
17
|
+
name: `${this.base.name}.${method}`,
|
|
18
|
+
features: featureDefinitions,
|
|
19
|
+
scope
|
|
20
|
+
};
|
|
17
21
|
return definition;
|
|
18
22
|
}
|
|
19
|
-
abstraction(method,
|
|
23
|
+
abstraction(method, scope) {
|
|
20
24
|
const featureDefinitions = this.containers.map(container => {
|
|
21
|
-
const definition = A_Context_class_1.A_Context.abstractionDefinition(container
|
|
25
|
+
const definition = A_Context_class_1.A_Context.abstractionDefinition(container, method, container.Scope);
|
|
22
26
|
return Object.assign(Object.assign({}, definition), { steps: definition.steps.map(step => (Object.assign(Object.assign({}, step), { component: step.component ? step.component : container }))) });
|
|
23
27
|
});
|
|
24
|
-
const definition =
|
|
28
|
+
const definition = {
|
|
29
|
+
name: `${this.base.name}.${method}`,
|
|
30
|
+
features: featureDefinitions,
|
|
31
|
+
scope
|
|
32
|
+
};
|
|
25
33
|
return new A_Abstraction_class_1.A_Abstraction(definition);
|
|
26
34
|
}
|
|
27
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A_Concept.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.meta.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAKhD,uFAA8E;AAG9E,8EAAqE;
|
|
1
|
+
{"version":3,"file":"A_Concept.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.meta.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAKhD,uFAA8E;AAG9E,8EAAqE;AAErE,gEAAgE;AAGhE,MAAa,aAAc,SAAQ,qBAAW;IAG1C,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 +1,6 @@
|
|
|
1
1
|
import { A_TYPES__ContainerConstructor } from "./A-Container.types";
|
|
2
|
-
import { A_TYPES__Required } from "@adaas/a-utils";
|
|
3
2
|
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
4
|
-
import {
|
|
3
|
+
import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
|
|
5
4
|
/**
|
|
6
5
|
* This class should combine Components to achieve the goal withing Concept
|
|
7
6
|
*
|
|
@@ -26,13 +25,13 @@ export declare class A_Container {
|
|
|
26
25
|
* Configuration of the container that will be used to run it.
|
|
27
26
|
*/
|
|
28
27
|
config: Partial<A_TYPES__ContainerConstructor<any>>);
|
|
29
|
-
call(feature: string,
|
|
28
|
+
call(feature: string, scope?: A_Scope): Promise<any>;
|
|
30
29
|
/**
|
|
31
30
|
* This method allows to get a feature Definition for the future reuse with custom Feature classes
|
|
32
31
|
*
|
|
33
32
|
* @param feature
|
|
34
33
|
*/
|
|
35
|
-
feature(feature: string,
|
|
34
|
+
feature(feature: string, scope?: A_Scope): A_TYPES__FeatureConstructor;
|
|
36
35
|
/**
|
|
37
36
|
* Before init hook to be used in inherited classes
|
|
38
37
|
*
|
|
@@ -35,13 +35,12 @@ class A_Container {
|
|
|
35
35
|
*/
|
|
36
36
|
config) {
|
|
37
37
|
this.config = config;
|
|
38
|
-
|
|
39
|
-
const fragments = config.fragments || [];
|
|
40
|
-
A_Context_class_1.A_Context.allocate(this, config);
|
|
38
|
+
A_Context_class_1.A_Context.allocate(this, Object.assign({ name: this.name }, config));
|
|
41
39
|
}
|
|
42
|
-
call(
|
|
43
|
-
return __awaiter(this,
|
|
44
|
-
|
|
40
|
+
call(feature, scope) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
scope = scope ? scope.inherit(this.Scope) : this.Scope;
|
|
43
|
+
const newFeature = A_Context_class_1.A_Context.feature(this, feature, scope);
|
|
45
44
|
return yield newFeature.process();
|
|
46
45
|
});
|
|
47
46
|
}
|
|
@@ -50,8 +49,9 @@ class A_Container {
|
|
|
50
49
|
*
|
|
51
50
|
* @param feature
|
|
52
51
|
*/
|
|
53
|
-
feature(feature,
|
|
54
|
-
|
|
52
|
+
feature(feature, scope) {
|
|
53
|
+
scope = scope ? scope.inherit(this.Scope) : this.Scope;
|
|
54
|
+
return A_Context_class_1.A_Context.featureDefinition(this, feature, scope);
|
|
55
55
|
}
|
|
56
56
|
// ==============================================================
|
|
57
57
|
// ======================= HOOKS ================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Container.class.js","sourceRoot":"","sources":["../../../../src/global/A-Container/A-Container.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kEAAyD;AAMzD;;;;;;;;;;GAUG;AACH,MAAa,WAAW;IAUpB,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACrD,CAAC;IAED,IAAI,KAAK;QACL,OAAO,2BAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAGD;IACI;;OAEG;IACH,MAAmD;QAEnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,
|
|
1
|
+
{"version":3,"file":"A-Container.class.js","sourceRoot":"","sources":["../../../../src/global/A-Container/A-Container.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kEAAyD;AAMzD;;;;;;;;;;GAUG;AACH,MAAa,WAAW;IAUpB,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACrD,CAAC;IAED,IAAI,KAAK;QACL,OAAO,2BAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAGD;IACI;;OAEG;IACH,MAAmD;QAEnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,2BAAS,CAAC,QAAQ,CAAC,IAAI,kBACnB,IAAI,EAAE,IAAI,CAAC,IAAI,IACZ,MAAM,EACX,CAAC;IACP,CAAC;IAGK,IAAI,CACN,OAAe,EACf,KAAe;;YAEf,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YAEvD,MAAM,UAAU,GAAG,2BAAS,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;YAE3D,OAAO,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;QACtC,CAAC;KAAA;IAGD;;;;OAIG;IACH,OAAO,CACH,OAAe,EACf,KAAe;QAGf,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;QAEvD,OAAO,2BAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC;IAGD,iEAAiE;IACjE,iEAAiE;IACjE,iEAAiE;IAEjE;;;;OAIG;IACa,YAAY;;YACxB,OAAO;QACX,CAAC;KAAA;IAED;;OAEG;IACa,MAAM;;YAClB,OAAO;QACX,CAAC;KAAA;IAED;;;;OAIG;IACa,WAAW;;YACvB,OAAO;QACX,CAAC;KAAA;CAEJ;AA3FD,kCA2FC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { A_TYPES__Required } from "@adaas/a-utils";
|
|
2
1
|
import { A_Component } from "../A-Component/A-Component.class";
|
|
3
2
|
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
4
3
|
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
@@ -8,7 +7,6 @@ import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "../A-Scope/A-Sc
|
|
|
8
7
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
9
8
|
import { A_ComponentMeta } from "../A-Component/A-Component.meta";
|
|
10
9
|
import { A_ContainerMeta } from "../A-Container/A-Container.meta";
|
|
11
|
-
import { A_TYPES__EntityBaseMethod } from "../A-Entity/A-Entity.types";
|
|
12
10
|
import { A_Entity } from "../A-Entity/A-Entity.class";
|
|
13
11
|
import { A_EntityMeta } from "../A-Entity/A-Entity.meta";
|
|
14
12
|
import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
|
|
@@ -55,8 +53,11 @@ export declare class A_Context {
|
|
|
55
53
|
static get root(): A_Scope;
|
|
56
54
|
static get environment(): 'server' | 'browser';
|
|
57
55
|
static allocate(component: any, importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>): A_Scope;
|
|
56
|
+
static allocate(component: any, importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig> | A_Scope): A_Scope;
|
|
58
57
|
static allocate(feature: A_Feature, importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>): A_Scope;
|
|
58
|
+
static allocate(feature: A_Feature, importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig> | A_Scope): A_Scope;
|
|
59
59
|
static allocate(container: A_Container, importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>): A_Scope;
|
|
60
|
+
static allocate(container: A_Container, importing: A_Scope): A_Scope;
|
|
60
61
|
static meta(container: typeof A_Container): A_ContainerMeta;
|
|
61
62
|
static meta(container: A_Container): A_ContainerMeta;
|
|
62
63
|
static meta(entity: A_Entity): A_ContainerMeta;
|
|
@@ -84,27 +85,21 @@ export declare class A_Context {
|
|
|
84
85
|
* @param scope
|
|
85
86
|
* @returns
|
|
86
87
|
*/
|
|
87
|
-
static featureDefinition(
|
|
88
|
-
static featureDefinition(scope: A_Scope, container: A_Container, feature: string, params?: Partial<A_TYPES__ScopeConstructor>): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>;
|
|
89
|
-
static featureDefinition(scope: A_Scope, component: A_Component, feature: string, params?: Partial<A_TYPES__ScopeConstructor>): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>;
|
|
88
|
+
static featureDefinition(component: A_Component | A_Container | A_Entity, feature: string | RegExp, scope: A_Scope): A_TYPES__FeatureConstructor;
|
|
90
89
|
/**
|
|
91
90
|
* This method returns a constructor params to create a new feature
|
|
92
91
|
*
|
|
93
92
|
* @param scope
|
|
94
93
|
* @returns
|
|
95
94
|
*/
|
|
96
|
-
static abstractionDefinition(
|
|
97
|
-
static abstractionDefinition(scope: A_Scope, container: A_Container, feature: A_TYPES__ConceptStage, params?: Partial<A_TYPES__ScopeConstructor>): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>;
|
|
98
|
-
static abstractionDefinition(scope: A_Scope, component: A_Component, feature: A_TYPES__ConceptStage, params?: Partial<A_TYPES__ScopeConstructor>): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>;
|
|
95
|
+
static abstractionDefinition(component: A_Component | A_Container | A_Entity, abstraction: A_TYPES__ConceptStage, scope: A_Scope): A_TYPES__FeatureConstructor;
|
|
99
96
|
/**
|
|
100
97
|
* This method returns a step-by-step instructions of feature implementation depending on the feature name and the class.
|
|
101
98
|
*
|
|
102
99
|
* @param scope
|
|
103
100
|
* @returns
|
|
104
101
|
*/
|
|
105
|
-
static feature<T extends Array<string>>(
|
|
106
|
-
static feature<T extends Array<string>>(scope: A_Scope, container: A_Container, feature: T[number], params?: Partial<A_TYPES__ScopeConstructor>): A_Feature;
|
|
107
|
-
static feature(scope: A_Scope, component: A_Component, feature: string, params?: Partial<A_TYPES__ScopeConstructor>): A_Feature;
|
|
102
|
+
static feature<T extends Array<string>>(component: A_Component | A_Container | A_Entity<any, any>, feature: string | T[number] | RegExp, scope: A_Scope): A_Feature;
|
|
108
103
|
/**
|
|
109
104
|
* Register a Namespace in the provider.
|
|
110
105
|
* @param Namespace
|