@adaas/a-concept 0.2.14 → 0.3.2

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.
Files changed (144) hide show
  1. package/.conf/tsconfig.base.json +91 -0
  2. package/.conf/tsconfig.browser.json +36 -0
  3. package/.conf/tsconfig.node.json +40 -0
  4. package/dist/browser/index.d.mts +4188 -212
  5. package/dist/browser/index.mjs +2 -67
  6. package/dist/browser/index.mjs.map +1 -1
  7. package/dist/node/index.cjs +5810 -383
  8. package/dist/node/index.cjs.map +1 -1
  9. package/dist/node/index.d.mts +4215 -212
  10. package/dist/node/index.d.ts +4215 -212
  11. package/dist/node/index.mjs +5751 -66
  12. package/dist/node/index.mjs.map +1 -1
  13. package/jest.config.ts +30 -15
  14. package/package.json +19 -16
  15. package/src/env/env-browser.ts +38 -1
  16. package/src/env/env-node.ts +26 -2
  17. package/src/env/env.base.ts +21 -2
  18. package/src/env/global.browser.d.ts +1 -1
  19. package/src/helpers/A_BasicTypeGuards.helper.ts +81 -0
  20. package/src/helpers/A_Common.helper.ts +2 -2
  21. package/src/helpers/A_Identity.helper.ts +2 -4
  22. package/src/helpers/A_TypeGuards.helper.ts +45 -30
  23. package/src/helpers/index.ts +5 -0
  24. package/src/index.ts +21 -94
  25. package/src/{global → lib}/A-Abstraction/A-Abstraction-Extend.decorator.ts +18 -13
  26. package/src/{global → lib}/A-Abstraction/A-Abstraction.class.ts +5 -5
  27. package/src/{global → lib}/A-Abstraction/A-Abstraction.error.ts +1 -1
  28. package/src/{global → lib}/A-Abstraction/A-Abstraction.types.ts +5 -5
  29. package/src/lib/A-Abstraction/index.ts +8 -0
  30. package/src/{global → lib}/A-Caller/A_Caller.class.ts +3 -4
  31. package/src/{global → lib}/A-Caller/A_Caller.error.ts +1 -4
  32. package/src/{global → lib}/A-Caller/A_Caller.types.ts +4 -4
  33. package/src/lib/A-Caller/index.ts +3 -0
  34. package/src/{global → lib}/A-Component/A-Component.class.ts +2 -3
  35. package/src/{global → lib}/A-Component/A-Component.meta.ts +5 -5
  36. package/src/{global → lib}/A-Component/A-Component.types.ts +5 -5
  37. package/src/lib/A-Component/index.ts +5 -0
  38. package/src/{global → lib}/A-Concept/A-Concept.class.ts +9 -7
  39. package/src/{global → lib}/A-Concept/A-Concept.meta.ts +2 -2
  40. package/src/{global → lib}/A-Concept/A-Concept.types.ts +7 -7
  41. package/src/lib/A-Concept/index.ts +4 -0
  42. package/src/{global → lib}/A-Container/A-Container.class.ts +3 -3
  43. package/src/{global → lib}/A-Container/A-Container.meta.ts +11 -6
  44. package/src/{global → lib}/A-Container/A-Container.types.ts +9 -6
  45. package/src/lib/A-Container/index.ts +5 -0
  46. package/src/{global → lib}/A-Context/A-Context.class.ts +53 -42
  47. package/src/{global → lib}/A-Context/A-Context.error.ts +1 -1
  48. package/src/lib/A-Context/A-Context.types.ts +14 -0
  49. package/src/lib/A-Context/index.ts +5 -0
  50. package/src/{global → lib}/A-Dependency/A-Dependency-All.decorator.ts +11 -11
  51. package/src/{global → lib}/A-Dependency/A-Dependency-Default.decorator.ts +11 -9
  52. package/src/{global → lib}/A-Dependency/A-Dependency-Flat.decorator.ts +11 -8
  53. package/src/{global → lib}/A-Dependency/A-Dependency-Load.decorator.ts +11 -9
  54. package/src/{global → lib}/A-Dependency/A-Dependency-Parent.decorator.ts +11 -9
  55. package/src/lib/A-Dependency/A-Dependency-Query.decorator.ts +90 -0
  56. package/src/{global → lib}/A-Dependency/A-Dependency-Require.decorator.ts +11 -9
  57. package/src/{global → lib}/A-Dependency/A-Dependency.class.ts +20 -3
  58. package/src/{global → lib}/A-Dependency/A-Dependency.error.ts +1 -1
  59. package/src/{global → lib}/A-Dependency/A-Dependency.types.ts +20 -9
  60. package/src/lib/A-Dependency/index.ts +18 -0
  61. package/src/{global → lib}/A-Entity/A-Entity.class.ts +11 -9
  62. package/src/{global → lib}/A-Entity/A-Entity.error.ts +1 -1
  63. package/src/{global → lib}/A-Entity/A-Entity.meta.ts +3 -3
  64. package/src/{global → lib}/A-Entity/A-Entity.types.ts +5 -5
  65. package/src/lib/A-Entity/index.ts +5 -0
  66. package/src/{global → lib}/A-Error/A_Error.class.ts +13 -13
  67. package/src/{global → lib}/A-Error/A_Error.types.ts +2 -2
  68. package/src/lib/A-Error/index.ts +3 -0
  69. package/src/{global → lib}/A-Feature/A-Feature-Define.decorator.ts +16 -10
  70. package/src/{global → lib}/A-Feature/A-Feature-Extend.decorator.ts +13 -9
  71. package/src/{global → lib}/A-Feature/A-Feature.class.ts +15 -13
  72. package/src/{global → lib}/A-Feature/A-Feature.error.ts +2 -2
  73. package/src/{global → lib}/A-Feature/A-Feature.types.ts +21 -12
  74. package/src/lib/A-Feature/index.ts +13 -0
  75. package/src/{global → lib}/A-Fragment/A-Fragment.class.ts +0 -2
  76. package/src/{global → lib}/A-Fragment/A-Fragment.types.ts +1 -1
  77. package/src/lib/A-Fragment/index.ts +5 -0
  78. package/src/{global → lib}/A-Inject/A-Inject.decorator.ts +42 -24
  79. package/src/{global → lib}/A-Inject/A-Inject.error.ts +1 -1
  80. package/src/{global → lib}/A-Inject/A-Inject.types.ts +3 -9
  81. package/src/lib/A-Inject/index.ts +3 -0
  82. package/src/{global → lib}/A-Meta/A-Meta.decorator.ts +2 -2
  83. package/src/{global → lib}/A-Meta/A-Meta.types.ts +18 -10
  84. package/src/lib/A-Meta/index.ts +11 -0
  85. package/src/{global → lib}/A-Scope/A-Scope.class.ts +37 -25
  86. package/src/{global → lib}/A-Scope/A-Scope.error.ts +1 -1
  87. package/src/{global → lib}/A-Scope/A-Scope.types.ts +23 -15
  88. package/src/lib/A-Scope/index.ts +5 -0
  89. package/src/{global → lib}/A-Stage/A-Stage.class.ts +9 -10
  90. package/src/{global → lib}/A-Stage/A-Stage.error.ts +1 -1
  91. package/src/{global → lib}/A-Stage/A-Stage.types.ts +1 -4
  92. package/src/lib/A-Stage/index.ts +5 -0
  93. package/src/{global → lib}/A-StepManager/A-StepManager.class.ts +8 -4
  94. package/src/{global → lib}/A-StepManager/A-StepManager.error.ts +1 -1
  95. package/src/lib/A-StepManager/index.ts +4 -0
  96. package/src/{global → lib}/ASEID/ASEID.class.ts +20 -23
  97. package/src/lib/ASEID/ASEID.error.ts +12 -0
  98. package/src/lib/ASEID/index.ts +4 -0
  99. package/src/types/A_identity.types.ts +4 -0
  100. package/src/types/index.ts +2 -0
  101. package/tests/A-Abstraction.test.ts +6 -6
  102. package/tests/A-Common.test.ts +6 -4
  103. package/tests/A-Component.test.ts +7 -5
  104. package/tests/A-Concept.test.ts +13 -11
  105. package/tests/A-Container.test.ts +4 -3
  106. package/tests/A-Dependency.test.ts +73 -1
  107. package/tests/A-Entity.test.ts +108 -5
  108. package/tests/A-Error.test.ts +7 -4
  109. package/tests/A-Feature.test.ts +12 -8
  110. package/tests/A-Fragment.test.ts +1 -2
  111. package/tests/A-Inject.test.ts +4 -1
  112. package/tests/A-Meta.test.ts +12 -10
  113. package/tests/A-Scope.test.ts +11 -10
  114. package/tests/A-StepManager.test.ts +3 -3
  115. package/tests/ASEID.test.ts +2 -2
  116. package/tests/jest.setup.ts +23 -23
  117. package/tsconfig.json +59 -97
  118. package/tsup.config.ts +18 -13
  119. package/dist/browser/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  120. package/dist/browser/env.d.mts +0 -64
  121. package/dist/browser/env.mjs +0 -3
  122. package/dist/browser/env.mjs.map +0 -1
  123. package/dist/node/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  124. package/dist/node/A-Context.types-BtR_HJ0j.d.ts +0 -3828
  125. package/dist/node/env.cjs +0 -12
  126. package/dist/node/env.cjs.map +0 -1
  127. package/dist/node/env.d.mts +0 -91
  128. package/dist/node/env.d.ts +0 -91
  129. package/dist/node/env.js +0 -12
  130. package/dist/node/env.js.map +0 -1
  131. package/dist/node/env.mjs +0 -3
  132. package/dist/node/env.mjs.map +0 -1
  133. package/dist/node/index.js +0 -387
  134. package/dist/node/index.js.map +0 -1
  135. package/src/global/A-Context/A-Context.types.ts +0 -14
  136. package/src/global/ASEID/ASEID.error.ts +0 -12
  137. /package/src/{global → lib}/A-Component/A-Component.constants.ts +0 -0
  138. /package/src/{global → lib}/A-Concept/A-Concept.constants.ts +0 -0
  139. /package/src/{global → lib}/A-Container/A-Container.constants.ts +0 -0
  140. /package/src/{global → lib}/A-Entity/A-Entity.constants.ts +0 -0
  141. /package/src/{global → lib}/A-Error/A_Error.constants.ts +0 -0
  142. /package/src/{global → lib}/A-Meta/A-Meta.class.ts +0 -0
  143. /package/src/{global → lib}/ASEID/ASEID.constants.ts +0 -0
  144. /package/src/{global → lib}/ASEID/ASEID.types.ts +0 -0
@@ -1,43 +1,4040 @@
1
- import { A as A_Scope, a as A_TYPES__ContextEnvironment, b as A_TYPES__ScopeLinkedComponents, c as A_TYPES_ScopeDependentComponents, d as A_TYPES__MetaLinkedComponentConstructors, e as A_Meta, f as A_TYPES__Scope_Init, g as A_TYPES__ScopeConfig, h as A_ContainerMeta, i as A_TYPES__Container_Constructor, j as A_Container, k as A_EntityMeta, l as A_TYPES__Entity_Constructor, m as A_Entity, n as A_ComponentMeta, o as A_TYPES__Component_Constructor, p as A_Component, q as A_TYPES__Fragment_Constructor, r as A_Fragment, s as A_TYPES__MetaLinkedComponents, t as A_TYPES__Ctor, u as A_Feature, v as A_TYPES__FeatureAvailableComponents, w as A_TYPES__A_StageStep, x as A_TYPES__ConceptAbstractions, y as A_Error, z as A_Caller, B as A_TYPES__A_DependencyResolutionStrategy, C as A_TYPES__A_InjectDecoratorReturn, D as A_TYPES__Error_Constructor, E as A_TYPES__Feature_Constructor, F as A_TYPES__Scope_Constructor, G as A_TYPES__A_DependencyInjectable, H as A_Dependency, I as A_TYPES__DeepPartial, J as A_TYPES__ScopeLinkedConstructors, K as A_TYPES__AbstractionAvailableComponents, L as A_TYPES__InjectableTargets, M as A_TYPES__FeatureExtendDecoratorTarget, N as A_TYPES__Error_Init, O as A_TYPES__Error_Serialized } from './A-Context.types-BtR_HJ0j.js';
2
- export { S as ASEID, Q as A_Abstraction, R as A_Abstraction_Extend, P as A_Concept, _ as A_Dependency_Default, Z as A_Dependency_Load, Y as A_Dependency_Require, T as A_FeatureError, U as A_Feature_Define, V as A_Feature_Extend, W as A_Stage, X as A_StageError, $ as A_StepsManager, a_ as A_TYPES_ScopeIndependentComponents, aW as A_TYPES_StageExecutionBehavior, aB as A_TYPES__ASEID_Constructor, aC as A_TYPES__ASEID_ConstructorConfig, aD as A_TYPES__ASEID_JSON, b2 as A_TYPES__A_DependencyConstructor, b3 as A_TYPES__A_DependencyResolutionType, bd as A_TYPES__A_Dependency_AllDecoratorReturn, ba as A_TYPES__A_Dependency_DefaultDecoratorReturn, b7 as A_TYPES__A_Dependency_EntityInjectionPagination, b6 as A_TYPES__A_Dependency_EntityInjectionQuery, b5 as A_TYPES__A_Dependency_EntityResolutionConfig, bc as A_TYPES__A_Dependency_FlatDecoratorReturn, b9 as A_TYPES__A_Dependency_LoadDecoratorReturn, bb as A_TYPES__A_Dependency_ParentDecoratorReturn, b8 as A_TYPES__A_Dependency_RequireDecoratorReturn, b4 as A_TYPES__A_Dependency_Serialized, be as A_TYPES__A_InjectDecoratorDescriptor, bf as A_TYPES__A_InjectDecorator_Meta, aY as A_TYPES__A_StageStepProcessingExtraParams, aV as A_TYPES__A_Stage_Status, aA as A_TYPES__AbstractionDecoratorConfig, az as A_TYPES__AbstractionDecoratorDescriptor, aw as A_TYPES__Abstraction_Constructor, ax as A_TYPES__Abstraction_Init, ay as A_TYPES__Abstraction_Serialized, an as A_TYPES__ComponentMeta, ao as A_TYPES__ComponentMetaExtension, ap as A_TYPES__ComponentMetaKey, al as A_TYPES__Component_Init, am as A_TYPES__Component_Serialized, ae as A_TYPES__ConceptAbstraction, ad as A_TYPES__ConceptAbstractionMeta, af as A_TYPES__ConceptMetaKey, aa as A_TYPES__Concept_Constructor, ab as A_TYPES__Concept_Init, ac as A_TYPES__Concept_Serialized, ai as A_TYPES__ContainerMeta, aj as A_TYPES__ContainerMetaExtension, ak as A_TYPES__ContainerMetaKey, ag as A_TYPES__Container_Init, ah as A_TYPES__Container_Serialized, a1 as A_TYPES__Dictionary, av as A_TYPES__EntityFeatures, at as A_TYPES__EntityMeta, au as A_TYPES__EntityMetaKey, ar as A_TYPES__Entity_Init, as as A_TYPES__Entity_Serialized, a7 as A_TYPES__ExtractNested, a8 as A_TYPES__ExtractProperties, aK as A_TYPES__FeatureAvailableConstructors, aM as A_TYPES__FeatureDefineDecoratorConfig, aL as A_TYPES__FeatureDefineDecoratorDescriptor, aP as A_TYPES__FeatureDefineDecoratorMeta, aO as A_TYPES__FeatureDefineDecoratorTarget, aN as A_TYPES__FeatureDefineDecoratorTemplateItem, aJ as A_TYPES__FeatureError_Init, aR as A_TYPES__FeatureExtendDecoratorConfig, aQ as A_TYPES__FeatureExtendDecoratorDescriptor, aU as A_TYPES__FeatureExtendDecoratorMeta, aS as A_TYPES__FeatureExtendDecoratorScopeConfig, aT as A_TYPES__FeatureExtendDecoratorScopeItem, a9 as A_TYPES__FeatureExtendableMeta, aI as A_TYPES__FeatureState, aE as A_TYPES__Feature_Init, aF as A_TYPES__Feature_InitWithComponent, aG as A_TYPES__Feature_InitWithTemplate, aH as A_TYPES__Feature_Serialized, b0 as A_TYPES__Fragment_Init, b1 as A_TYPES__Fragment_Serialized, aq as A_TYPES__IEntity, a$ as A_TYPES__Meta_Constructor, a2 as A_TYPES__NonObjectPaths, a0 as A_TYPES__ObjectKeyEnum, a3 as A_TYPES__Paths, a5 as A_TYPES__PathsToObject, a6 as A_TYPES__Required, aZ as A_TYPES__Scope_Serialized, aX as A_TYPES__Stage_Serialized, a4 as A_TYPES__UnionToIntersection } from './A-Context.types-BtR_HJ0j.js';
1
+ type Decrement = [never, 0, 1, 2, 3, 4, 5];
2
+ type A_TYPES__Ctor<T> = new (...args: any[]) => T;
3
+ type A_TYPES__DeepPartial<T, D extends number = 5> = {
4
+ [P in keyof Required<T>]?: [
5
+ D
6
+ ] extends [never] ? any : Required<T>[P] extends Array<infer U> ? Array<A_TYPES__DeepPartial<U, Decrement[D]>> : Required<T>[P] extends Function ? Required<T>[P] : Required<T>[P] extends object ? A_TYPES__DeepPartial<T[P], Decrement[D]> : T[P];
7
+ };
8
+ type A_TYPES__ObjectKeyEnum<T, E> = {
9
+ [P in keyof Required<T>]?: T[P] extends object ? A_TYPES__ObjectKeyEnum<T[P], E> : E;
10
+ };
11
+ type A_TYPES__Dictionary<T> = {
12
+ [Key: string]: T;
13
+ };
14
+ type A_TYPES__NonObjectPaths<T> = T extends object ? {
15
+ [K in keyof T]: `${Exclude<K, symbol>}${""}`;
16
+ }[keyof T] : never;
17
+ type A_TYPES__Paths<T, D extends number = 5> = [D] extends [never] ? never : (T extends object ? {
18
+ [K in keyof T]: `${Exclude<K, symbol>}${"" | `.${A_TYPES__Paths<T[K], Decrement[D]>}`}`;
19
+ }[keyof T] : never);
20
+ type A_TYPES__UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
21
+ type A_TYPES__PathsToObject<_Obj, T extends readonly string[]> = A_TYPES__UnionToIntersection<{
22
+ [K in keyof T]: T[K] extends `${infer Key}.${infer Rest}` ? {
23
+ [P in Key]: P extends keyof _Obj ? A_TYPES__PathsToObject<Required<_Obj>[P], [Rest]> : any;
24
+ } : {
25
+ [P in T[K]]: `${T[K]}` extends keyof Required<_Obj> ? Required<_Obj>[`${T[K]}`] : never;
26
+ };
27
+ }[number]>;
28
+ type A_TYPES__Required<T, arr extends (A_TYPES__Paths<T>)[] = (A_TYPES__Paths<T>)[]> = A_TYPES__PathsToObject<T, arr> & T;
29
+ type A_TYPES__ExtractNested<T, P extends string> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? {
30
+ [Key in K]: A_TYPES__ExtractNested<T[K], Rest>;
31
+ } : never : P extends keyof T ? {
32
+ [Key in P]: T[P];
33
+ } : never;
34
+ type A_TYPES__ExtractProperties<T, P extends A_TYPES__Paths<T>[]> = A_TYPES__UnionToIntersection<{
35
+ [K in keyof P]: P[K] extends string ? A_TYPES__ExtractNested<T, P[K]> : never;
36
+ }[number]>;
37
+
38
+ type A_ID_TYPES__TimeId_Parts = {
39
+ timestamp: Date;
40
+ random: string;
41
+ };
42
+
43
+ /**
44
+ * Entity constructor type
45
+ * Uses the generic type T to specify the type of the entity
46
+ */
47
+ type A_TYPES__Error_Constructor<T = A_Error> = A_TYPES__Ctor<T>;
48
+ /**
49
+ * Error initialization type
50
+ */
51
+ type A_TYPES__Error_Init = {
52
+ /**
53
+ * Error title
54
+ *
55
+ * A short description of the error
56
+ */
57
+ title: string;
58
+ /**
59
+ * Error code representing the type of error
60
+ *
61
+ * Should be unique within the application or service
62
+ *
63
+ * Example: 'validation-error', 'not-found', 'user-not-found', 'unauthorized' etc.
64
+ *
65
+ * [!] Note: It is recommended to use kebab-case for error codes
66
+ * [!] Note: If not provided would be used a kebab-case message of the error
67
+ */
68
+ code?: string;
69
+ /**
70
+ * Possible Scope if needed to identify the error by it's execution environment
71
+ *
72
+ * For example, error of type 'validation' could happen in different scopes
73
+ * like 'user', 'admin', 'system' etc. This will help to identify the error context better
74
+ *
75
+ * Could be string or A_Scope instance
76
+ *
77
+ * [!] Note: If not provided, the default scope of the A_Error will be used (A_Context.root.name)
78
+ */
79
+ scope?: string | A_Scope;
80
+ /**
81
+ * Detailed description of the error
82
+ */
83
+ description?: string;
84
+ /**
85
+ * Link to the documentation or support page for the error
86
+ */
87
+ link?: string;
88
+ /**
89
+ * Original Error if any
90
+ */
91
+ originalError?: Error | unknown;
92
+ };
93
+ /**
94
+ * Error serialized type
95
+ */
96
+ type A_TYPES__Error_Serialized = {
97
+ /**
98
+ * ASEID of the error
99
+ */
100
+ aseid: string;
101
+ /**
102
+ * A brief title of the error
103
+ */
104
+ title: string;
105
+ /**
106
+ * Error message
107
+ */
108
+ message: string;
109
+ /**
110
+ * Type of the error
111
+ */
112
+ type: string;
113
+ /**
114
+ * Error code
115
+ */
116
+ code: string;
117
+ /**
118
+ * Error description
119
+ */
120
+ description: string;
121
+ /**
122
+ * Link to documentation or support page
123
+ */
124
+ link?: string;
125
+ /**
126
+ * Scope of the error
127
+ */
128
+ scope: string;
129
+ /**
130
+ * Original error message if any
131
+ */
132
+ originalError?: string;
133
+ };
134
+
135
+ interface A_TYPES__ASEID_Constructor {
136
+ /**
137
+ * Concept for the ASEID
138
+ * Generally it is the application name or code, should correspond to the concept where the entity is used
139
+ * Could be ID or ASEID
140
+ */
141
+ concept?: string;
142
+ /**
143
+ * Entity Scope the primary location of the resource
144
+ * Organization, or organization Unit or Internal/External
145
+ * Could be ID or ASEID
146
+ *
147
+ */
148
+ scope: number | string;
149
+ /**
150
+ * Entity Type the type of the resource
151
+ */
152
+ entity: string;
153
+ /**
154
+ * Entity ID the unique identifier of the resource
155
+ */
156
+ id: number | string;
157
+ /**
158
+ * Version of the entity (optional)
159
+ */
160
+ version?: string;
161
+ /**
162
+ * Shard of the entity (optional)
163
+ */
164
+ shard?: string;
165
+ }
166
+ interface A_TYPES__ASEID_ConstructorConfig {
167
+ /**
168
+ * If true, the entity ASEID will be distributed across multiple shards.
169
+ * In this case SHARD should be provided via Environment Variables (A_SHARD) or Configurations
170
+ *
171
+ */
172
+ sharding?: boolean;
173
+ }
174
+ type A_TYPES__ASEID_JSON = {
175
+ /**
176
+ * Concept for the ASEID
177
+ */
178
+ concept: string;
179
+ /**
180
+ * Entity Scope the primary location of the resource
181
+ */
182
+ scope: string;
183
+ /**
184
+ * Entity Type the type of the resource
185
+ */
186
+ entity: string;
187
+ /**
188
+ * Entity ID the unique identifier of the resource
189
+ */
190
+ id: string;
191
+ /**
192
+ * Version of the entity (optional)
193
+ */
194
+ version?: string;
195
+ /**
196
+ * Shard of the entity (optional)
197
+ */
198
+ shard?: string;
199
+ };
200
+
201
+ declare class ASEID {
202
+ /**
203
+ * ASEID Regular Expression
204
+ */
205
+ static readonly regexp: RegExp;
206
+ /**
207
+ * Tests if the identity string is an ASEID
208
+ *
209
+ * @param identity
210
+ * @returns
211
+ */
212
+ static isASEID(identity: string): boolean;
213
+ static compare(aseid1: ASEID | string | undefined, aseid2: ASEID | string | undefined): boolean;
214
+ /**
215
+ * Concept for the ASEID
216
+ * Generally it is the application name or code, should correspond to the concept where the entity is used
217
+ * Could be ID or ASEID
218
+ */
219
+ private _concept;
220
+ /**
221
+ * Entity Scope the primary location of the resource
222
+ * Organization, or organization Unit
223
+ * Could be ID or ASEID
224
+ *
225
+ */
226
+ private _scope;
227
+ /**
228
+ * Entity Type the type of the resource
229
+ */
230
+ private _entity;
231
+ /**
232
+ * Entity ID the unique identifier of the resource
233
+ */
234
+ private _id;
235
+ /**
236
+ * Version of the entity (optional)
237
+ */
238
+ private _version?;
239
+ /**
240
+ * Shard of the entity (optional)
241
+ */
242
+ private _shard?;
243
+ /**
244
+ * ASEID is a structured identifier for entities in the A-Concept system.
245
+ * using the format:
246
+ * A - A-Concept
247
+ * S - System
248
+ * E - Entity
249
+ * I - Identifier
250
+ * D - iDentifier
251
+ *
252
+ * Structure: CONCEPT_NAME + @ + SCOPE + : ENTITY_NAME + : + ID + @ + VERSION
253
+ *
254
+ * Example:
255
+ * - root@core:usr:0000000001
256
+ *
257
+ * [!] Concept is optional, if not provided will be used the current concept name
258
+ * [!] Scope is optional, if not provided will be used the root scope of the current concept
259
+ * [!] Version is optional, if not provided will be considered as latest version
260
+ *
261
+ * @param aseid - ASEID string representation or ASEID components as object
262
+ */
263
+ constructor(
264
+ /**
265
+ * ASEID string representation
266
+ */
267
+ aseid: string);
268
+ constructor(
269
+ /**
270
+ * ASEID components as object
271
+ */
272
+ props: A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>);
273
+ /**
274
+ * Getters for ASEID components
275
+ */
276
+ get concept(): string;
277
+ /**
278
+ * Get the scope of the ASEID
279
+ */
280
+ get scope(): string;
281
+ /**
282
+ * Get the entity of the ASEID
283
+ */
284
+ get entity(): string;
285
+ /**
286
+ * Get the id of the ASEID
287
+ */
288
+ get id(): string;
289
+ /**
290
+ * Get the version of the ASEID (if any)
291
+ */
292
+ get version(): string | undefined;
293
+ /**
294
+ * Get the shard of the ASEID (if any)
295
+ */
296
+ get shard(): string | undefined;
297
+ /**
298
+ * Get the hash of the ASEID, Unique identifier based on the ASEID string
299
+ * Useful when aseid details should not be exposed directly
300
+ */
301
+ get hash(): string;
302
+ /**
303
+ * get Internal Initializer based on the type of the parameter provided
304
+ *
305
+ * @param param1
306
+ * @returns
307
+ */
308
+ private getInitializer;
309
+ /**
310
+ * Initialize ASEID from string
311
+ *
312
+ * @param param1
313
+ */
314
+ private fromString;
315
+ /**
316
+ * Initialize ASEID from object
317
+ *
318
+ * @param param1
319
+ */
320
+ private fromObject;
321
+ /**
322
+ * String representation of the ASEID
323
+ *
324
+ * @returns
325
+ */
326
+ toString(): string;
327
+ /**
328
+ * JSON representation of the ASEID
329
+ *
330
+ * @returns
331
+ */
332
+ toJSON(): A_TYPES__ASEID_JSON;
333
+ protected verifyInput(param1: string | A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>): void;
334
+ }
335
+
336
+ declare class A_Error<_ConstructorType extends A_TYPES__Error_Init = A_TYPES__Error_Init, _SerializedType extends A_TYPES__Error_Serialized = A_TYPES__Error_Serialized> extends Error {
337
+ /**
338
+ * Error Identifier that corresponds to the class name
339
+ */
340
+ static get entity(): string;
341
+ /**
342
+ * DEFAULT Namespace of the error from environment variable A_CONCEPT_NAMESPACE
343
+ *
344
+ * [!] If environment variable is not set, it will default to 'a-concept'
345
+ */
346
+ static get concept(): string;
347
+ /**
348
+ * DEFAULT Scope of the entity from environment variable A_CONCEPT_DEFAULT_SCOPE
349
+ *
350
+ * [!] If environment variable is not set, it will default to 'core'
351
+ * [!] Scope is an application specific identifier that can be used to group entities together
352
+ * [!] e.g. 'default', 'core', 'public', 'internal', etc
353
+ */
354
+ static get scope(): string;
355
+ /**
356
+ * ASEID of the error instance
357
+ */
358
+ protected _aseid: ASEID;
359
+ /**
360
+ * Title of the error
361
+ */
362
+ protected _title: string;
363
+ /**
364
+ * Possible Scope if needed to identify the error by it's execution environment
365
+ */
366
+ protected _scope?: string;
367
+ /**
368
+ * Unique code representing the type of error
369
+ */
370
+ protected _code?: string;
371
+ /**
372
+ * Detailed description of the error
373
+ */
374
+ protected _description?: string;
375
+ /**
376
+ * Original Error if any
377
+ */
378
+ protected _originalError?: Error | any;
379
+ /**
380
+ * Link to the documentation or support page for the error
381
+ */
382
+ protected _link?: string;
383
+ /**
384
+ * A_Error is a custom error class for A_Concept framework.
385
+ * This error allows to have more structured error handling.
386
+ * Each error has a unique code, description and a link to the documentation.
387
+ *
388
+ * Example of usage:
389
+ * ```typescript
390
+ *
391
+ * // 1) all parameters will be used as provided
392
+ * throw new A_Error({
393
+ * message: 'User not found',
394
+ * code: 'USER_NOT_FOUND',
395
+ * description: 'The user with the given ID was not found.',
396
+ * link: 'https://support.adaas.org/error/USER_NOT_FOUND'
397
+ * });
398
+ *
399
+ * // or
400
+ * // 2) only message is provided, other parameters will be set to default values:
401
+ * // - code: 'user-not-found' (kebab-case of the message)
402
+ * // - description: 'User not found' (same as message)
403
+ * // - link: Empty
404
+ * throw new A_Error('User not found');
405
+ *
406
+ * // or
407
+ * // 3) Provided Message and Description, other parameters will be set to default values:
408
+ * // - code: 'user-not-found' (kebab-case of the message)
409
+ * // - description: 'The user with the given ID was not found.' (as provided)
410
+ * // - link: Empty
411
+ * throw new A_Error('User not found', 'The user with the given ID was not found.');
412
+ *
413
+ *
414
+ * ```
415
+ * [!] Note: The behavior of A_Error is similar to the A_Entity however it cannot have own A_Features.
416
+ * [!] Note: This class can be inherited to create custom error classes.
417
+ *
418
+ * @param message
419
+ */
420
+ constructor(
421
+ /**
422
+ * A_Error Constructor params
423
+ */
424
+ params: _ConstructorType);
425
+ constructor(
426
+ /**
427
+ * Error message
428
+ */
429
+ message: string);
430
+ constructor(
431
+ /**
432
+ * Original JS Error
433
+ */
434
+ error: Error);
435
+ constructor(
436
+ /**
437
+ * Original JS Error
438
+ */
439
+ error: unknown);
440
+ constructor(
441
+ /**
442
+ * Error message
443
+ */
444
+ title: string,
445
+ /**
446
+ * Detailed description of the error
447
+ */
448
+ description: string);
449
+ /**
450
+ * Returns the ASEID of the error instance
451
+ */
452
+ get aseid(): ASEID;
453
+ /**
454
+ * Returns the title of the error
455
+ *
456
+ * Example: 'User not found', 'Validation error', 'Unauthorized access', etc.
457
+ *
458
+ * [!] Note: This title should be short and concise, less than 60 characters
459
+ * [!] Note: If title exceeds 60 characters, there would be an error thrown
460
+ * [!] Note: This title is intended to be human-readable and can be displayed in UI or logs
461
+ */
462
+ get title(): string;
463
+ /**
464
+ * Returns an Error message what is a brief title of the error
465
+ *
466
+ */
467
+ get message(): string;
468
+ /**
469
+ * Returns a unique code representing the type of error
470
+ *
471
+ * If code is not provided, it will generate a kebab-case of the message
472
+ *
473
+ * Example: 'validation-error', 'not-found', 'user-not-found', 'unauthorized' etc.
474
+ *
475
+ * [!] Note: It is recommended to use kebab-case for error codes
476
+ * [!] Note: If not provided would be used a kebab-case message of the error
477
+ */
478
+ get code(): string;
479
+ /**
480
+ * Returns the type of the error which corresponds to the static entity of the class
481
+ *
482
+ * Example: 'a-error', 'validation-error', 'not-found-error', 'user-error', etc.
483
+ *
484
+ * Defaults to the kebab-case of the class name
485
+ *
486
+ * [!] Note: naming ad separation are fully dependent on the architecture of the application
487
+ * [!] Note: It is recommended to use kebab-case for error types
488
+ * [!] Note: This type is intended to group similar errors together
489
+ */
490
+ get type(): string;
491
+ /**
492
+ * Returns a link with possible documentation or support page for the error
493
+ * If link is not provided, it will generate a link based on the ASEID of the error that points to the A-Concept support page
494
+ *
495
+ * Example: https://adaas.support/a-concept/errors/{ASEID}
496
+ *
497
+ * [!] Note: ASEID is generated based on the static properties of the class (concept, scope, entity) and the code of the error
498
+ */
499
+ get link(): string;
500
+ /**
501
+ * The scope name of the error instance
502
+ *
503
+ * If scope is not provided, it will use the static scope of the class
504
+ *
505
+ * [!] Note: Scope is an application specific identifier that can be used to group entities together
506
+ * [!] e.g. 'default', 'core', 'public', 'internal', etc
507
+ */
508
+ get scope(): string;
509
+ /**
510
+ * A detailed description of the error
511
+ * If description is not provided, it will use the environment variable A_ERROR_DEFAULT_DESCRIPTION or a generic message
512
+ *
513
+ * Example: 'The user with the given ID was not found.', 'The provided data is invalid.', 'You do not have permission to access this resource.', etc.
514
+ *
515
+ * [!] Note: This description is intended to provide more context about the error and can be used for debugging or logging purposes
516
+ */
517
+ get description(): string;
518
+ /**
519
+ * Returns the original error if any
520
+ *
521
+ * This can be useful for debugging purposes to see the original stack trace or error message
522
+ *
523
+ * [!] Note: Original error is optional and may not be present in all cases
524
+ */
525
+ get originalError(): Error | any | undefined;
526
+ /**
527
+ * Determines which initializer method to use based on the type of the first parameter.
528
+ *
529
+ * @param param1
530
+ * @returns
531
+ */
532
+ protected getInitializer(param1: _ConstructorType | Error | string | any, param2?: string): (param1: any, param2: any) => void | (() => void);
533
+ /**
534
+ * Initializes the A_Error instance from a standard Error object.
535
+ *
536
+ * @param error
537
+ */
538
+ protected fromError(error: Error): void;
539
+ /**
540
+ * Initializes the A_Error instance from a message.
541
+ *
542
+ * @param title
543
+ * @param description
544
+ */
545
+ protected fromMessage(message: string): void;
546
+ /**
547
+ * Initializes the A_Error instance from a serialized object.
548
+ *
549
+ * @param serialized
550
+ */
551
+ protected fromJSON(serialized: _SerializedType): void;
552
+ fromTitle(title: string, description: string): void;
553
+ /**
554
+ * Initializes the A_Error instance from a constructor parameters object.
555
+ *
556
+ * @param params
557
+ */
558
+ protected fromConstructor(params: _ConstructorType): void;
559
+ /**
560
+ * Serializes the A_Error instance to a plain object.
561
+ *
562
+ *
563
+ * @returns
564
+ */
565
+ toJSON(): _SerializedType;
566
+ /**
567
+ * Checks if the provided title exceeds 60 characters.
568
+ * If it does, throws a validation A_Error.
569
+ *
570
+ * @param title
571
+ */
572
+ protected validateTitle(title: string): void;
573
+ }
574
+
575
+ declare const A_CONSTANTS__ERROR_CODES: {
576
+ readonly UNEXPECTED_ERROR: "A-Error Unexpected Error";
577
+ readonly VALIDATION_ERROR: "A-Error Validation Error";
578
+ };
579
+ declare const A_CONSTANTS__ERROR_DESCRIPTION = "If you see this error please let us know.";
580
+
581
+ /**
582
+ * Fragment constructor type
583
+ * Uses the generic type T to specify the type of the fragment
584
+ */
585
+ type A_TYPES__Fragment_Constructor<T = A_Fragment> = A_TYPES__Ctor<T>;
586
+ /**
587
+ * Fragment initialization type
588
+ */
589
+ type A_TYPES__Fragment_Init = {
590
+ name: string;
591
+ };
592
+ /**
593
+ * Fragment serialized type
594
+ */
595
+ type A_TYPES__Fragment_Serialized = {
596
+ /**
597
+ * The Name of the fragment
598
+ */
599
+ name: string;
600
+ };
601
+
602
+ /**
603
+ * A_Fragment is a core architectural component that represents a singleton execution context
604
+ * within the A-Concept framework. It serves as a shared memory container that can be passed
605
+ * between Components, Entities, and Commands throughout the application pipeline.
606
+ *
607
+ * Key Features:
608
+ * - Singleton pattern: Only one instance per fragment type per scope
609
+ * - Meta storage: Built-in key-value storage for pipeline data
610
+ * - Type-safe: Full TypeScript generics support for meta items and serialization
611
+ * - Serializable: Can be converted to JSON for persistence or transmission
612
+ *
613
+ * @template _MetaItems - Type definition for the meta storage structure
614
+ * @template _SerializedType - Type definition for the serialized output format
615
+ *
616
+ * @example
617
+ * ```typescript
618
+ * // Basic usage with typed meta
619
+ * class UserFragment extends A_Fragment<{ userId: string; role: string }> {
620
+ * constructor() {
621
+ * super({ name: 'UserFragment' });
622
+ * }
623
+ * }
624
+ *
625
+ * // Custom serialization
626
+ * class SessionFragment extends A_Fragment<
627
+ * { sessionId: string; timestamp: number },
628
+ * { name: string; sessionData: string }
629
+ * > {
630
+ * toJSON() {
631
+ * return {
632
+ * name: this.name,
633
+ * sessionData: `${this.get('sessionId')}-${this.get('timestamp')}`
634
+ * };
635
+ * }
636
+ * }
637
+ * ```
638
+ */
639
+ declare class A_Fragment<_SerializedType extends A_TYPES__Fragment_Serialized = A_TYPES__Fragment_Serialized> {
640
+ /**
641
+ * The unique identifier/name for this fragment instance.
642
+ * Used for identification and debugging purposes.
643
+ */
644
+ protected _name: string;
645
+ /**
646
+ * Creates a new A_Fragment instance.
647
+ *
648
+ * A_Fragment implements the singleton pattern for execution contexts, allowing
649
+ * shared state management across different parts of the application pipeline.
650
+ * Each fragment serves as a memory container that can store typed data and be
651
+ * serialized for persistence or transmission.
652
+ *
653
+ * Key Benefits:
654
+ * - Centralized state management for related operations
655
+ * - Type-safe meta operations with full IntelliSense support
656
+ * - Serialization support for data persistence
657
+ * - Singleton pattern ensures consistent state within scope
658
+ *
659
+ * @param params - Initialization parameters
660
+ * @param params.name - Optional custom name for the fragment (defaults to class name)
661
+ *
662
+ * @example
663
+ * ```typescript
664
+ * const fragment = new A_Fragment<{ userId: string }>({
665
+ * name: 'UserSessionFragment'
666
+ * });
667
+ * fragment.set('userId', '12345');
668
+ * ```
669
+ */
670
+ constructor(params?: Partial<A_TYPES__Fragment_Init>);
671
+ /**
672
+ * Gets the fragment's unique name/identifier.
673
+ *
674
+ * @returns The fragment name
675
+ */
676
+ get name(): string;
677
+ /**
678
+ * Serializes the fragment to a JSON-compatible object.
679
+ *
680
+ * This method combines the fragment's name with all meta data to create
681
+ * a serializable representation. The return type is determined by the
682
+ * _SerializedType generic parameter, allowing for custom serialization formats.
683
+ *
684
+ * @returns A serialized representation of the fragment
685
+ *
686
+ * @example
687
+ * ```typescript
688
+ * const fragment = new A_Fragment<{ userId: string, role: string }>({
689
+ * name: 'UserFragment'
690
+ * });
691
+ * fragment.set('userId', '12345');
692
+ * fragment.set('role', 'admin');
693
+ *
694
+ * const json = fragment.toJSON();
695
+ * // Result: { name: 'UserFragment', userId: '12345', role: 'admin' }
696
+ * ```
697
+ */
698
+ toJSON(): _SerializedType;
699
+ }
700
+
701
+ /**
702
+ * Meta constructor type
703
+ */
704
+ type A_TYPES__Meta_Constructor<T = A_Meta> = A_TYPES__Ctor<T>;
705
+ /**
706
+ * Components that can have Meta associated with them
707
+ */
708
+ type A_TYPES__MetaLinkedComponents = A_Container | A_Component | A_Entity | A_Fragment;
709
+ /**
710
+ * Constructors of components that can have Meta associated with them
711
+ */
712
+ type A_TYPES__MetaLinkedComponentConstructors = A_TYPES__Ctor<any> | A_TYPES__Container_Constructor | A_TYPES__Component_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Fragment_Constructor;
713
+
714
+ /**
715
+ * A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc.
716
+ *
717
+ * [!] Meta can be different depending on the type of input data
718
+ */
719
+ declare class A_Meta<_StorageItems extends Record<any, any> = any, _SerializedType extends Record<string, any> = Record<string, any>> implements Iterable<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {
720
+ /**
721
+ * Allows to set a custom meta class for the Component or Container or Entity, or anything else.
722
+ *
723
+ * @param target
724
+ * @returns
725
+ */
726
+ static Define<T extends A_Meta>(target: A_TYPES__Meta_Constructor<T>): <TTarget extends A_TYPES__MetaLinkedComponentConstructors>(target: TTarget) => TTarget;
727
+ protected meta: Map<keyof _StorageItems, _StorageItems[keyof _StorageItems]>;
728
+ /**
729
+ * Method to get the iterator for the meta object
730
+ *
731
+ * @returns
732
+ */
733
+ [Symbol.iterator](): Iterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
734
+ /**
735
+ * Allows to replicate received meta object by replacing internal meta to the received one
736
+ *
737
+ * @param meta
738
+ * @returns
739
+ */
740
+ from(meta: A_Meta<_StorageItems>): A_Meta<_StorageItems>;
741
+ /**
742
+ * Method to set values in the map
743
+ *
744
+ * @param key
745
+ * @param value
746
+ */
747
+ set<K extends keyof _StorageItems>(key: K, value: _StorageItems[K]): void;
748
+ /**
749
+ * Method to get values from the map
750
+ *
751
+ * @param key
752
+ * @returns
753
+ */
754
+ get<K extends keyof _StorageItems>(key: K): _StorageItems[K] | undefined;
755
+ /**
756
+ * Method to delete values from the map
757
+ *
758
+ * @param key
759
+ * @returns
760
+ */
761
+ delete(key: keyof _StorageItems): boolean;
762
+ /**
763
+ * Method to get the size of the map
764
+ *
765
+ * @returns
766
+ */
767
+ size(): number;
768
+ /**
769
+ * This method is needed to convert the key to a regular expression and cover cases like:
770
+ *
771
+ * simple * e.g. "a*" instead of "a.*"
772
+ *
773
+ * simple ? e.g. "a?" instead of "a."
774
+ *
775
+ * etc.
776
+ *
777
+ * @param key
778
+ * @returns
779
+ */
780
+ private convertToRegExp;
781
+ /**
782
+ * Method to find values in the map by name.
783
+ *
784
+ * Converts the Key in Map to a regular expression and then compares to the name
785
+ *
786
+ * @param name
787
+ * @returns
788
+ */
789
+ find(name: string): [keyof _StorageItems, _StorageItems[keyof _StorageItems]][];
790
+ /**
791
+ * Method to find values in the map by regular expression
792
+ *
793
+ * Compares Map Key to the input regular expression
794
+ *
795
+ * @param regex
796
+ * @returns
797
+ */
798
+ findByRegex(regex: RegExp): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
799
+ /**
800
+ * Method to check if the map has a specific key
801
+ *
802
+ * @param key
803
+ * @returns
804
+ */
805
+ has(key: keyof _StorageItems): boolean;
806
+ /**
807
+ * Method to get the size of the map
808
+ *
809
+ * @returns
810
+ */
811
+ entries(): IterableIterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
812
+ /**
813
+ * Method to clear the map
814
+ */
815
+ clear(): void;
816
+ toArray(): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
817
+ protected recursiveToJSON(value: any): any;
818
+ /**
819
+ * Serializes the meta to a JSON object
820
+ * Uses internal storage to convert to JSON
821
+ *
822
+ * @returns
823
+ */
824
+ toJSON(): _SerializedType;
825
+ }
826
+
827
+ /**
828
+ *
829
+ * This decorator should allow to set a default meta type for the class, this helps to avoid
830
+ * the need to create custom meta classes for each class.
831
+ *
832
+ * @returns
833
+ */
834
+ declare function A_MetaDecorator<T extends A_Meta>(constructor: A_TYPES__Ctor<T>): <TTarget extends A_TYPES__MetaLinkedComponentConstructors>(target: TTarget) => TTarget;
835
+
836
+ declare enum A_TYPES__EntityMetaKey {
837
+ EXTENSIONS = "a-component-extensions",
838
+ FEATURES = "a-component-features",
839
+ ABSTRACTIONS = "a-component-abstractions",
840
+ INJECTIONS = "a-component-injections"
841
+ }
842
+ declare enum A_TYPES__EntityFeatures {
843
+ SAVE = "save",
844
+ DESTROY = "destroy",
845
+ LOAD = "load"
846
+ }
847
+
848
+ /**
849
+ * Entity interface
850
+ */
851
+ interface A_TYPES__IEntity {
852
+ /**
853
+ * The ASEID of the entity
854
+ */
855
+ aseid: ASEID;
856
+ }
857
+ /**
858
+ * Entity constructor type
859
+ * Uses the generic type T to specify the type of the entity
860
+ */
861
+ type A_TYPES__Entity_Constructor<T = A_Entity> = A_TYPES__Ctor<T>;
862
+ /**
863
+ * Entity initialization type
864
+ */
865
+ type A_TYPES__Entity_Init = any;
866
+ /**
867
+ * Entity serialized type
868
+ */
869
+ type A_TYPES__Entity_Serialized = {
870
+ /**
871
+ * The ASEID of the entity
872
+ */
873
+ aseid: string;
874
+ };
875
+ /**
876
+ * Entity meta type
877
+ */
878
+ type A_TYPES__EntityMeta = {
879
+ [A_TYPES__EntityMetaKey.EXTENSIONS]: A_Meta<{
880
+ /**
881
+ * Where Key the regexp for what to apply the extension
882
+ * A set of container names or a wildcard, or a regexp
883
+ *
884
+ *
885
+ * Where value is the extension instructions
886
+ */
887
+ [Key: string]: A_TYPES__FeatureExtendDecoratorMeta[];
888
+ }>;
889
+ case: any;
890
+ [A_TYPES__EntityMetaKey.FEATURES]: A_Meta<{
891
+ /**
892
+ * Where Key is the name of the feature
893
+ *
894
+ * Where value is the list of features
895
+ */
896
+ [Key: string]: A_TYPES__FeatureDefineDecoratorMeta;
897
+ }>;
898
+ /**
899
+ * Injections defined on the component per handler
900
+ */
901
+ [A_TYPES__EntityMetaKey.INJECTIONS]: A_Meta<{
902
+ /**
903
+ * Where Key is the name of the injection
904
+ *
905
+ * Where value is the list of injections
906
+ */
907
+ [Key: string]: A_TYPES__A_InjectDecorator_Meta;
908
+ }>;
909
+ };
910
+
911
+ /**
912
+ * A_Entity is another abstraction that describes all major participants in the system business logic.
913
+ * Each Entity should have a clear definition and a clear set of responsibilities.
914
+ * However, entity may hide some of its responsibilities behind the interface to prevent overload.
915
+ *
916
+ * Each entity should be connected to the ContextFragment (Scope) and should be able to communicate with other entities.
917
+ */
918
+ declare class A_Entity<_ConstructorType extends A_TYPES__Entity_Init = A_TYPES__Entity_Init, _SerializedType extends A_TYPES__Entity_Serialized = A_TYPES__Entity_Serialized> implements A_TYPES__IEntity {
919
+ /**
920
+ * Entity Identifier that corresponds to the class name
921
+ */
922
+ static get entity(): string;
923
+ /**
924
+ * DEFAULT Concept Name (Application Name) of the entity from environment variable A_CONCEPT_NAME
925
+ * [!] If environment variable is not set, it will default to 'a-concept'
926
+ */
927
+ static get concept(): string;
928
+ /**
929
+ * DEFAULT Scope of the entity from environment variable A_CONCEPT_DEFAULT_SCOPE
930
+ * [!] If environment variable is not set, it will default to 'core'
931
+ * [!] Scope is an application specific identifier that can be used to group entities together
932
+ * [!] e.g. 'default', 'core', 'public', 'internal', etc
933
+ */
934
+ static get scope(): string;
935
+ /**
936
+ * ASEID is an entity identifier that is unique across the system
937
+ * A - A_Concept or Application
938
+ * S - System or Scope
939
+ * E - Entity
940
+ * ID - Identifier
941
+ *
942
+ * [!] ASEID is immutable and should not be changed after the entity is created
943
+ *
944
+ * [!] ASEID is composed of the following parts:
945
+ * - concept: an application specific identifier from where the entity is coming from
946
+ * - scope: the scope of the entity from concept
947
+ * - entity: the name of the entity from concept
948
+ * - id: the unique identifier of the entity
949
+ *
950
+ * [!] For more information about ASEID, please refer to the ASEID class documentation]
951
+ */
952
+ aseid: ASEID;
953
+ /**
954
+ * Create a new A_entity instance from Aseid String
955
+ * e.g. project@scope:entity:0000000001
956
+ *
957
+ * @param aseid
958
+ */
959
+ constructor(
960
+ /**
961
+ * ASEID string that represents the entity
962
+ */
963
+ aseid?: string);
964
+ /**
965
+ * Create a new A_entity instance from Aseid instance
966
+ * e.g. new ASEID({concept: 'project', scope: 'default', entity: 'entity', id: '0000000001'})
967
+ *
968
+ * @param aseid
969
+ */
970
+ constructor(
971
+ /**
972
+ * ASEID instance that represents the entity
973
+ */
974
+ aseid: ASEID);
975
+ /**
976
+ * Create a new A_entity instance from serialized object
977
+ *
978
+ * @param serialized
979
+ */
980
+ constructor(
981
+ /**
982
+ * Serialized object that represents the entity
983
+ */
984
+ serialized: _SerializedType);
985
+ /**
986
+ * Create a new A_entity instance from constructor object
987
+ *
988
+ * @param newEntity
989
+ */
990
+ constructor(
991
+ /**
992
+ * Constructor object that represents the entity
993
+ */
994
+ newEntity?: _ConstructorType);
995
+ /**
996
+ * Extracts the ID from the ASEID
997
+ * ID is the unique identifier of the entity
998
+ */
999
+ get id(): string | number;
1000
+ protected isStringASEID(x: unknown): x is string;
1001
+ protected isASEIDInstance(x: unknown): x is ASEID;
1002
+ /**
1003
+ * A "serialized" object is considered such if it is a non-null object
1004
+ * and contains an "aseid" property (this mirrors your original check).
1005
+ *
1006
+ * @param x
1007
+ * @returns
1008
+ */
1009
+ protected isSerializedObject(x: unknown): x is _SerializedType;
1010
+ /**
1011
+ * Constructor-style props = a plain object which does NOT contain "aseid".
1012
+ * This is the "create from provided fields" case.
1013
+ *
1014
+ * @param x
1015
+ * @returns
1016
+ */
1017
+ protected isConstructorProps(x: unknown): x is _ConstructorType;
1018
+ /**
1019
+ * Determines the appropriate initializer method based on the type of `props`.
1020
+ * The method checks if `props` is:
1021
+ * 1) a string that matches ASEID format -> fromASEID
1022
+ * 2) an ASEID instance -> fromASEID
1023
+ * 3) a serialized object (has 'aseid') -> fromJSON
1024
+ * 4) a plain object with no 'aseid' -> treat as constructor props -> fromNew
1025
+ *
1026
+ * [!] If `props` is undefined, it will call fromUndefined method
1027
+ *
1028
+ * If none of the above, it throws an error indicating incorrect constructor usage.
1029
+ *
1030
+ *
1031
+ * To get a custom initializer, override this method in the child class.
1032
+ * Example:
1033
+ * ```typescript
1034
+ * protected getInitializer(
1035
+ * props?: string | ASEID | _SerializedType | _ConstructorType
1036
+ * ): (props: any) => void | (() => void) {
1037
+ * if('customField' in props) {
1038
+ * return this.fromCustomField.bind(this);
1039
+ * }
1040
+ * return super.getInitializer(props);
1041
+ * }
1042
+ * ```
1043
+ * @param props
1044
+ * @returns The appropriate initializer method
1045
+ */
1046
+ protected getInitializer(props?: string | ASEID | _SerializedType | _ConstructorType): (props: any) => void | (() => void);
1047
+ /**
1048
+ * Generates a new ASEID for the entity.
1049
+ * It uses class definitions for concept, scope, and entity,
1050
+ * and allows overriding any of these values.
1051
+ *
1052
+ * @param override
1053
+ * @returns
1054
+ */
1055
+ protected generateASEID(override?: Partial<A_TYPES__ASEID_Constructor>): ASEID;
1056
+ /**
1057
+ * Call a feature of the component with the provided scope
1058
+ *
1059
+ * [!] If the provided scope is not inherited from the entity scope, it will be inherited
1060
+ *
1061
+ * @param lifecycleMethod
1062
+ * @param args
1063
+ */
1064
+ call(feature: string, scope?: A_Scope): any;
1065
+ /**
1066
+ * The default method that can be called and extended to load entity data.
1067
+ */
1068
+ load(scope?: A_Scope): Promise<any>;
1069
+ /**
1070
+ * The default method that can be called and extended to destroy entity data.
1071
+ */
1072
+ destroy(scope?: A_Scope): Promise<any>;
1073
+ /**
1074
+ * The default method that can be called and extended to save entity data.
1075
+ */
1076
+ save(scope?: A_Scope): Promise<any>;
1077
+ /**
1078
+ * Create a new entity from ASEID string or instance
1079
+ * [!] Executed when the constructor is called with a string or ASEID instance that represents the ASEID
1080
+ * [!] Executes By Default with new A_Entity('aseid-string') or new A_Entity(new ASEID(...)) if getInitializer has not been overridden
1081
+ *
1082
+ * @param aseid
1083
+ */
1084
+ fromASEID(aseid: string | ASEID): void;
1085
+ /**
1086
+ * Handles the case when no props are provided to the constructor.
1087
+ * This method can be overridden in child classes to set default values or perform specific initialization logic.
1088
+ * By default, it does nothing.
1089
+ *
1090
+ *
1091
+ * @returns
1092
+ */
1093
+ fromUndefined(): void;
1094
+ /**
1095
+ * Create a new entity from constructor object
1096
+ * [!] Executed when the constructor is called with an object that does not contain "aseid" property
1097
+ * [!] Executes By Default with new A_Entity({}) if getInitializer has not been overridden
1098
+ *
1099
+ * @param newEntity
1100
+ * @returns
1101
+ */
1102
+ fromNew(newEntity: _ConstructorType): void;
1103
+ /**
1104
+ * Creates a new entity from serialized object
1105
+ *
1106
+ * [!] Executed when the constructor is called with an object that contains "aseid" property
1107
+ * [!] Executes By Default with new A_Entity({ aseid: '...' }) if getInitializer has not been overridden
1108
+ *
1109
+ *
1110
+ * @param serialized
1111
+ * @returns
1112
+ */
1113
+ fromJSON(serialized: _SerializedType): void;
1114
+ /**
1115
+ * Converts the entity to a JSON object
1116
+ * [!] This method should be extended in the child classes to include all properties of the entity
1117
+ * [!] Includes aseid by default
1118
+ *
1119
+ *
1120
+ * @returns
1121
+ */
1122
+ toJSON(): _SerializedType;
1123
+ /**
1124
+ * Returns the string representation of the entity
1125
+ * what is basically the ASEID string
1126
+ *
1127
+ * @returns
1128
+ */
1129
+ toString(): string;
1130
+ }
1131
+
1132
+ declare class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {
1133
+ /**
1134
+ * Returns all features defined in the Container
1135
+ *
1136
+ * @returns
1137
+ */
1138
+ features(): Array<A_TYPES__FeatureDefineDecoratorMeta>;
1139
+ /**
1140
+ * Allows to get all the injections for a given handler
1141
+ *
1142
+ * @param handler
1143
+ * @returns
1144
+ */
1145
+ injections(handler: string): A_TYPES__A_InjectDecorator_Meta;
1146
+ }
1147
+
1148
+ declare class A_EntityError extends A_Error {
1149
+ /**
1150
+ * Error code for validation errors.
1151
+ */
1152
+ static readonly ValidationError = "A-Entity Validation Error";
1153
+ }
1154
+
1155
+ declare enum A_TYPES__A_Stage_Status {
1156
+ /**
1157
+ * The stage is currently being processed
1158
+ */
1159
+ PROCESSING = "PROCESSING",
1160
+ /**
1161
+ * The stage has been completed
1162
+ */
1163
+ COMPLETED = "COMPLETED",
1164
+ /**
1165
+ * The stage has failed
1166
+ */
1167
+ FAILED = "FAILED",
1168
+ /**
1169
+ * The stage has been skipped
1170
+ */
1171
+ SKIPPED = "SKIPPED",
1172
+ /**
1173
+ * The stage has been paused
1174
+ */
1175
+ /**
1176
+ * The stage has been stopped
1177
+ */
1178
+ /**
1179
+ * The stage has been started
1180
+ */
1181
+ /**
1182
+ * The stage has been initialized
1183
+ */
1184
+ INITIALIZED = "INITIALIZED",
1185
+ /**
1186
+ * The stage has been aborted
1187
+ */
1188
+ ABORTED = "ABORTED"
1189
+ }
1190
+ type A_TYPES_StageExecutionBehavior = 'async' | 'sync';
1191
+ type A_TYPES__A_StageStep = {
1192
+ /**
1193
+ * The component to be called
1194
+ */
1195
+ dependency: A_Dependency;
1196
+ /**
1197
+ * The method to be called on the component
1198
+ */
1199
+ handler: string;
1200
+ /**
1201
+ * Original Feature Extension name
1202
+ *
1203
+ * [!] could be string or regex
1204
+ *
1205
+ */
1206
+ name: string;
1207
+ /**
1208
+ * In case its async it will be executed independently from the main thread.
1209
+ *
1210
+ * [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.
1211
+ *
1212
+ */
1213
+ behavior: A_TYPES_StageExecutionBehavior;
1214
+ /**
1215
+ * Allows to define the order of the execution of the method.
1216
+ *
1217
+ * [!] In case the method has circular dependencies it will Throw an error.
1218
+ *
1219
+ */
1220
+ before: string;
1221
+ /**
1222
+ * Allows to define the order of the execution of the method.
1223
+ *
1224
+ * [!] In case the method has circular dependencies it will Throw an error.
1225
+ *
1226
+ */
1227
+ after: string;
1228
+ /**
1229
+ * Indicates whether to throw an error if the step fails.
1230
+ *
1231
+ * [!] By default is true
1232
+ */
1233
+ throwOnError: boolean;
1234
+ /**
1235
+ *
1236
+ */
1237
+ override: string;
1238
+ };
1239
+ type A_TYPES__Stage_Serialized = {
1240
+ /**
1241
+ * The name of the stage
1242
+ */
1243
+ name: string;
1244
+ /**
1245
+ * The status of the stage
1246
+ *
1247
+ */
1248
+ status: A_TYPES__A_Stage_Status;
1249
+ };
1250
+ type A_TYPES__A_StageStepProcessingExtraParams = {
1251
+ steps: A_TYPES__A_StageStep[];
1252
+ filter: (step: A_TYPES__A_StageStep) => boolean;
1253
+ };
1254
+
1255
+ declare class A_Stage {
1256
+ /**
1257
+ * The feature that owns this stage
1258
+ */
1259
+ private readonly _feature;
1260
+ /**
1261
+ * Initial Instructions to process the stage
1262
+ */
1263
+ private readonly _definition;
1264
+ /**
1265
+ * Possible errors during stage processing
1266
+ */
1267
+ private _error?;
1268
+ /**
1269
+ * Indicates the current status of the stage
1270
+ */
1271
+ private _status;
1272
+ /**
1273
+ * A_Stage is a callable A_Function within A_Feature that should be run with specific parameters.
1274
+ * [!] Depending on the Stage Definition type sync/async function can be executed correspondingly.
1275
+ *
1276
+ * A-Stage is a common object that uses to simplify logic and re-use of A-Feature internals for better composition.
1277
+ */
1278
+ constructor(
1279
+ /**
1280
+ * The feature that owns this stage
1281
+ */
1282
+ feature: A_Feature,
1283
+ /**
1284
+ * The step definitions of the stage
1285
+ */
1286
+ step: A_TYPES__A_StageStep);
1287
+ /**
1288
+ * Returns the name of the stage
1289
+ */
1290
+ get name(): string;
1291
+ /**
1292
+ * Returns the definition of the stage
1293
+ */
1294
+ get definition(): A_TYPES__A_StageStep;
1295
+ /**
1296
+ * Returns the current status of the stage
1297
+ */
1298
+ get status(): A_TYPES__A_Stage_Status;
1299
+ /**
1300
+ * Returns the feature that owns this stage
1301
+ */
1302
+ get feature(): A_Feature;
1303
+ /**
1304
+ * Returns true if the stage is processed (completed, failed, or skipped)
1305
+ */
1306
+ get isProcessed(): boolean;
1307
+ /**
1308
+ * Returns the error of the stage
1309
+ */
1310
+ get error(): A_Error | undefined;
1311
+ /**
1312
+ * Resolves the arguments of the step
1313
+ *
1314
+ * @param step
1315
+ * @returns
1316
+ */
1317
+ protected getStepArgs(scope: A_Scope, step: A_TYPES__A_StageStep): (A_Component | A_Container | A_Entity<any, A_TYPES__Entity_Serialized> | A_Fragment<A_TYPES__Fragment_Serialized> | A_Feature<A_TYPES__FeatureAvailableComponents> | A_Caller<A_TYPES__FeatureAvailableComponents> | A_Error<A_TYPES__Error_Init, A_TYPES__Error_Serialized> | A_Scope<any, A_TYPES__Component_Constructor[], A_TYPES__Error_Constructor[], A_TYPES__Entity_Constructor[], A_Fragment<A_TYPES__Fragment_Serialized>[]> | A_TYPES__A_DependencyInjectable[] | undefined)[];
1318
+ /**
1319
+ * Resolves the component of the step
1320
+ *
1321
+ * @param step
1322
+ * @returns
1323
+ */
1324
+ protected getStepComponent(scope: A_Scope, step: A_TYPES__A_StageStep): A_TYPES__A_DependencyInjectable;
1325
+ /**
1326
+ * Calls the handler of the step
1327
+ *
1328
+ * @param step
1329
+ * @returns
1330
+ */
1331
+ protected callStepHandler(step: A_TYPES__A_StageStep, scope: A_Scope): {
1332
+ handler: Function;
1333
+ params: any[];
1334
+ };
1335
+ skip(): void;
1336
+ /**
1337
+ * This method processes the stage by executing all the steps
1338
+ *
1339
+ * @param scope - Scope to be used to resolve the steps dependencies
1340
+ */
1341
+ process(
1342
+ /**
1343
+ * Scope to be used to resolve the steps dependencies
1344
+ */
1345
+ scope?: A_Scope): Promise<void> | void;
1346
+ protected completed(): void;
1347
+ protected failed(error: Error | A_Error | any): void;
1348
+ /**
1349
+ * Serializes the stage to JSON
1350
+ *
1351
+ */
1352
+ toJSON(): A_TYPES__Stage_Serialized;
1353
+ /**
1354
+ * Returns a string representation of the stage
1355
+ *
1356
+ * @returns
1357
+ */
1358
+ toString(): string;
1359
+ }
1360
+
1361
+ declare class A_StageError extends A_Error {
1362
+ static readonly ArgumentsResolutionError = "A-Stage Arguments Resolution Error";
1363
+ static get CompileError(): string;
1364
+ }
1365
+
1366
+ /**
1367
+ * Feature constructor type
1368
+ * Uses the generic type T to specify the type of the feature
1369
+ */
1370
+ type A_TYPES__Feature_Constructor<T = A_Feature> = A_TYPES__Ctor<T>;
1371
+ /**
1372
+ * Feature initialization type
1373
+ */
1374
+ type A_TYPES__Feature_Init<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = A_TYPES__Feature_InitWithComponent<T> | A_TYPES__Feature_InitWithTemplate<T>;
1375
+ /**
1376
+ * Feature initialization type using component
1377
+ */
1378
+ type A_TYPES__Feature_InitWithComponent<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = {
1379
+ /**
1380
+ * Feature Name
1381
+ */
1382
+ name: string;
1383
+ /**
1384
+ * The component from where the feature is calling. It's important for proper scoping.
1385
+ * Based on the component would be retrieved connected components, entities and containers.
1386
+ *
1387
+ * [!] Could be Container, Entity, Component or Command
1388
+ */
1389
+ component: T;
1390
+ /**
1391
+ * In case when Entity is not attached to the scope can be used to transparently show dependencies
1392
+ *
1393
+ *
1394
+ */
1395
+ scope?: A_Scope;
1396
+ };
1397
+ /**
1398
+ * Feature initialization type using template
1399
+ */
1400
+ type A_TYPES__Feature_InitWithTemplate<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = {
1401
+ /**
1402
+ * Feature Name
1403
+ */
1404
+ name: string;
1405
+ /**
1406
+ * The scope from where to retrieve dependent components, entities and containers.
1407
+ *
1408
+ * [!] Important for proper scoping.
1409
+ */
1410
+ scope: A_Scope;
1411
+ /**
1412
+ * The component from where the feature is calling. It's important for proper scoping.
1413
+ * Based on the component would be retrieved connected components, entities and containers.
1414
+ *
1415
+ * [!] Could be Container, Entity, Component or Command
1416
+ */
1417
+ component?: T;
1418
+ /**
1419
+ * Optional Feature template to be used instead of building it from decorators
1420
+ */
1421
+ template: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>;
1422
+ };
1423
+ /**
1424
+ * Feature serialized type
1425
+ */
1426
+ type A_TYPES__Feature_Serialized = {};
1427
+ /**
1428
+ * Feature lifecycle states
1429
+ */
1430
+ declare enum A_TYPES__FeatureState {
1431
+ /**
1432
+ * The feature has been initialized
1433
+ */
1434
+ INITIALIZED = "INITIALIZED",
1435
+ /**
1436
+ * The feature is currently being processed
1437
+ */
1438
+ PROCESSING = "PROCESSING",
1439
+ /**
1440
+ * The feature has been completed
1441
+ */
1442
+ COMPLETED = "COMPLETED",
1443
+ /**
1444
+ * The feature has been interrupted
1445
+ */
1446
+ INTERRUPTED = "INTERRUPTED",
1447
+ /**
1448
+ * The feature has failed
1449
+ */
1450
+ FAILED = "FAILED"
1451
+ }
1452
+ type A_TYPES__FeatureError_Init = {
1453
+ /**
1454
+ * Stage where the error occurred
1455
+ */
1456
+ stage?: A_Stage;
1457
+ } & A_TYPES__Error_Init;
1458
+ /**
1459
+ * A list of component where features can be Defined
1460
+ *
1461
+ * [!] On this component Feature Definition is Available
1462
+ */
1463
+ type A_TYPES__FeatureAvailableComponents = InstanceType<A_TYPES__FeatureAvailableConstructors>;
1464
+ /**
1465
+ * A list of constructors where features can be Defined
1466
+ *
1467
+ * [!] On this component Feature Definition is Available
1468
+ */
1469
+ type A_TYPES__FeatureAvailableConstructors = A_TYPES__Component_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Container_Constructor;
1470
+ /**
1471
+ * Indicates a type of Feature Define decorator
1472
+ */
1473
+ type A_TYPES__FeatureDefineDecoratorDescriptor = TypedPropertyDescriptor<(...args: any[]) => any> | TypedPropertyDescriptor<(...args: any[]) => any> | TypedPropertyDescriptor<(...args: any[]) => Promise<any>> | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>;
1474
+ /**
1475
+ * Describes additional configuration properties to be used in Feature Define decorator
1476
+ */
1477
+ type A_TYPES__FeatureDefineDecoratorConfig = {
1478
+ /**
1479
+ * Feature name
1480
+ *
1481
+ * [!] By default uses the method name
1482
+ */
1483
+ name: string;
1484
+ /**
1485
+ * Indicates a default behavior of the feature. If true the feature will be automatically attached to the execution.
1486
+ *
1487
+ * [!] Before feature execution the method itself will be called to prepare the feature template
1488
+ * [!] Default is false
1489
+ */
1490
+ invoke: boolean;
1491
+ /**
1492
+ * Allows to add a default behavior or number of steps that will be part of the feature
1493
+ */
1494
+ template: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>;
1495
+ };
1496
+ /**
1497
+ * Describes a single template item used in Feature Define decorator
1498
+ */
1499
+ type A_TYPES__FeatureDefineDecoratorTemplateItem = A_TYPES__Required<Partial<A_TYPES__A_StageStep>, ['name', 'handler', 'dependency']>;
1500
+ /**
1501
+ * Describes a target where Feature Define decorator can be applied
1502
+ *
1503
+ * [!] The feature can be defined on Container, Entity, Component or Command
1504
+ */
1505
+ type A_TYPES__FeatureDefineDecoratorTarget = A_Container | A_Entity | A_Component;
1506
+ /**
1507
+ * A type of Meta information stored by Feature Define decorator
1508
+ * This information then uses by A-Context to build a proper feature template
1509
+ */
1510
+ type A_TYPES__FeatureDefineDecoratorMeta = {
1511
+ /**
1512
+ * Feature name
1513
+ * mainly it's a unique combination of the class name and method name
1514
+ */
1515
+ name: string;
1516
+ /**
1517
+ * Actual method name in the class
1518
+ */
1519
+ handler: string;
1520
+ /**
1521
+ * Indicates a default behavior of the feature. If true the feature will be automatically attached to the execution.
1522
+ *
1523
+ * [!] Before feature execution the method itself will be called to prepare the feature template
1524
+ * [!] Default is false
1525
+ */
1526
+ invoke: boolean;
1527
+ /**
1528
+ * Allows to add a default behavior or number of steps that will be part of the feature
1529
+ */
1530
+ template: Array<A_TYPES__A_StageStep>;
1531
+ };
1532
+ /**
1533
+ * Descriptor type for A_Extend decorator
1534
+ */
1535
+ type A_TYPES__FeatureExtendDecoratorDescriptor = TypedPropertyDescriptor<() => any> | TypedPropertyDescriptor<(...args: any[]) => any> | TypedPropertyDescriptor<(...args: any[]) => Promise<any>> | TypedPropertyDescriptor<() => Promise<any>>;
1536
+ /**
1537
+ * Target type for A_Extend decorator
1538
+ *
1539
+ * [!] Can be applied only on A-Components
1540
+ */
1541
+ type A_TYPES__FeatureExtendDecoratorTarget = A_Component | A_Container | A_Entity;
1542
+ /**
1543
+ * Configuration type for A_Extend decorator
1544
+ *
1545
+ * This is an INPUT parameter provided by the user
1546
+ */
1547
+ type A_TYPES__FeatureExtendDecoratorConfig = {
1548
+ /**
1549
+ * Name of the container Lifecycle method to be extended.
1550
+ *
1551
+ * [!] If not provided will be used the name of the method.
1552
+ * [!!] If name contains "." dot it will be considered as a path to the method.
1553
+ */
1554
+ name: string;
1555
+ /**
1556
+ * Container class or container name uses to identify the proper container in case when the name is not unique.
1557
+ *
1558
+ * [!] If not provided will be applied to all containers with the same name.
1559
+ * [!!] By default uses OR to join all provided items. If you need more complex Logic, please use Regexp instead
1560
+ *
1561
+ * [!!!] In case if you need to exclude some containers, entities or components, please use "exclude" property
1562
+ *
1563
+ * Example:
1564
+ *
1565
+ * ```ts
1566
+ * @A_Feature.Extend({
1567
+ * name: 'load',
1568
+ * scope: {
1569
+ * include: [A_Container1, A_Entity1],
1570
+ * exclude: [A_Component1]
1571
+ * }
1572
+ * })
1573
+ * ```
1574
+ */
1575
+ scope: Array<A_TYPES__FeatureExtendDecoratorScopeItem> | Partial<A_TYPES__FeatureExtendDecoratorScopeConfig>;
1576
+ /**
1577
+ * The behavior of the method.
1578
+ * In case its async it will be executed independently from the main thread.
1579
+ *
1580
+ * [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.
1581
+ *
1582
+ */
1583
+ behavior: A_TYPES_StageExecutionBehavior;
1584
+ /**
1585
+ * Allows to define the order of the execution of the method.
1586
+ *
1587
+ * [!] It applies for the following structure :'Component.methodName'
1588
+ * [!] In case the method has circular dependencies it will Throw an error.
1589
+ *
1590
+ * Example:
1591
+ * ```ts
1592
+ * @A_Feature.Extend({
1593
+ * name: 'load',
1594
+ * before: ['Component1.methodName', 'Component2.methodName2']
1595
+ * })
1596
+ * // OR
1597
+ * @A_Feature.Extend({
1598
+ * name: 'load',
1599
+ * before: /Component2\..+/
1600
+ * })
1601
+ * ```
1602
+ */
1603
+ before: Array<string> | RegExp;
1604
+ /**
1605
+ * Allows to define the order of the execution of the method.
1606
+ *
1607
+ * [!] It applies for the following structure :'Component.methodName'
1608
+ * [!] In case the method has circular dependencies it will Throw an error.
1609
+ *
1610
+ * Example:
1611
+ * ```ts
1612
+ * @A_Feature.Extend({
1613
+ * name: 'load',
1614
+ * after: ['Component1.methodName', 'Component2.methodName2']
1615
+ * })
1616
+ * // OR
1617
+ * @A_Feature.Extend({
1618
+ * name: 'load',
1619
+ * after: /Component2\..+/
1620
+ * })
1621
+ * ```
1622
+ *
1623
+ */
1624
+ after: Array<string> | RegExp;
1625
+ /**
1626
+ * Indicates whether to throw an error if the step fails.
1627
+ *
1628
+ * [!] By default is true
1629
+ */
1630
+ throwOnError: boolean;
1631
+ /**
1632
+ * Allows to override particular steps in the feature sequence by provided names [Component].[Method] or by regexp
1633
+ */
1634
+ override: Array<string> | RegExp;
1635
+ };
1636
+ /**
1637
+ * Scope item that can be used in A_Extend decorator configuration
1638
+ */
1639
+ type A_TYPES__FeatureExtendDecoratorScopeConfig = {
1640
+ /**
1641
+ * A list of components, entities or containers to include in the scope of the extension
1642
+ */
1643
+ include?: Array<A_TYPES__FeatureExtendDecoratorScopeItem>;
1644
+ /**
1645
+ * A list of components, entities or containers to exclude from the scope of the extension
1646
+ */
1647
+ exclude?: Array<A_TYPES__FeatureExtendDecoratorScopeItem>;
1648
+ };
1649
+ /**
1650
+ * A single item that can be used in scope configuration
1651
+ */
1652
+ type A_TYPES__FeatureExtendDecoratorScopeItem = A_TYPES__Container_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Component_Constructor;
1653
+ /**
1654
+ * Meta type for A_Extend decorator
1655
+ */
1656
+ type A_TYPES__FeatureExtendDecoratorMeta = {
1657
+ /**
1658
+ * Original Feature Extension name
1659
+ *
1660
+ * [!] could be string or regex
1661
+ */
1662
+ name: string;
1663
+ /**
1664
+ * Actual method name in the class
1665
+ */
1666
+ handler: string;
1667
+ /**
1668
+ * The behavior of the method.
1669
+ * In case its async it will be executed independently from the main thread.
1670
+ *
1671
+ * [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.
1672
+ *
1673
+ */
1674
+ behavior: A_TYPES_StageExecutionBehavior;
1675
+ /**
1676
+ * Allows to define the order of the execution of the method.
1677
+ *
1678
+ * [!] In case the method has circular dependencies it will Throw an error.
1679
+ *
1680
+ */
1681
+ before: string;
1682
+ /**
1683
+ * Allows to define the order of the execution of the method.
1684
+ *
1685
+ * [!] In case the method has circular dependencies it will Throw an error.
1686
+ *
1687
+ */
1688
+ after: string;
1689
+ /**
1690
+ * Indicates whether to throw an error if the step fails.
1691
+ *
1692
+ * [!] By default is true
1693
+ */
1694
+ throwOnError: boolean;
1695
+ /**
1696
+ * Allows to override particular steps in the feature sequence by provided names [Component].[Method] or by regexp
1697
+ */
1698
+ override: string;
1699
+ };
1700
+
1701
+ /**
1702
+ * A-Feature decorator
1703
+ *
1704
+ * This decorator allows to define a custom lifecycle stage for the Container.
1705
+ * These stages are executed in a container-specific order and can be extended by components that are injected into the container.
1706
+ * This approach allows to create a flexible and extendable architecture for the application.
1707
+ *
1708
+ * The main difference between the A-Feature and A-Feature decorators is that A-Feature methods can be inherited and overridden by child classes.
1709
+ *
1710
+ *
1711
+ * @param params
1712
+ * @returns
1713
+ */
1714
+ declare function A_Feature_Define(config?: Partial<A_TYPES__FeatureDefineDecoratorConfig>): (target: A_TYPES__FeatureDefineDecoratorTarget, propertyKey: string, descriptor: A_TYPES__FeatureDefineDecoratorDescriptor) => A_TYPES__FeatureDefineDecoratorDescriptor;
1715
+
1716
+ /**
1717
+ * A-Extend decorator
1718
+ *
1719
+ * This decorator allows to define a custom Extend stage for the Container.
1720
+ * These stages are executed in a container-specific order and can be extended by components that are injected into the container.
1721
+ * This approach allows to create a flexible and extendable architecture for the application.
1722
+ *
1723
+ * The main difference between the A-Extend and A-Extend decorators is that A-Extend methods can be inherited and overridden by child classes.
1724
+ *
1725
+ *
1726
+ * @param params
1727
+ * @returns
1728
+ */
1729
+ /**
1730
+ * Use regexp in case if you need more flexibility and control over the name of the method
1731
+ *
1732
+ * @param regexp
1733
+ */
1734
+ declare function A_Feature_Extend(
1735
+ /**
1736
+ * The regular expression to match the name of the Feature method to be extended
1737
+ *
1738
+ * Example:
1739
+ *
1740
+ * ```ts
1741
+ * @A_Feature.Extend(/.*\.load/)
1742
+ * ```
1743
+ */
1744
+ regexp: RegExp): any;
1745
+ /**
1746
+ * In this case the name configurations will be used as an input to get scope and name of target function
1747
+ * [!] Not that for all SCOPE will be used OR operator
1748
+ *
1749
+ * @param config
1750
+ */
1751
+ declare function A_Feature_Extend(
1752
+ /**
1753
+ * Configuration for the A-Feature-Extend decorator
1754
+ */
1755
+ config: Partial<A_TYPES__FeatureExtendDecoratorConfig>): any;
1756
+ /**
1757
+ * In this case the name of function will be used as a name of the Feature.
1758
+ * [!] AND it will be applicable for ANY element where the name is the same as the name of the function
1759
+ */
1760
+ declare function A_Feature_Extend(): any;
1761
+
1762
+ declare class A_StepsManager {
1763
+ entities: A_TYPES__A_StageStep[];
1764
+ graph: Map<string, Set<string>>;
1765
+ visited: Set<string>;
1766
+ tempMark: Set<string>;
1767
+ sortedEntities: string[];
1768
+ private _isBuilt;
1769
+ constructor(entities: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>);
1770
+ private prepareSteps;
1771
+ private ID;
1772
+ private buildGraph;
1773
+ private matchEntities;
1774
+ private visit;
1775
+ toSortedArray(): Array<string>;
1776
+ toStages(feature: A_Feature): Array<A_Stage>;
1777
+ }
1778
+
1779
+ declare class A_StepManagerError extends A_Error {
1780
+ static readonly CircularDependencyError = "A-StepManager Circular Dependency Error";
1781
+ }
1782
+
1783
+ declare class A_FeatureError extends A_Error<A_TYPES__FeatureError_Init> {
1784
+ /**
1785
+ * Indicates that the Feature has been interrupted
1786
+ */
1787
+ static readonly Interruption = "Feature Interrupted";
1788
+ /**
1789
+ * Indicates that there was an error initializing the Feature
1790
+ *
1791
+ * Failed during the A-Feature initialization process
1792
+ */
1793
+ static readonly FeatureInitializationError = "Unable to initialize A-Feature";
1794
+ /**
1795
+ * Indicates that there was an error processing the Feature
1796
+ *
1797
+ * Failed during the A-Feature processing
1798
+ */
1799
+ static readonly FeatureProcessingError = "Error occurred during A-Feature processing";
1800
+ /**
1801
+ * Indicates that there was an error defining the Feature
1802
+ *
1803
+ * Failed during the @A_Feature.Define() decorator execution
1804
+ */
1805
+ static readonly FeatureDefinitionError = "Unable to define A-Feature";
1806
+ /**
1807
+ * Indicates that there was an error extending the Feature
1808
+ *
1809
+ * Failed during the @A_Feature.Extend() decorator execution
1810
+ */
1811
+ static readonly FeatureExtensionError = "Unable to extend A-Feature";
1812
+ /**
1813
+ * Stage where the error occurred
1814
+ */
1815
+ stage?: A_Stage;
1816
+ protected fromConstructor(params: A_TYPES__FeatureError_Init): void;
1817
+ }
1818
+
1819
+ /**
1820
+ * A_Feature is representing a feature that can be executed across multiple components
1821
+ * This class stores the steps of the feature and executes them in order of appearance
1822
+ *
1823
+ * Using A_Feature.Define and A_Feature.Extend decorators to define and extend the feature methods
1824
+ * across the different, distributed components
1825
+ *
1826
+ */
1827
+ declare class A_Feature<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> {
1828
+ /**
1829
+ * Define a new A-Feature
1830
+ */
1831
+ static get Define(): typeof A_Feature_Define;
1832
+ /**
1833
+ * Extend an existing A-Feature
1834
+ */
1835
+ static get Extend(): typeof A_Feature_Extend;
1836
+ /**
1837
+ * The name of the Feature
1838
+ */
1839
+ protected _name: string;
1840
+ /**
1841
+ * List of stages that are part of this Feature
1842
+ */
1843
+ protected _stages: Array<A_Stage>;
1844
+ /**
1845
+ * The Stage currently being processed
1846
+ */
1847
+ protected _current?: A_Stage;
1848
+ /**
1849
+ * Actual Index of the current Stage being processed
1850
+ */
1851
+ protected _index: number;
1852
+ /**
1853
+ * Steps Manager to organize the steps into stages
1854
+ */
1855
+ protected _SM: A_StepsManager;
1856
+ /**
1857
+ * The Caller that initiated the Feature call
1858
+ */
1859
+ protected _caller: A_Caller<T>;
1860
+ /**
1861
+ * The current state of the Feature
1862
+ */
1863
+ protected _state: A_TYPES__FeatureState;
1864
+ /**
1865
+ * The error that caused the Feature to be interrupted
1866
+ */
1867
+ protected _error?: A_FeatureError;
1868
+ /**
1869
+ * A-Feature is a pipeline distributed by multiple components that can be easily attached or detached from the scope.
1870
+ * Feature itself does not have scope, but attached to the caller who dictates how feature should be processed.
1871
+ *
1872
+ * Comparing to A-Command Feature does not store any state except statuses for better analysis.
1873
+ *
1874
+ * [!] Note: If A-Feature should have result use A-Fragment
1875
+ *
1876
+ * @param params
1877
+ */
1878
+ constructor(
1879
+ /**
1880
+ * Feature Initialization parameters
1881
+ */
1882
+ params: A_TYPES__Feature_Init<T>);
1883
+ /**
1884
+ * The name of the Feature
1885
+ */
1886
+ get name(): string;
1887
+ /**
1888
+ * The error that caused the Feature to be interrupted
1889
+ */
1890
+ get error(): A_FeatureError | undefined;
1891
+ /**
1892
+ * The current state of the Feature
1893
+ */
1894
+ get state(): A_TYPES__FeatureState;
1895
+ /**
1896
+ * Sets the current state of the Feature
1897
+ */
1898
+ get index(): number;
1899
+ /**
1900
+ * Returns the current A-Feature Stage
1901
+ */
1902
+ get stage(): A_Stage | undefined;
1903
+ /**
1904
+ * The Caller that initiated the Feature call
1905
+ */
1906
+ get caller(): A_Caller<T>;
1907
+ /**
1908
+ * The Scope allocated for the Feature Execution
1909
+ */
1910
+ get scope(): A_Scope;
1911
+ /**
1912
+ * The number of stages in the feature
1913
+ */
1914
+ get size(): number;
1915
+ /**
1916
+ * This method checks if the A-Feature is done
1917
+ *
1918
+ * @returns
1919
+ */
1920
+ get isDone(): boolean;
1921
+ /**
1922
+ * Indicates whether the feature has been processed (completed, failed, or interrupted)
1923
+ */
1924
+ get isProcessed(): boolean;
1925
+ /**
1926
+ * Iterator to iterate over the steps of the feature
1927
+ *
1928
+ * @returns
1929
+ */
1930
+ [Symbol.iterator](): Iterator<A_Stage, any>;
1931
+ /**
1932
+ * Validates the provided parameters for A-Feature initialization
1933
+ *
1934
+ * @param params
1935
+ */
1936
+ protected validateParams(params: A_TYPES__Feature_Init<T>): void;
1937
+ /**
1938
+ * Returns the appropriate initializer method based on the provided parameters
1939
+ *
1940
+ * @param params
1941
+ * @returns
1942
+ */
1943
+ protected getInitializer(params: A_TYPES__Feature_Init<T>): (param1: any) => void | (() => void);
1944
+ /**
1945
+ * Initializes the A-Feature from the provided template
1946
+ *
1947
+ * @param params
1948
+ */
1949
+ protected fromTemplate(params: A_TYPES__Feature_InitWithTemplate<T>): void;
1950
+ /**
1951
+ * Initializes the A-Feature from the provided component
1952
+ *
1953
+ * @param params
1954
+ */
1955
+ protected fromComponent(params: A_TYPES__Feature_InitWithComponent<T>): void;
1956
+ /**
1957
+ * This method processes the feature by executing all the stages
1958
+ *
1959
+ */
1960
+ process(
1961
+ /**
1962
+ * Optional scope to be used to resolve the steps dependencies
1963
+ * If not provided, the scope of the caller component will be used
1964
+ */
1965
+ scope?: A_Scope): Promise<void> | void;
1966
+ /**
1967
+ * Process stages one by one, ensuring each stage completes before starting the next
1968
+ */
1969
+ private processStagesSequentially;
1970
+ /**
1971
+ * This method moves the feature to the next stage
1972
+ *
1973
+ * @param stage
1974
+ */
1975
+ next(stage: any): void;
1976
+ /**
1977
+ * This method marks the feature as completed and returns the result
1978
+ * Uses to interrupt or end the feature processing
1979
+ *
1980
+ * @param result
1981
+ * @returns
1982
+ */
1983
+ completed(): void;
1984
+ /**
1985
+ * This method marks the feature as failed and returns the error
1986
+ * Uses to mark the feature as failed
1987
+ *
1988
+ * @param error
1989
+ * @returns The error that caused the failure
1990
+ */
1991
+ failed(error: A_FeatureError): A_FeatureError;
1992
+ /**
1993
+ * This method marks the feature as interrupted and throws an error
1994
+ * Uses to interrupt or end the feature processing
1995
+ *
1996
+ * @param error
1997
+ */
1998
+ interrupt(
1999
+ /**
2000
+ * The reason of feature interruption
2001
+ */
2002
+ reason?: string | A_StageError | Error): A_FeatureError;
2003
+ /**
2004
+ * Allows to chain the feature to another feature.
2005
+ * In this case the parent feature scope (if new not provided), stages, caller will be used.
2006
+ *
2007
+ * [!] Note: Chained feature will use the same caller as the parent feature.
2008
+ *
2009
+ * @param feature
2010
+ */
2011
+ chain(
2012
+ /**
2013
+ * A Feature to be chained
2014
+ */
2015
+ feature: A_Feature,
2016
+ /**
2017
+ * Optional scope to be used for the chained feature.
2018
+ */
2019
+ scope?: A_Scope): any;
2020
+ chain<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents>(
2021
+ /**
2022
+ * Component whose feature should be chained
2023
+ */
2024
+ component: A_TYPES__FeatureAvailableComponents,
2025
+ /**
2026
+ * A Feature Name to be chained
2027
+ */
2028
+ feature: string,
2029
+ /**
2030
+ * Optional scope to be used for the chained feature.
2031
+ */
2032
+ scope?: A_Scope): any;
2033
+ toString(): string;
2034
+ }
2035
+
2036
+ /**
2037
+ * This is a common class that uses to return an entity that initiates a feature call
2038
+ *
2039
+ * It can be used then in @A_Inject(A_Caller) to get the entity that initiated the feature call
2040
+ *
2041
+ * [!] the class itself may be retrieved, but may require additional processing inside the feature
2042
+ *
2043
+ */
2044
+ declare class A_Caller<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> {
2045
+ /**
2046
+ * The component that initiated the feature call
2047
+ */
2048
+ protected _component: T;
2049
+ /**
2050
+ * A_Caller allows to get the component that initiated the feature call
2051
+ *
2052
+ * It can be used then in @A_Inject(A_Caller) to get the entity that initiated the feature call
2053
+ *
2054
+ * [!] If Scope is not provided, a new empty scope will be created and inherited from the global scope
2055
+ *
2056
+ * @param component
2057
+ * @param scope
2058
+ */
2059
+ constructor(component: T);
2060
+ get component(): T;
2061
+ /**
2062
+ * Validates the provided parameters and Ensures that the component is of an allowed type
2063
+ *
2064
+ * @param component
2065
+ */
2066
+ protected validateParams(component: T): void;
2067
+ }
2068
+
2069
+ declare class A_CallerError extends Error {
2070
+ /**
2071
+ * This error code indicates that there was an issue initializing the A-Caller
2072
+ */
2073
+ static readonly CallerInitializationError = "Unable to initialize A-Caller";
2074
+ }
2075
+
2076
+ type A_TYPES__CallerComponent = A_Container | A_Component | A_Entity;
2077
+ /**
2078
+ * Caller constructor type
2079
+ * Uses the generic type T to specify the type of the caller component
2080
+ */
2081
+ type A_TYPES__Caller_Constructor<T = A_Caller> = A_TYPES__Ctor<T>;
2082
+ /**
2083
+ * Caller initialization type
2084
+ */
2085
+ type A_TYPES__Caller_Init = {};
2086
+ /**
2087
+ * Caller serialized type
2088
+ */
2089
+ type A_TYPES__Caller_Serialized = {};
2090
+
2091
+ type A_TYPES__A_DependencyConstructor<T extends A_Dependency> = A_TYPES__Ctor<T>;
2092
+ type A_TYPES__A_DependencyInjectable = A_Entity | A_Container | A_Component | A_Fragment | A_Feature | A_Caller | A_Error | A_Scope;
2093
+ type A_TYPES__A_DependencyResolutionType<T> = T extends string ? string : T extends A_TYPES__Ctor<infer R> ? R : never;
2094
+ type A_TYPES__A_DependencyResolutionStrategy<T extends A_TYPES__A_DependencyInjectable = A_TYPES__A_DependencyInjectable> = {
2095
+ /**
2096
+ * If tru will throw an error if the dependency is not found
2097
+ */
2098
+ require: boolean;
2099
+ /**
2100
+ * Indicates that dependency should be loaded from a specific path before resolution
2101
+ */
2102
+ load: boolean;
2103
+ /**
2104
+ * Number of levels to go up in the parent chain when resolving the dependency
2105
+ */
2106
+ parent: number;
2107
+ /**
2108
+ * If true, will only resolve the dependency in the current scope without going up to parent scopes
2109
+ */
2110
+ flat: boolean;
2111
+ /**
2112
+ * If has any value indicates that entity should be created with default parameters provided
2113
+ */
2114
+ create: boolean;
2115
+ /**
2116
+ * Default constructor arguments to use when creating the dependency
2117
+ */
2118
+ args: any[];
2119
+ /**
2120
+ * Allows to query by specific entity properties e.g. ASEID, name, type, custom properties, etc.
2121
+ */
2122
+ query: Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>>;
2123
+ /**
2124
+ * Pagination settings for the entity search
2125
+ */
2126
+ pagination: A_TYPES__A_Dependency_EntityInjectionPagination;
2127
+ };
2128
+ type A_TYPES__A_Dependency_Serialized<T extends A_TYPES__A_DependencyInjectable = A_TYPES__A_DependencyInjectable> = {
2129
+ name: string;
2130
+ all: boolean;
2131
+ require: boolean;
2132
+ load: boolean;
2133
+ parent: number;
2134
+ flat: boolean;
2135
+ create: any;
2136
+ args: any[];
2137
+ query: Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>>;
2138
+ pagination: A_TYPES__A_Dependency_EntityInjectionPagination;
2139
+ };
2140
+ type A_TYPES__A_Dependency_EntityResolutionConfig<T extends A_TYPES__A_DependencyInjectable = A_TYPES__A_DependencyInjectable> = {
2141
+ query: Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>>;
2142
+ pagination: Partial<A_TYPES__A_Dependency_EntityInjectionPagination>;
2143
+ };
2144
+ type A_TYPES__A_Dependency_EntityInjectionQuery<T extends A_TYPES__A_DependencyInjectable = A_TYPES__A_DependencyInjectable> = T extends A_Entity ? {
2145
+ aseid: string;
2146
+ } & {
2147
+ [key in keyof T]?: any;
2148
+ } : never;
2149
+ type A_TYPES__A_Dependency_EntityInjectionPagination = {
2150
+ count: number;
2151
+ from: 'start' | 'end';
2152
+ };
2153
+ /**
2154
+ * A-Dependency require decorator return type
2155
+ */
2156
+ type A_TYPES__A_Dependency_RequireDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
2157
+ /**
2158
+ * A-Dependency load decorator return type
2159
+ */
2160
+ type A_TYPES__A_Dependency_LoadDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
2161
+ /**
2162
+ * A-Dependency default decorator return type
2163
+ */
2164
+ type A_TYPES__A_Dependency_DefaultDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
2165
+ /**
2166
+ * A-Dependency parent decorator return type
2167
+ */
2168
+ type A_TYPES__A_Dependency_ParentDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
2169
+ /**
2170
+ * A-Dependency flat decorator return type
2171
+ */
2172
+ type A_TYPES__A_Dependency_FlatDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
2173
+ /**
2174
+ * A-Dependency All decorator return type
2175
+ */
2176
+ type A_TYPES__A_Dependency_AllDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
2177
+ type A_TYPES__A_Dependency_QueryTarget<T extends A_Entity = A_Entity> = T | A_TYPES__Entity_Constructor<T>;
2178
+ /**
2179
+ * A-Dependency Query decorator return type
2180
+ */
2181
+ type A_TYPES__A_Dependency_QueryDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
2182
+
2183
+ /**
2184
+ * Should indicate which Default is required
2185
+ */
2186
+ declare function A_Dependency_Default(
2187
+ /**
2188
+ * Constructor Parameters that will be used to create the default instance
2189
+ */
2190
+ ...args: any[]): A_TYPES__A_Dependency_DefaultDecoratorReturn;
2191
+
2192
+ /**
2193
+ * Should indicate which dependency is required
2194
+ */
2195
+ declare function A_Dependency_Flat(): A_TYPES__A_Dependency_FlatDecoratorReturn;
2196
+
2197
+ /**
2198
+ * Should indicate which Load is required
2199
+ */
2200
+ declare function A_Dependency_Load(): A_TYPES__A_Dependency_LoadDecoratorReturn;
2201
+
2202
+ /**
2203
+ * Should indicate which dependency is required
2204
+ */
2205
+ declare function A_Dependency_Parent(
2206
+ /**
2207
+ * Indicates how many layers up the parent dependency should be resolved from current dependency
2208
+ *
2209
+ * Default: -1 (one layer up)
2210
+ */
2211
+ layerOffset?: number): A_TYPES__A_Dependency_ParentDecoratorReturn;
2212
+
2213
+ /**
2214
+ * Should indicate which dependency is required
2215
+ */
2216
+ declare function A_Dependency_Require(): A_TYPES__A_Dependency_RequireDecoratorReturn;
2217
+
2218
+ /**
2219
+ * Should indicate which All is required
2220
+ */
2221
+ declare function A_Dependency_All(): A_TYPES__A_Dependency_AllDecoratorReturn;
2222
+
2223
+ /**
2224
+ * Query Decorator is only applicable for Entities since Scope instance may have multiple entities but only one component or container, so there is no need for such complex resolution strategies for them, but for entities it is a common case to have multiple instances and need to specify which one(s) to inject.
2225
+ *
2226
+ *
2227
+ * @param query
2228
+ * @returns
2229
+ */
2230
+ declare function A_Dependency_Query<T extends A_Entity = A_Entity>(query: Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>>, pagination?: Partial<A_TYPES__A_Dependency_EntityInjectionPagination>): A_TYPES__A_Dependency_QueryDecoratorReturn;
2231
+
2232
+ declare class A_Dependency<T extends A_TYPES__A_DependencyInjectable = A_TYPES__A_DependencyInjectable> {
2233
+ /**
2234
+ * Allows to indicate which Injected parameter is required
2235
+ *
2236
+ * [!] If parameter marked as required is not provided, an error will be thrown
2237
+ *
2238
+ * @returns
2239
+ */
2240
+ static get Required(): typeof A_Dependency_Require;
2241
+ /**
2242
+ * Allows to indicate which dependency should be loaded from a specific path
2243
+ *
2244
+ * @returns
2245
+ */
2246
+ static get Loaded(): typeof A_Dependency_Load;
2247
+ /**
2248
+ * Allows to indicate which dependency default parameters should be used
2249
+ *
2250
+ * @returns
2251
+ */
2252
+ static get Default(): typeof A_Dependency_Default;
2253
+ /**
2254
+ * Allows to indicate which parent dependency should be resolved
2255
+ * e.g. from which layer up the parent should be taken
2256
+ *
2257
+ * @returns
2258
+ */
2259
+ static get Parent(): typeof A_Dependency_Parent;
2260
+ /**
2261
+ * Allows to indicate that the dependency should be resolved in a flat manner
2262
+ * Only in the same scope, without going up to parent scopes
2263
+ *
2264
+ * @returns
2265
+ */
2266
+ static get Flat(): typeof A_Dependency_Flat;
2267
+ /**
2268
+ * Allows to indicate that all instances of the dependency should be resolved
2269
+ *
2270
+ * @returns
2271
+ */
2272
+ static get All(): typeof A_Dependency_All;
2273
+ /**
2274
+ * Allows to indicate that the dependency should be resolved by specific query parameters
2275
+ * e.g. by ASEID, name, type, custom properties, etc.
2276
+ *
2277
+ * @returns
2278
+ */
2279
+ static get Query(): typeof A_Dependency_Query;
2280
+ protected _name: string;
2281
+ protected _target?: A_TYPES__Ctor<T>;
2282
+ protected _resolutionStrategy: A_TYPES__A_DependencyResolutionStrategy;
2283
+ protected _defaultPagination: A_TYPES__A_DependencyResolutionStrategy['pagination'];
2284
+ protected _defaultResolutionStrategy: A_TYPES__A_DependencyResolutionStrategy;
2285
+ get flat(): boolean;
2286
+ get require(): boolean;
2287
+ get load(): boolean;
2288
+ /**
2289
+ * Indicates cases when it's necessary to search across all instances
2290
+ */
2291
+ get all(): boolean;
2292
+ get parent(): number;
2293
+ get create(): any;
2294
+ get args(): any[];
2295
+ get query(): Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>>;
2296
+ get pagination(): A_TYPES__A_Dependency_EntityInjectionPagination;
2297
+ /**
2298
+ * Class instances allows to identify dependencies by name and use them for better type checking
2299
+ *
2300
+ * @param name
2301
+ */
2302
+ constructor(name: string | A_TYPES__Ctor<T>, resolutionStrategy?: Partial<Omit<A_TYPES__A_DependencyResolutionStrategy<T>, 'pagination'> & {
2303
+ pagination: Partial<A_TYPES__A_Dependency_EntityInjectionPagination>;
2304
+ }>);
2305
+ /**
2306
+ * Gets the dependency name
2307
+ *
2308
+ * Can be identifier, url or any string value
2309
+ *
2310
+ * @returns
2311
+ */
2312
+ get name(): string;
2313
+ /**
2314
+ * Returns the original class of the dependency if provided
2315
+ *
2316
+ */
2317
+ get target(): A_TYPES__Ctor<T> | undefined;
2318
+ /**
2319
+ * Gets the dependency resolution strategy
2320
+ */
2321
+ get resolutionStrategy(): A_TYPES__A_DependencyResolutionStrategy<T>;
2322
+ /**
2323
+ * Sets the dependency resolution strategy
2324
+ */
2325
+ set resolutionStrategy(strategy: Partial<Omit<A_TYPES__A_DependencyResolutionStrategy<T>, 'pagination'> & {
2326
+ pagination: Partial<A_TYPES__A_Dependency_EntityInjectionPagination>;
2327
+ }>);
2328
+ /**
2329
+ * Method for the parameters check and all input data before usage
2330
+ *
2331
+ * @returns
2332
+ */
2333
+ private initCheck;
2334
+ /**
2335
+ * Serializes the dependency to a JSON object
2336
+ *
2337
+ * @returns
2338
+ */
2339
+ toJSON(): A_TYPES__A_Dependency_Serialized<T>;
2340
+ }
2341
+
2342
+ declare class A_DependencyError extends A_Error {
2343
+ static readonly InvalidDependencyTarget = "Invalid Dependency Target";
2344
+ static readonly InvalidLoadTarget = "Invalid Load Target";
2345
+ static readonly InvalidLoadPath = "Invalid Load Path";
2346
+ static readonly InvalidDefaultTarget = "Invalid Default Target";
2347
+ static readonly ResolutionParametersError = "Dependency Resolution Parameters Error";
2348
+ }
2349
+
2350
+ /**
2351
+ * A-Inject decorator descriptor type
2352
+ * Indicates the type of the decorator function
2353
+ */
2354
+ type A_TYPES__A_InjectDecoratorDescriptor = TypedPropertyDescriptor<(...args: any[]) => Promise<void>>;
2355
+ /**
2356
+ * A-Inject decorator return type
2357
+ * Indicates what the decorator function returns
2358
+ */
2359
+ type A_TYPES__A_InjectDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
2360
+ type A_TYPES__A_InjectDecorator_Meta = Array<A_Dependency>;
2361
+ /**
2362
+ * Targets that can be injected into Extended functions or constructors
2363
+ */
2364
+ type A_TYPES__InjectableTargets = A_TYPES__Component_Constructor | InstanceType<A_TYPES__Component_Constructor> | InstanceType<A_TYPES__Container_Constructor>;
2365
+
2366
+ /**
2367
+ * A-Inject decorator
2368
+ *
2369
+ * This Decorator allows to inject dependencies into the module like
2370
+ * - Namespaces
2371
+ * - Other Concepts
2372
+ * - or maybe Components
2373
+ *
2374
+ * @param params - see overloads
2375
+ * @returns - decorator function
2376
+ */
2377
+ declare function A_Inject<T extends A_Component>(
2378
+ /**
2379
+ * Provide the Component constructor that will be associated with the injection.
2380
+ *
2381
+ * [!] It returns an Instance of the Component from current Scope or from Parent Scopes.
2382
+ */
2383
+ component: A_TYPES__Component_Constructor<T>,
2384
+ /**
2385
+ * Provide additional instructions on how to perform the injection
2386
+ *
2387
+ * [!] Default Pagination is 1 if it's necessary to get multiple Fragments please customize it in the instructions
2388
+ */
2389
+ config?: Omit<Partial<A_TYPES__A_DependencyResolutionStrategy<T>>, 'query' | 'pagination'>): A_TYPES__A_InjectDecoratorReturn;
2390
+ declare function A_Inject<T extends A_Fragment>(
2391
+ /**
2392
+ * Provide the Fragment constructor to inject the Fragment instance
2393
+ *
2394
+ * [!] It returns the Fragment instance from current Scope or from Parent Scopes.
2395
+ */
2396
+ fragment: A_TYPES__Fragment_Constructor<T>,
2397
+ /**
2398
+ * Provide additional instructions on how to perform the injection
2399
+ *
2400
+ * [!] Default Pagination is 1 if it's necessary to get multiple Fragments please customize it in the instructions
2401
+ */
2402
+ config?: Omit<Partial<A_TYPES__A_DependencyResolutionStrategy<T>>, 'query' | 'pagination'>): A_TYPES__A_InjectDecoratorReturn;
2403
+ declare function A_Inject<T extends A_Entity>(
2404
+ /**
2405
+ * Provide the Entity constructor to inject the Entity instance
2406
+ *
2407
+ * [!] Note: It returns the Entity instance from current Scope or from Parent Scopes.
2408
+ * [!] Note: If instance has more than one Entity of the same type It returns FIRST found Entity
2409
+ * [!] Note: Use 'config' to specify to inject specific one or even Array of Entities
2410
+ */
2411
+ entity: A_TYPES__Entity_Constructor<T>,
2412
+ /**
2413
+ * Provide additional instructions on how to perform the injection
2414
+ *
2415
+ * [!] Default Pagination is 1 if it's necessary to get multiple Entities please customize it in the instructions
2416
+ */
2417
+ config?: Partial<A_TYPES__A_DependencyResolutionStrategy<T>>): A_TYPES__A_InjectDecoratorReturn<T>;
2418
+ declare function A_Inject<T extends A_Component>(
2419
+ /**
2420
+ * Provide the name of Component constructor to inject the Component instance
2421
+ *
2422
+ * [!] You can use both customized one or original depending on your overriding strategy
2423
+ */
2424
+ ctor: string): A_TYPES__A_InjectDecoratorReturn;
2425
+ declare function A_Inject<T extends A_Caller>(
2426
+ /**
2427
+ * Provide the A_Caller constructor to inject the Caller instance
2428
+ *
2429
+ * [!] It returns initiator of the call, e.g. Container/Component/Command who called Feature
2430
+ */
2431
+ caller: A_TYPES__Caller_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
2432
+ declare function A_Inject<T extends A_Error>(
2433
+ /***
2434
+ * Provide the Error constructor that will be associated with the injection.
2435
+ *
2436
+ * [!] It returns an Instance of the Error what is executed.
2437
+ */
2438
+ error: A_TYPES__Error_Constructor<T>,
2439
+ /**
2440
+ * Provide additional instructions on how to perform the injection
2441
+ *
2442
+ * [!] Default Pagination is 1 if it's necessary to get multiple Fragments please customize it in the instructions
2443
+ */
2444
+ config?: Omit<Partial<A_TYPES__A_DependencyResolutionStrategy<T>>, 'query' | 'pagination'>): A_TYPES__A_InjectDecoratorReturn;
2445
+ declare function A_Inject<T extends A_Feature>(
2446
+ /**
2447
+ * Provide the Feature constructor that will be associated with the injection.
2448
+ *
2449
+ * [!] It returns an Instance of the Feature what is executed.
2450
+ */
2451
+ feature: A_TYPES__Feature_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
2452
+ declare function A_Inject<T extends A_Scope>(
2453
+ /***
2454
+ * Provide the Scope constructor that will be associated with the injection.
2455
+ *
2456
+ * [!] It returns an instance of the Scope where the Entity/Component/Container is defined.
2457
+ */
2458
+ scope: A_TYPES__Scope_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
2459
+ declare function A_Inject<T extends A_TYPES__A_DependencyInjectable>(
2460
+ /***
2461
+ * Provide the Scope constructor that will be associated with the injection.
2462
+ *
2463
+ * [!] It returns an instance of the Scope where the Entity/Component/Container is defined.
2464
+ */
2465
+ dependency: A_Dependency<T>): A_TYPES__A_InjectDecoratorReturn;
2466
+
2467
+ declare class A_InjectError extends A_Error {
2468
+ static readonly InvalidInjectionTarget = "Invalid target for A-Inject decorator";
2469
+ static readonly MissingInjectionTarget = "Missing target for A-Inject decorator";
2470
+ }
2471
+
2472
+ /**
2473
+ * Concept constructor type
2474
+ * Uses the generic type T to specify the type of the concept
2475
+ */
2476
+ type A_TYPES__Concept_Constructor<T = A_Concept> = A_TYPES__Ctor<T>;
2477
+ /**
2478
+ * Concept initialization type
2479
+ * Uses the generic type T to specify the type of containers that the concept will use
2480
+ */
2481
+ type A_TYPES__Concept_Init<T extends Array<A_Container>> = {
2482
+ /**
2483
+ * The name of the Concept
2484
+ * If name is not provided, will be used from environment variable A_CONCEPT_NAME
2485
+ *
2486
+ * By default, the name of the Concept is 'a-concept'
2487
+ *
2488
+ */
2489
+ name?: string;
2490
+ /**
2491
+ * A set of Context Fragments to register globally for the concept.
2492
+ * These fragments will be available in the global context.
2493
+ *
2494
+ */
2495
+ fragments?: Array<InstanceType<A_TYPES__Fragment_Constructor>>;
2496
+ /**
2497
+ * A set of Containers that the concept depends on.
2498
+ * These containers will create a new Container for the concept.
2499
+ */
2500
+ containers?: T;
2501
+ /**
2502
+ * A set of Entities that the concept can use.
2503
+ * These components will be used in the concept.
2504
+ */
2505
+ entities?: Array<InstanceType<A_TYPES__Entity_Constructor> | A_TYPES__Entity_Constructor>;
2506
+ /**
2507
+ * A set of Components available for all containers and fragments in the concept.
2508
+ * These components will be registered in the root scope of the concept.
2509
+ *
2510
+ * [!] Note that these components will be available in all containers and fragments in the concept.
2511
+ */
2512
+ components?: Array<A_TYPES__Component_Constructor>;
2513
+ };
2514
+ /**
2515
+ * Concept serialized type
2516
+ */
2517
+ type A_TYPES__Concept_Serialized = {};
2518
+ /**
2519
+ * Uses as a transfer object to pass configurations to Feature constructor
2520
+ */
2521
+ type A_TYPES__ConceptAbstractionMeta = {
2522
+ /**
2523
+ * The arguments that will be passed to the handler
2524
+ */
2525
+ args: A_TYPES__A_InjectDecorator_Meta;
2526
+ } & A_TYPES__FeatureExtendDecoratorMeta;
2527
+ /**
2528
+ * Uses to define the extension that will be applied to the Concept
2529
+ */
2530
+ type A_TYPES__ConceptAbstraction = A_TYPES__FeatureExtendDecoratorMeta;
2531
+
2532
+ declare class A_Concept<_Imports extends A_Container[] = A_Container[]> {
2533
+ protected props: A_TYPES__Concept_Init<_Imports>;
2534
+ /**
2535
+ * Load the concept. This step runs before any other steps to ensure that all components are loaded.
2536
+ */
2537
+ static Load(
2538
+ /**
2539
+ * provide additional configuration for the abstraction extension to make it dependent on other factors
2540
+ */
2541
+ config?: Partial<A_TYPES__AbstractionDecoratorConfig>): ReturnType<typeof A_Abstraction_Extend>;
2542
+ /**
2543
+ * Publish the concept to ADAAS platform. (Or any other place defined in the concept)
2544
+ *
2545
+ * [!] To extend the logic just create a custom containers and override the default behavior.
2546
+ */
2547
+ static Publish(
2548
+ /**
2549
+ * provide additional configuration for the abstraction extension to make it dependent on other factors
2550
+ */
2551
+ config?: Partial<A_TYPES__AbstractionDecoratorConfig>): ReturnType<typeof A_Abstraction_Extend>;
2552
+ /**
2553
+ * Deploy the concept to the environment.
2554
+ */
2555
+ static Deploy(
2556
+ /**
2557
+ * provide additional configuration for the abstraction extension to make it dependent on other factors
2558
+ */
2559
+ config?: Partial<A_TYPES__AbstractionDecoratorConfig>): (target: A_Container | A_Component, propertyKey: string, descriptor: A_TYPES__AbstractionDecoratorDescriptor) => void;
2560
+ /**
2561
+ * Compiles the Concept in case there are some containers that require that.
2562
+ *
2563
+ * Can be used for static websites or any other concept that requires a build step.
2564
+ *
2565
+ */
2566
+ static Build(
2567
+ /**
2568
+ * provide additional configuration for the abstraction extension to make it dependent on other factors
2569
+ */
2570
+ config?: Partial<A_TYPES__AbstractionDecoratorConfig>): (target: A_Container | A_Component, propertyKey: string, descriptor: A_TYPES__AbstractionDecoratorDescriptor) => void;
2571
+ /**
2572
+ * Main execution of the concept.
2573
+ */
2574
+ static Run(
2575
+ /**
2576
+ * provide additional configuration for the abstraction extension to make it dependent on other factors
2577
+ */
2578
+ config?: Partial<A_TYPES__AbstractionDecoratorConfig>): (target: A_Container | A_Component, propertyKey: string, descriptor: A_TYPES__AbstractionDecoratorDescriptor) => void;
2579
+ /**
2580
+ * Start the concept. Uses for servers or any other background services.
2581
+ */
2582
+ static Start(
2583
+ /**
2584
+ * provide additional configuration for the abstraction extension to make it dependent on other factors
2585
+ */
2586
+ config?: Partial<A_TYPES__AbstractionDecoratorConfig>): (target: A_Container | A_Component, propertyKey: string, descriptor: A_TYPES__AbstractionDecoratorDescriptor) => void;
2587
+ /**
2588
+ * Stop the concept. Uses for servers or any other background services.
2589
+ */
2590
+ static Stop(
2591
+ /**
2592
+ * provide additional configuration for the abstraction extension to make it dependent on other factors
2593
+ */
2594
+ config?: Partial<A_TYPES__AbstractionDecoratorConfig>): (target: A_Container | A_Component, propertyKey: string, descriptor: A_TYPES__AbstractionDecoratorDescriptor) => void;
2595
+ /**
2596
+ * Name of the concept
2597
+ *
2598
+ * By default, the name of the Concept is 'a-concept'
2599
+ */
2600
+ private _name;
2601
+ /**
2602
+ * A list of internally defined containers that the concept uses.
2603
+ */
2604
+ protected _containers: A_Container[];
2605
+ /**
2606
+ * A-Concept is a placeholder for the concept of the any program.
2607
+ *
2608
+ * Concept - could be any Program regardless environment and it's goal.
2609
+ * It could be mobile, web or simple html page.
2610
+ * All depends on Containers and Components installed and provided in the Concept.
2611
+ *
2612
+ *
2613
+ * [!] Concept operates ONLY with all Components and Containers provided to achieve the goal.
2614
+ *
2615
+ *
2616
+ * @param props - Initialization properties for the Concept
2617
+ */
2618
+ constructor(props: A_TYPES__Concept_Init<_Imports>);
2619
+ /**
2620
+ * Name of the concept
2621
+ */
2622
+ get name(): string;
2623
+ /**
2624
+ * The primary Root scope of the concept.
2625
+ */
2626
+ get scope(): A_Scope<any, A_TYPES__Component_Constructor[], A_TYPES__Error_Constructor[], A_TYPES__Entity_Constructor[], A_Fragment<A_TYPES__Fragment_Serialized>[]>;
2627
+ /**
2628
+ * Register a class or value in the concept scope.
2629
+ */
2630
+ get register(): A_Scope['register'];
2631
+ /**
2632
+ * Resolve a class or value from the concept scope.
2633
+ */
2634
+ get resolve(): A_Scope['resolve'];
2635
+ /**
2636
+ * Load the concept.
2637
+ */
2638
+ load(scope?: A_Scope): Promise<void>;
2639
+ /**
2640
+ * Run the concept.
2641
+ */
2642
+ run(scope?: A_Scope): Promise<void>;
2643
+ /**
2644
+ * Start the concept.
2645
+ *
2646
+ * @param params
2647
+ */
2648
+ start(scope?: A_Scope): Promise<void>;
2649
+ /**
2650
+ * Stop the concept.
2651
+ *
2652
+ * @param params
2653
+ */
2654
+ stop(scope?: A_Scope): Promise<void>;
2655
+ /**
2656
+ * Build the concept.
2657
+ */
2658
+ build(scope?: A_Scope): Promise<void>;
2659
+ /**
2660
+ * Deploy the concept.
2661
+ */
2662
+ deploy(scope?: A_Scope): Promise<void>;
2663
+ /**
2664
+ * Publish the concept.
2665
+ */
2666
+ publish(scope?: A_Scope): Promise<void>;
2667
+ /**
2668
+ * Call the specific method of the concept or included modules.
2669
+ */
2670
+ call<K extends Record<_Imports[number]['name'], string>>(
2671
+ /**
2672
+ * Name of the method to call
2673
+ */
2674
+ method: K[keyof K],
2675
+ /**
2676
+ * Container in which the method is located
2677
+ */
2678
+ container: _Imports[number]): Promise<void>;
2679
+ }
2680
+
2681
+ declare class A_ConceptMeta extends A_Meta<any> {
2682
+ private containers;
2683
+ constructor(containers: Array<A_Container>);
2684
+ }
2685
+
2686
+ declare enum A_TYPES__ConceptAbstractions {
2687
+ /**
2688
+ * Run the concept.
2689
+ */
2690
+ Run = "run",
2691
+ /**
2692
+ * Build the concept.
2693
+ */
2694
+ Build = "build",
2695
+ /**
2696
+ * Publish the concept.
2697
+ */
2698
+ Publish = "publish",
2699
+ /**
2700
+ * Deploy the concept.
2701
+ */
2702
+ Deploy = "deploy",
2703
+ /**
2704
+ * Load the concept.
2705
+ */
2706
+ Load = "load",
2707
+ /**
2708
+ * Start the concept.
2709
+ */
2710
+ Start = "start",
2711
+ /**
2712
+ * Stop the concept.
2713
+ */
2714
+ Stop = "stop"
2715
+ }
2716
+ declare enum A_TYPES__ConceptMetaKey {
2717
+ LIFECYCLE = "a-component-extensions"
2718
+ }
2719
+
2720
+ declare enum A_TYPES__ContainerMetaKey {
2721
+ FEATURES = "a-container-features",
2722
+ INJECTIONS = "a-container-injections",
2723
+ ABSTRACTIONS = "a-container-abstractions",
2724
+ EXTENSIONS = "a-container-extensions"
2725
+ }
2726
+
2727
+ /**
2728
+ * Container constructor type
2729
+ * Uses the generic type T to specify the type of the container
2730
+ */
2731
+ type A_TYPES__Container_Constructor<T = A_Container> = A_TYPES__Ctor<T>;
2732
+ /**
2733
+ * Container initialization type
2734
+ */
2735
+ type A_TYPES__Container_Init = {
2736
+ /**
2737
+ * The extra name for the container (optional)
2738
+ */
2739
+ name?: string;
2740
+ } & A_TYPES__Scope_Init;
2741
+ /**
2742
+ * Container serialized type
2743
+ */
2744
+ type A_TYPES__Container_Serialized = {
2745
+ /**
2746
+ * The ASEID of the container
2747
+ */
2748
+ aseid: string;
2749
+ };
2750
+ /**
2751
+ * Meta information stored in each Container
2752
+ */
2753
+ type A_TYPES__ContainerMeta = {
2754
+ /**
2755
+ * Extensions applied to the component per handler
2756
+ */
2757
+ [A_TYPES__ContainerMetaKey.EXTENSIONS]: A_Meta<{
2758
+ /**
2759
+ * Where Key the regexp for what to apply the extension
2760
+ * A set of container names or a wildcard, or a regexp
2761
+ *
2762
+ *
2763
+ * Where value is the extension instructions
2764
+ */
2765
+ [Key: string]: A_TYPES__FeatureExtendDecoratorMeta[];
2766
+ }>;
2767
+ [A_TYPES__ContainerMetaKey.FEATURES]: A_Meta<{
2768
+ /**
2769
+ * Where Key is the name of the feature
2770
+ *
2771
+ * Where value is the list of features
2772
+ */
2773
+ [Key: string]: A_TYPES__FeatureDefineDecoratorMeta;
2774
+ }>;
2775
+ [A_TYPES__ContainerMetaKey.ABSTRACTIONS]: A_Meta<{
2776
+ /**
2777
+ * Where Key the regexp for what to apply the extension
2778
+ * A set of container names or a wildcard, or a regexp
2779
+ *
2780
+ *
2781
+ * Where value is the extension instructions
2782
+ */
2783
+ [Key: string]: A_TYPES__ConceptAbstraction[];
2784
+ }>;
2785
+ [A_TYPES__ContainerMetaKey.INJECTIONS]: A_Meta<{
2786
+ /**
2787
+ * Where Key is the name of the injection
2788
+ *
2789
+ * Where value is the list of injections
2790
+ */
2791
+ [Key: string]: A_TYPES__A_InjectDecorator_Meta;
2792
+ }>;
2793
+ };
2794
+ type A_TYPES__ContainerMetaExtension = A_TYPES__FeatureExtendDecoratorMeta;
2795
+
2796
+ declare class A_Container {
2797
+ /**
2798
+ * Configuration of the container that will be used to run it.
2799
+ */
2800
+ protected readonly config: Partial<A_TYPES__Container_Init>;
2801
+ /**
2802
+ * Name of the container
2803
+ */
2804
+ get name(): string;
2805
+ /**
2806
+ * Returns the scope where the container is registered
2807
+ */
2808
+ get scope(): A_Scope;
2809
+ /**
2810
+ * This class should combine Components to achieve the goal withing Concept
2811
+ *
2812
+ * Container is a direct container that should be "run" to make Concept work.
2813
+ * So because of that Container can be:
2814
+ * - HTTP Server
2815
+ * - BASH Script
2816
+ * - Database Connection
2817
+ * - Microservice
2818
+ * - etc.
2819
+ *
2820
+ * @param config - Configuration of the container that will be used to run it.
2821
+ */
2822
+ constructor(
2823
+ /**
2824
+ * Configuration of the container that will be used to run it.
2825
+ */
2826
+ config?: Partial<A_TYPES__Container_Init>);
2827
+ /**
2828
+ * Calls the feature with the given name in the given scope
2829
+ *
2830
+ * [!] Note: This method creates a new instance of the feature every time it is called
2831
+ *
2832
+ * @param feature - the name of the feature to call
2833
+ * @param scope - the scope in which to call the feature
2834
+ * @returns - void
2835
+ */
2836
+ call(
2837
+ /**
2838
+ * Name of the feature to call
2839
+ */
2840
+ feature: string,
2841
+ /**
2842
+ * scope in which the feature will be executed
2843
+ */
2844
+ scope?: A_Scope): Promise<void>;
2845
+ }
2846
+
2847
+ declare class A_ContainerMeta extends A_Meta<A_TYPES__ContainerMeta> {
2848
+ /**
2849
+ * Allows to get all the injections for a given handler
2850
+ *
2851
+ * @param handler
2852
+ * @returns
2853
+ */
2854
+ injections(handler: string): A_TYPES__A_InjectDecorator_Meta;
2855
+ /**
2856
+ * Returns all features defined in the Container
2857
+ *
2858
+ * @returns
2859
+ */
2860
+ features(): Array<A_TYPES__FeatureDefineDecoratorMeta>;
2861
+ /**
2862
+ * Returns a set of instructions to run proper methods in Container during A-Concept Stage
2863
+ *
2864
+ * @param stage
2865
+ * @returns
2866
+ */
2867
+ abstractions(abstraction: A_TYPES__ConceptAbstractions): A_TYPES__ConceptAbstractionMeta[];
2868
+ /**
2869
+ * Allows to get all the extensions for a given feature
2870
+ *
2871
+ * @param feature
2872
+ * @returns
2873
+ */
2874
+ extensions(feature: string): A_TYPES__ContainerMetaExtension[];
2875
+ }
2876
+
2877
+ /**
2878
+ * Scope constructor type
2879
+ * Uses the generic type T to specify the type of the Scope
2880
+ */
2881
+ type A_TYPES__Scope_Constructor<T = A_Scope> = A_TYPES__Ctor<T>;
2882
+ /**
2883
+ * Scope initialization type
2884
+ */
2885
+ type A_TYPES__Scope_Init<_MetaItems extends Record<string, any> = any, _ComponentType extends A_TYPES__Component_Constructor[] = A_TYPES__Component_Constructor[], _ErrorType extends A_TYPES__Error_Constructor[] = A_TYPES__Error_Constructor[], _EntityType extends A_TYPES__Entity_Constructor[] = A_TYPES__Entity_Constructor[], _FragmentType extends A_Fragment[] = A_Fragment[]> = {
2886
+ /**
2887
+ * Scope Name
2888
+ */
2889
+ name: string;
2890
+ /**
2891
+ * A list of Context Fragments available in the Scope
2892
+ */
2893
+ fragments: [..._FragmentType];
2894
+ /**
2895
+ * A set of Components available in the Scope
2896
+ */
2897
+ components: [..._ComponentType];
2898
+ /**
2899
+ * A set of Errors available in the Scope
2900
+ */
2901
+ errors: [..._ErrorType];
2902
+ /**
2903
+ * A set of Entities available in the Scope
2904
+ *
2905
+ */
2906
+ entities: [
2907
+ ..._EntityType,
2908
+ ...InstanceType<_EntityType[number]>[]
2909
+ ];
2910
+ meta: Partial<_MetaItems>;
2911
+ };
2912
+ /**
2913
+ * Scope configuration type
2914
+ */
2915
+ type A_TYPES__ScopeConfig = {
2916
+ /**
2917
+ * Allows to define a parent to take dependencies from in case of the current scope does not have the required component
2918
+ */
2919
+ parent: A_Scope;
2920
+ };
2921
+ /**
2922
+ * Scope serialized type
2923
+ */
2924
+ type A_TYPES__Scope_Serialized = {};
2925
+ /**
2926
+ * A list of constructors that can have a scope associated with them
2927
+ */
2928
+ type A_TYPES__ScopeLinkedConstructors = A_TYPES__Container_Constructor | A_TYPES__Feature_Constructor;
2929
+ /**
2930
+ * A list of components that can have a scope associated with them
2931
+ */
2932
+ type A_TYPES__ScopeLinkedComponents = A_Container | A_Feature | A_Entity;
2933
+ /**
2934
+ * A list of components that are dependent on a scope and do not have their own scope
2935
+ */
2936
+ type A_TYPES_ScopeDependentComponents = A_Component | A_Entity | A_Fragment | A_Error;
2937
+ /**
2938
+ * A list of components that are independent of a scope. They don't need a scope to be resolved
2939
+ * Those components haven't scope dependent features.
2940
+ */
2941
+ type A_TYPES_ScopeIndependentComponents = A_Error | A_Scope | A_Caller;
2942
+
2943
+ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentType extends A_TYPES__Component_Constructor[] = A_TYPES__Component_Constructor[], _ErrorType extends A_TYPES__Error_Constructor[] = A_TYPES__Error_Constructor[], _EntityType extends A_TYPES__Entity_Constructor[] = A_TYPES__Entity_Constructor[], _FragmentType extends A_Fragment[] = A_Fragment[]> {
2944
+ /**
2945
+ * Scope Name uses for identification and logging purposes
2946
+ */
2947
+ protected _name: string;
2948
+ /**
2949
+ * Parent scope reference, used for inheritance of components, fragments, entities and commands
2950
+ */
2951
+ protected _parent?: A_Scope;
2952
+ /**
2953
+ * Internal meta storage using A_Meta for type-safe key-value operations.
2954
+ * This stores all the scope's runtime data that can be accessed and modified
2955
+ * throughout the execution pipeline or within running containers.
2956
+ */
2957
+ protected _meta: A_Meta<_MetaItems>;
2958
+ /**
2959
+ * A set of allowed components, A set of constructors that are allowed in the scope
2960
+ *
2961
+ */
2962
+ protected _allowedComponents: Set<_ComponentType[number]>;
2963
+ /**
2964
+ * A set of allowed errors, A set of constructors that are allowed in the scope
2965
+ */
2966
+ protected _allowedErrors: Set<_ErrorType[number]>;
2967
+ /**
2968
+ * A set of allowed entities, A set of constructors that are allowed in the scope
2969
+ */
2970
+ protected _allowedEntities: Set<_EntityType[number]>;
2971
+ /**
2972
+ * A set of allowed fragments, A set of constructors that are allowed in the scope
2973
+ */
2974
+ protected _allowedFragments: Set<A_TYPES__Fragment_Constructor<_FragmentType[number]>>;
2975
+ /**
2976
+ * Storage for the components, should be strong as components are unique per scope
2977
+ */
2978
+ protected _components: Map<_ComponentType[number], InstanceType<_ComponentType[number]>>;
2979
+ /**
2980
+ * Storage for the errors, should be strong as errors are unique per code
2981
+ */
2982
+ protected _errors: Map<string, InstanceType<_ErrorType[number]>>;
2983
+ /**
2984
+ * Storage for the entities, should be strong as entities are unique per aseid
2985
+ */
2986
+ protected _entities: Map<string, InstanceType<_EntityType[number]>>;
2987
+ /**
2988
+ * Storage for the fragments, should be weak as fragments are singletons per scope
2989
+ */
2990
+ protected _fragments: Map<A_TYPES__Fragment_Constructor<_FragmentType[number]>, _FragmentType[number]>;
2991
+ /**
2992
+ * Storage for imported scopes
2993
+ */
2994
+ protected _imports: Set<A_Scope>;
2995
+ /**
2996
+ * Returns the name of the scope
2997
+ */
2998
+ get name(): string;
2999
+ /**
3000
+ * Returns the meta object of the scope
3001
+ */
3002
+ get meta(): A_Meta<_MetaItems, Record<string, any>>;
3003
+ /**
3004
+ * Returns a list of Constructors for A-Components that are available in the scope
3005
+ */
3006
+ get allowedComponents(): Set<_ComponentType[number]>;
3007
+ /**
3008
+ * Returns a list of Constructors for A-Entities that are available in the scope
3009
+ */
3010
+ get allowedEntities(): Set<_EntityType[number]>;
3011
+ /**
3012
+ * Returns a list of Constructors for A-Fragments that are available in the scope
3013
+ */
3014
+ get allowedFragments(): Set<A_TYPES__Fragment_Constructor<_FragmentType[number]>>;
3015
+ /**
3016
+ * Returns a list of Constructors for A-Errors that are available in the scope
3017
+ */
3018
+ get allowedErrors(): Set<_ErrorType[number]>;
3019
+ /**
3020
+ * Returns an Array of entities registered in the scope
3021
+ *
3022
+ * [!] One entity per aseid
3023
+ */
3024
+ get entities(): Array<InstanceType<_EntityType[number]>>;
3025
+ /**
3026
+ * Returns an Array of fragments registered in the scope
3027
+ *
3028
+ * [!] One fragment per scope
3029
+ */
3030
+ get fragments(): Array<_FragmentType[number]>;
3031
+ /**
3032
+ * Returns an Array of components registered in the scope
3033
+ *
3034
+ * [!] One component instance per scope
3035
+ */
3036
+ get components(): Array<InstanceType<_ComponentType[number]>>;
3037
+ /**
3038
+ * Returns an Array of errors registered in the scope
3039
+ *
3040
+ * [!] One error per code
3041
+ */
3042
+ get errors(): Array<InstanceType<_ErrorType[number]>>;
3043
+ /**
3044
+ * Returns an Array of imported scopes
3045
+ * [!] Imported scopes are scopes that have been imported into the current scope using the import() method
3046
+ */
3047
+ get imports(): Array<A_Scope>;
3048
+ /**
3049
+ * Returns the parent scope of the current scope
3050
+ *
3051
+ * @param setValue
3052
+ * @returns
3053
+ */
3054
+ get parent(): A_Scope | undefined;
3055
+ /**
3056
+ * A_Scope is a unique A-Concept Structure that allows to operate with A-Concept Primitives and Models in a specific context and with specific rules.
3057
+ * It refers to the visibility and accessibility of :
3058
+ * - variables,
3059
+ * - Components,
3060
+ * - Context Fragments
3061
+ * - Entities
3062
+ * - and objects in different parts of your code.
3063
+ * Scope determines where a particular piece of data (like a variable or function)
3064
+ * can be accessed, modified, or referenced, and it plays a crucial role in avoiding naming collisions and ensuring data integrity.
3065
+ *
3066
+ * [!] The scope behavior is similar to tree structure where each scope can have a parent scope and inherit its components, fragments, entities and errors
3067
+ *
3068
+ * @param params
3069
+ * @param config
3070
+ */
3071
+ constructor();
3072
+ constructor(
3073
+ /**
3074
+ * A set of constructors that are allowed in the scope
3075
+ */
3076
+ params: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>,
3077
+ /**
3078
+ * Configuration options for the scope
3079
+ */
3080
+ config?: Partial<A_TYPES__ScopeConfig>);
3081
+ /**
3082
+ * Generator to iterate through all parent scopes
3083
+ */
3084
+ parents(): Generator<A_Scope>;
3085
+ /**
3086
+ * This method is used to retrieve a parent scope at a specific level
3087
+ *
3088
+ * [!] Note that if the level is out of bounds, undefined is returned
3089
+ * [!!] Uses negative values for levels (e.g. -1 for immediate parent, -2 for grandparent, etc.)
3090
+ *
3091
+ * @param level
3092
+ * @returns
3093
+ */
3094
+ parentOffset<T extends A_Scope>(
3095
+ /**
3096
+ * Level of the parent scope to retrieve
3097
+ *
3098
+ * Examples:
3099
+ * - level 0 - this scope
3100
+ * - level -1 - parent
3101
+ * - level -2 - grandparent
3102
+ */
3103
+ layerOffset: number): T | undefined;
3104
+ /**
3105
+ * Determines which initializer method to use based on the type of the first parameter.
3106
+ *
3107
+ * @param param1
3108
+ * @returns
3109
+ */
3110
+ protected getInitializer(param1?: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>, param2?: Partial<A_TYPES__ScopeConfig>): (param1: any, param2: any) => void | (() => void);
3111
+ protected defaultInitialized(params?: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>, config?: Partial<A_TYPES__ScopeConfig>): void;
3112
+ /**
3113
+ * This method is used to initialize the components in the scope
3114
+ * To save memory components are initialized only when they are requested
3115
+ *
3116
+ * This method only registers the component in the scope in case they are not registered yet
3117
+ *
3118
+ * @param _components
3119
+ */
3120
+ protected initComponents(_components?: _ComponentType): void;
3121
+ /**
3122
+ * This method is used to initialize the errors in the scope
3123
+ *
3124
+ * This method only registers the errors in the scope in case they are not registered yet
3125
+ *
3126
+ * @param _errors
3127
+ */
3128
+ protected initErrors(_errors?: _ErrorType): void;
3129
+ /**
3130
+ * This method is used to initialize the entities in the scope
3131
+ *
3132
+ * This method only registers the entities in the scope in case they are not registered yet
3133
+ *
3134
+ * @param _entities
3135
+ */
3136
+ protected initEntities(_entities?: [
3137
+ ..._EntityType,
3138
+ ...InstanceType<_EntityType[number]>[]
3139
+ ]): void;
3140
+ /**
3141
+ * This method is used to initialize the fragments in the scope
3142
+ *
3143
+ * This method only registers the fragments in the scope in case they are not registered yet
3144
+ *
3145
+ * @param _fragments
3146
+ */
3147
+ protected initFragments(_fragments?: _FragmentType): void;
3148
+ /**
3149
+ * This method is used to initialize the meta in the scope
3150
+ *
3151
+ * This method only sets the meta values in the scope in case they are not set yet
3152
+ *
3153
+ * @param _meta
3154
+ */
3155
+ protected initMeta(_meta?: Partial<_MetaItems>): void;
3156
+ /**
3157
+ * This method is used to destroy the scope and all its registered components, fragments and entities
3158
+ *
3159
+ * [!] This method deregisters all components, fragments and entities from the A-Context
3160
+ * [!] This method also clears all internal registries and collections
3161
+ */
3162
+ destroy(): void;
3163
+ /**
3164
+ * Retrieves a value from the scope's meta.
3165
+ *
3166
+ * @param param - The key to retrieve
3167
+ * @returns The value associated with the key, or undefined if not found
3168
+ *
3169
+ * @example
3170
+ * ```typescript
3171
+ * const userId = scope.get('userId');
3172
+ * if (userId) {
3173
+ * console.log(`Current user: ${userId}`);
3174
+ * }
3175
+ * ```
3176
+ */
3177
+ get<K extends keyof _MetaItems>(param: K): _MetaItems[K] | undefined;
3178
+ /**
3179
+ * Stores a value in the scope's meta.
3180
+ *
3181
+ * @param param - The key to store the value under
3182
+ * @param value - The value to store
3183
+ *
3184
+ * @example
3185
+ * ```typescript
3186
+ * scope.set('userId', '12345');
3187
+ * scope.set('role', 'admin');
3188
+ * ```
3189
+ */
3190
+ set<K extends keyof _MetaItems>(param: K, value: _MetaItems[K]): void;
3191
+ /**
3192
+ * Returns the issuer of the scope, useful for debugging and tracking purposes
3193
+ *
3194
+ * Issuer can be:
3195
+ * - A Container that allocated the scope
3196
+ * - A Feature that allocated the scope
3197
+ *
3198
+ * [!] Note that the issuer is the direct allocator of the scope, so if a Container allocated a Feature that allocated the scope, the issuer will be the Feature
3199
+ *
3200
+ * @returns
3201
+ */
3202
+ issuer<T extends A_TYPES__ScopeLinkedComponents>(): T | undefined;
3203
+ /**
3204
+ * This method is used to inherit from a parent scope
3205
+ *
3206
+ * [!] This method checks for circular inheritance and throws an error if detected
3207
+ *
3208
+ * @param parent
3209
+ * @returns
3210
+ */
3211
+ inherit(parent: A_Scope): A_Scope;
3212
+ /**
3213
+ * This method allows to import other scopes, to make their dependencies available in the current scope
3214
+ *
3215
+ * [!] Import doesn't create a parent-child relationship between scopes, it just copies the dependencies from the imported scopes
3216
+ * [!] It doesn't change the entities ownership, so entities remain unique to their original scopes
3217
+ *
3218
+ * @param scopes
3219
+ * @returns
3220
+ */
3221
+ import(...scopes: A_Scope[]): A_Scope;
3222
+ /**
3223
+ * This method allows to deimport other scopes, to remove their dependencies from the current scope
3224
+ *
3225
+ *
3226
+ * @param scopes
3227
+ * @returns
3228
+ */
3229
+ deimport(...scopes: A_Scope[]): A_Scope;
3230
+ /**
3231
+ * This method is used to check if the component is available in the scope
3232
+ *
3233
+ * [!] Note that this method checks for the component in the current scope and all parent scopes
3234
+ *
3235
+ * @param component
3236
+ * @returns
3237
+ */
3238
+ has<T extends A_Component>(
3239
+ /**
3240
+ * Provide a component constructor to check if it's available in the scope
3241
+ */
3242
+ component: A_TYPES__Component_Constructor<T>): boolean;
3243
+ has<T extends A_Entity>(
3244
+ /**
3245
+ * Provide an entity constructor to check if it's available in the scope
3246
+ *
3247
+ * [!] Note that entities are unique per aseid, so this method checks if there's at least one entity of the provided type in the scope
3248
+ */
3249
+ entity: A_TYPES__Entity_Constructor<T>): boolean;
3250
+ has<T extends A_Fragment>(
3251
+ /**
3252
+ * Provide a fragment constructor to check if it's available in the scope
3253
+ */
3254
+ fragment: A_TYPES__Fragment_Constructor<T>): boolean;
3255
+ has<T extends A_Error>(
3256
+ /**
3257
+ * Provide an error constructor to check if it's available in the scope
3258
+ */
3259
+ error: A_TYPES__Error_Constructor<T>): boolean;
3260
+ has(
3261
+ /**
3262
+ * Provide a string to check if a component, entity or fragment with the provided name is available in the scope
3263
+ */
3264
+ constructor: string): boolean;
3265
+ has<T extends A_TYPES__A_DependencyInjectable>(ctor: A_TYPES__Ctor<T> | string): boolean;
3266
+ /**
3267
+ * This method is used to check if the component is available in the scope
3268
+ *
3269
+ * [!] Note that this method checks for the component ONLY in the current scope
3270
+ *
3271
+ * @param component
3272
+ * @returns
3273
+ */
3274
+ hasFlat<T extends A_Component>(
3275
+ /**
3276
+ * Provide a component constructor to check if it's available in the scope
3277
+ */
3278
+ component: A_TYPES__Component_Constructor<T>): boolean;
3279
+ hasFlat<T extends A_Entity>(
3280
+ /**
3281
+ * Provide an entity constructor to check if it's available in the scope
3282
+ *
3283
+ * [!] Note that entities are unique per aseid, so this method checks if there's at least one entity of the provided type in the scope
3284
+ */
3285
+ entity: A_TYPES__Entity_Constructor<T>): boolean;
3286
+ hasFlat<T extends A_Fragment>(
3287
+ /**
3288
+ * Provide a fragment constructor to check if it's available in the scope
3289
+ */
3290
+ fragment: A_TYPES__Fragment_Constructor<T>): boolean;
3291
+ hasFlat<T extends A_Error>(
3292
+ /**
3293
+ * Provide an error constructor to check if it's available in the scope
3294
+ */
3295
+ error: A_TYPES__Error_Constructor<T>): boolean;
3296
+ hasFlat(
3297
+ /**
3298
+ * Provide a string to check if a component, entity or fragment with the provided name is available in the scope
3299
+ */
3300
+ constructor: string): boolean;
3301
+ /**
3302
+ * Allows to resolve a specific dependency
3303
+ *
3304
+ * @param dependency
3305
+ * @returns
3306
+ */
3307
+ resolveDependency<T extends A_TYPES__A_DependencyInjectable>(dependency: A_Dependency<T>): T | Array<T> | undefined;
3308
+ /**
3309
+ * Allows to retrieve the constructor of the component or entity by its name
3310
+ *
3311
+ * [!] Notes:
3312
+ * - In case of search for A-Entity please ensure that provided string corresponds to the static entity property of the class. [!] By default it's the kebab-case of the class name
3313
+ * - In case of search for A_Component please ensure that provided string corresponds to the class name in PascalCase
3314
+ *
3315
+ * @param name
3316
+ * @returns
3317
+ */
3318
+ resolveConstructor<T extends A_Entity>(
3319
+ /**
3320
+ * Provide the entity name or static entity property to retrieve its constructor
3321
+ */
3322
+ name: string): A_TYPES__Entity_Constructor<T>;
3323
+ resolveConstructor<T extends A_Component>(
3324
+ /**
3325
+ * Provide the component name in PascalCase to retrieve its constructor
3326
+ */
3327
+ name: string): A_TYPES__Component_Constructor<T>;
3328
+ resolveConstructor<T extends A_Fragment>(
3329
+ /**
3330
+ * Provide the fragment name in PascalCase to retrieve its constructor
3331
+ */
3332
+ name: string): A_TYPES__Fragment_Constructor<T>;
3333
+ resolveConstructor<T extends A_TYPES__A_DependencyInjectable>(name: string): A_TYPES__Entity_Constructor<T> | A_TYPES__Component_Constructor<T> | A_TYPES__Fragment_Constructor<T> | undefined;
3334
+ /**
3335
+ * This method should resolve all instances of the components, or entities within the scope, by provided parent class
3336
+ * So in case of providing a base class it should return all instances that extends this base class
3337
+ *
3338
+ * [!] Applicable for the current scope ONLY, no parent scopes are checked
3339
+ *
3340
+ * @param component
3341
+ */
3342
+ resolveAll<T extends A_Component>(
3343
+ /**
3344
+ * Provide a component constructor to resolve its instance from the scope
3345
+ */
3346
+ component: A_TYPES__Component_Constructor<T>): Array<T>;
3347
+ resolveAll<T extends A_Fragment>(
3348
+ /**
3349
+ * Provide a fragment constructor to resolve its instance from the scope
3350
+ */
3351
+ fragment: A_TYPES__Fragment_Constructor<T>): Array<T>;
3352
+ resolveAll<T extends A_Entity>(
3353
+ /**
3354
+ * Provide an entity constructor to resolve its instance or an array of instances from the scope
3355
+ */
3356
+ entity: A_TYPES__Entity_Constructor<T>): Array<T>;
3357
+ resolveAll<T extends A_TYPES__A_DependencyInjectable>(
3358
+ /**
3359
+ * Provide a component, fragment or entity constructor to resolve its instance(s) from the scope
3360
+ */
3361
+ constructorName: string): Array<T>;
3362
+ resolveAll<T extends A_TYPES__A_DependencyInjectable>(
3363
+ /**
3364
+ * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope
3365
+ */
3366
+ ctor: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string): Array<T>;
3367
+ /**
3368
+ * This method should resolve all instances of the components, or entities within the scope, by provided parent class
3369
+ * So in case of providing a base class it should return all instances that extends this base class
3370
+ *
3371
+ * [!] Applicable for the current scope ONLY, no parent scopes are checked
3372
+ *
3373
+ * @param component
3374
+ */
3375
+ resolveFlatAll<T extends A_Component>(
3376
+ /**
3377
+ * Provide a component constructor to resolve its instance from the scope
3378
+ */
3379
+ component: A_TYPES__Component_Constructor<T>): Array<T>;
3380
+ resolveFlatAll<T extends A_Fragment>(
3381
+ /**
3382
+ * Provide a fragment constructor to resolve its instance from the scope
3383
+ */
3384
+ fragment: A_TYPES__Fragment_Constructor<T>): Array<T>;
3385
+ resolveFlatAll<T extends A_Entity>(
3386
+ /**
3387
+ * Provide an entity constructor to resolve its instance or an array of instances from the scope
3388
+ */
3389
+ entity: A_TYPES__Entity_Constructor<T>): Array<T>;
3390
+ resolveFlatAll<T extends A_TYPES__A_DependencyInjectable>(
3391
+ /**
3392
+ * Provide a component, fragment or entity constructor to resolve its instance(s) from the scope
3393
+ */
3394
+ constructorName: string): Array<T>;
3395
+ resolveFlatAll<T extends A_TYPES__A_DependencyInjectable>(
3396
+ /**
3397
+ * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope
3398
+ */
3399
+ ctor: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string): Array<T>;
3400
+ /**
3401
+ * This method allows to resolve/inject a component, fragment or entity from the scope
3402
+ * Depending on the provided parameters it can resolve:
3403
+ * - A single component/fragment/entity by its constructor or name
3404
+ * - An array of components/fragments/entities by providing an array of constructors
3405
+ * - An entity or an array of entities by providing the entity constructor and query instructions
3406
+ *
3407
+ * @param component
3408
+ * @returns
3409
+ */
3410
+ resolve<T extends A_TYPES__A_DependencyInjectable>(
3411
+ /**
3412
+ * Provide a component constructor to resolve its instance from the scope
3413
+ */
3414
+ component: A_TYPES__Ctor<T>): T | undefined;
3415
+ resolve<T extends A_TYPES__A_DependencyInjectable>(
3416
+ /**
3417
+ * Provide a target dependency to resolve its instance from the scope
3418
+ *
3419
+ * [!] In this case its possible to provide a custom resolution strategy via A_Dependency options
3420
+ */
3421
+ dependency: A_Dependency<T>): T | Array<T> | undefined;
3422
+ resolve<T extends A_TYPES__A_DependencyInjectable>(
3423
+ /**
3424
+ * Provide a component constructor to resolve its instance from the scope
3425
+ */
3426
+ component: string): T | Array<T> | undefined;
3427
+ /**
3428
+ * This method allows to resolve/inject a component, fragment or entity from the scope
3429
+ * Depending on the provided parameters it can resolve:
3430
+ * - A single component/fragment/entity by its constructor or name
3431
+ * - An array of components/fragments/entities by providing an array of constructors
3432
+ * - An entity or an array of entities by providing the entity constructor and query instructions
3433
+ *
3434
+ * @param component
3435
+ * @returns
3436
+ */
3437
+ resolveOnce<T extends A_Component>(
3438
+ /**
3439
+ * Provide a component constructor to resolve its instance from the scope
3440
+ */
3441
+ component: A_TYPES__Component_Constructor<T>): T | undefined;
3442
+ resolveOnce<T extends A_Fragment>(
3443
+ /**
3444
+ * Provide a fragment constructor to resolve its instance from the scope
3445
+ */
3446
+ fragment: A_TYPES__Fragment_Constructor<T>): T | undefined;
3447
+ resolveOnce<T extends A_Entity>(
3448
+ /**
3449
+ * Provide an entity constructor to resolve its instance or an array of instances from the scope
3450
+ */
3451
+ entity: A_TYPES__Entity_Constructor<T>): T | undefined;
3452
+ resolveOnce<T extends A_Scope>(
3453
+ /**
3454
+ * Uses only in case of resolving a single entity
3455
+ *
3456
+ * Provide an entity constructor to resolve its instance from the scope
3457
+ */
3458
+ scope: A_TYPES__Scope_Constructor<T>): T | undefined;
3459
+ resolveOnce<T extends A_Error>(
3460
+ /**
3461
+ * Uses only in case of resolving a single entity
3462
+ *
3463
+ * Provide an entity constructor to resolve its instance from the scope
3464
+ */
3465
+ error: A_TYPES__Error_Constructor<T>): T | undefined;
3466
+ resolveOnce<T extends A_TYPES__A_DependencyInjectable>(
3467
+ /**
3468
+ * Provide a component, fragment or entity constructor to resolve its instance(s) from the scope
3469
+ */
3470
+ constructorName: string): T | undefined;
3471
+ resolveOnce<T extends A_TYPES__A_DependencyInjectable>(
3472
+ /**
3473
+ * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope
3474
+ */
3475
+ ctor: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string): T | undefined;
3476
+ /**
3477
+ * This polymorphic method allows to resolve/inject a component, fragment or entity from the scope
3478
+ * Depending on the provided parameters it can resolve:
3479
+ * - A single component/fragment/entity by its constructor or name
3480
+ * - An array of components/fragments/entities by providing an array of constructors
3481
+ * - An entity or an array of entities by providing the entity constructor and query instructions
3482
+ *
3483
+ * [!] Applicable for the current scope ONLY, no parent scopes are checked
3484
+ *
3485
+ * @param component
3486
+ */
3487
+ resolveFlat<T extends A_Component>(
3488
+ /**
3489
+ * Provide a component constructor to resolve its instance from the scope
3490
+ */
3491
+ component: A_TYPES__Component_Constructor<T>): T | undefined;
3492
+ resolveFlat<T extends A_Fragment>(
3493
+ /**
3494
+ * Provide a fragment constructor to resolve its instance from the scope
3495
+ */
3496
+ fragment: A_TYPES__Fragment_Constructor<T>): T | undefined;
3497
+ resolveFlat<T extends A_Entity>(
3498
+ /**
3499
+ * Provide an entity constructor to resolve its instance or an array of instances from the scope
3500
+ */
3501
+ entity: A_TYPES__Entity_Constructor<T>): T | undefined;
3502
+ resolveFlat<T extends A_Scope>(
3503
+ /**
3504
+ * Uses only in case of resolving a single entity
3505
+ *
3506
+ * Provide an entity constructor to resolve its instance from the scope
3507
+ */
3508
+ scope: A_TYPES__Scope_Constructor<T>): T | undefined;
3509
+ resolveFlat<T extends A_Error>(
3510
+ /**
3511
+ * Uses only in case of resolving a single entity
3512
+ *
3513
+ * Provide an entity constructor to resolve its instance from the scope
3514
+ */
3515
+ error: A_TYPES__Error_Constructor<T>): T | undefined;
3516
+ resolveFlat<T extends A_TYPES__A_DependencyInjectable>(
3517
+ /**
3518
+ * Provide a component, fragment or entity constructor to resolve its instance(s) from the scope
3519
+ */
3520
+ constructorName: string): T | undefined;
3521
+ resolveFlat<T extends A_TYPES__A_DependencyInjectable>(
3522
+ /**
3523
+ * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope
3524
+ */
3525
+ ctor: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable>): T | undefined;
3526
+ /**
3527
+ * Resolves a component, fragment or entity from the scope without checking parent scopes
3528
+ *
3529
+ * @param component
3530
+ * @param instructions
3531
+ */
3532
+ resolveFlatOnce<T extends A_TYPES__A_DependencyInjectable>(component: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string): T | undefined;
3533
+ /**
3534
+ * This method is used internally to resolve a component, fragment or entity by its constructor name
3535
+ *
3536
+ * [!] Note that this method checks for the component, fragment or entity in the current scope and all parent scopes
3537
+ * [!!] Note: No parent scopes are checked
3538
+ *
3539
+ * @param name - name of the component, fragment or entity to resolve (constructor name for components and fragments, static entity property for entities, static code property for commands)
3540
+ * @returns
3541
+ */
3542
+ private resolveByName;
3543
+ /**
3544
+ * Resolves the issuer of the scope by provided constructor
3545
+ *
3546
+ * [!] Note that this method checks ONLY for the direct issuer of the scope
3547
+ * [!!] No parent scopes are checked
3548
+ *
3549
+ *
3550
+ * @param ctor
3551
+ * @returns
3552
+ */
3553
+ private resolveIssuer;
3554
+ /**
3555
+ * This method is used internally to resolve a single entity from the scope based on the provided instructions
3556
+ *
3557
+ * [!] Note that this method can return either a single entity or an array of entities depending on the instructions provided
3558
+ * [!!] Note: No parent scopes are checked
3559
+ *
3560
+ * @param entity
3561
+ * @param instructions
3562
+ * @returns
3563
+ */
3564
+ private resolveEntity;
3565
+ /**
3566
+ * This method is used internally to resolve a single error from the scope
3567
+ *
3568
+ * [!] Note that errors are singleton instances within the scope
3569
+ * [!!] No parent scopes are checked
3570
+ *
3571
+ * @param error
3572
+ * @returns
3573
+ */
3574
+ private resolveError;
3575
+ /**
3576
+ * This method is used internally to resolve a single fragment from the scope
3577
+ *
3578
+ * [!] Note that this method checks for the fragment in the current scope and all parent scopes
3579
+ *
3580
+ * @param fragment
3581
+ * @returns
3582
+ */
3583
+ private resolveFragment;
3584
+ /**
3585
+ * This method is used internally to resolve a single scope from the current scope
3586
+ *
3587
+ * @param scope
3588
+ * @returns
3589
+ */
3590
+ private resolveScope;
3591
+ /**
3592
+ * This method is used internally to resolve a single component from the scope
3593
+ *
3594
+ * [!!] Note: No parent scopes are checked
3595
+ *
3596
+ * @param component
3597
+ * @returns
3598
+ */
3599
+ private resolveComponent;
3600
+ /**
3601
+ * This method is used to register the component in the scope
3602
+ *
3603
+ * @param fragment
3604
+ */
3605
+ register<T extends A_Component>(
3606
+ /**
3607
+ * Provide a component constructor to register it in the scope
3608
+ */
3609
+ component: A_TYPES__Component_Constructor<T>): void;
3610
+ register<T extends A_Component>(
3611
+ /**
3612
+ * Provide a command instance to register it in the scope
3613
+ */
3614
+ component: T): void;
3615
+ register<T extends A_Error>(
3616
+ /**
3617
+ * Provide an error constructor to register it in the scope
3618
+ */
3619
+ error: A_TYPES__Error_Constructor<T>): void;
3620
+ register<T extends A_Error>(
3621
+ /**
3622
+ * Provide an error instance to register it in the scope
3623
+ */
3624
+ error: T): void;
3625
+ register<T extends A_Fragment>(
3626
+ /**
3627
+ * Provide a command instance to register it in the scope
3628
+ */
3629
+ fragment: A_TYPES__Fragment_Constructor<T>): void;
3630
+ register<T extends A_Fragment>(
3631
+ /**
3632
+ * Provide a fragment instance to register it in the scope
3633
+ */
3634
+ fragment: T): void;
3635
+ register<T extends A_Entity>(
3636
+ /**
3637
+ * Provide an entity constructor to register it in the scope
3638
+ */
3639
+ entity: A_TYPES__Entity_Constructor<T>): void;
3640
+ register<T extends A_Entity>(
3641
+ /**
3642
+ * Provide an entity instance to register it in the scope
3643
+ */
3644
+ entity: T): void;
3645
+ register<T extends A_TYPES__A_DependencyInjectable>(
3646
+ /**
3647
+ * Provide an entity instance to register it in the scope
3648
+ */
3649
+ entity: T): void;
3650
+ /**
3651
+ * This method is used to deregister the component from the scope
3652
+ *
3653
+ * @param fragment
3654
+ */
3655
+ deregister<T extends A_Component>(
3656
+ /**
3657
+ * Provide a component constructor to deregister it in the scope
3658
+ */
3659
+ component: A_TYPES__Component_Constructor<T>): void;
3660
+ deregister(
3661
+ /**
3662
+ * Provide a command instance to deregister it in the scope
3663
+ */
3664
+ component: A_Component): void;
3665
+ deregister<T extends A_Error>(
3666
+ /**
3667
+ * Provide an error constructor to deregister it in the scope
3668
+ */
3669
+ error: A_TYPES__Error_Constructor<T>): void;
3670
+ deregister(
3671
+ /**
3672
+ * Provide an error instance to deregister it in the scope
3673
+ */
3674
+ error: A_Error): void;
3675
+ deregister<T extends A_Fragment>(
3676
+ /**
3677
+ * Provide a command instance to deregister it in the scope
3678
+ */
3679
+ fragment: A_TYPES__Fragment_Constructor<T>): void;
3680
+ deregister(
3681
+ /**
3682
+ * Provide a fragment instance to deregister it in the scope
3683
+ */
3684
+ fragment: A_Fragment): void;
3685
+ deregister<T extends A_Entity>(
3686
+ /**
3687
+ * Provide an entity constructor to deregister it in the scope
3688
+ */
3689
+ entity: A_TYPES__Entity_Constructor<T>): void;
3690
+ deregister(
3691
+ /**
3692
+ * Provide an entity instance to deregister it in the scope
3693
+ */
3694
+ entity: A_Entity): void;
3695
+ /**
3696
+ * This method is useful when you want to serialize the scope to JSON
3697
+ *
3698
+ * [!] Note this is not a deep serialization, only the fragments are serialized
3699
+ * [!] Fragments are a storage for information which is relevant to the scope
3700
+ *
3701
+ * @returns
3702
+ */
3703
+ toJSON(): Record<string, any>;
3704
+ /**
3705
+ * Type guard to check if the constructor is of type A_Component and is allowed in the scope
3706
+ *
3707
+ * @param ctor
3708
+ * @returns
3709
+ */
3710
+ protected isAllowedComponent(ctor: unknown): ctor is _ComponentType[number];
3711
+ /**
3712
+ * Type guard to check if the constructor is of type A_Entity and is allowed in the scope
3713
+ *
3714
+ * @param ctor
3715
+ * @returns
3716
+ */
3717
+ protected isAllowedEntity(ctor: unknown): ctor is A_TYPES__Entity_Constructor<_EntityType[number]>;
3718
+ /**
3719
+ * Type guard to check if the constructor is of type A_Fragment and is allowed in the scope
3720
+ *
3721
+ * @param ctor
3722
+ * @returns
3723
+ */
3724
+ protected isAllowedFragment(ctor: unknown): ctor is A_TYPES__Fragment_Constructor<_FragmentType[number]>;
3725
+ /**
3726
+ * Type guard to check if the constructor is of type A_Error and is allowed in the scope
3727
+ *
3728
+ * @param ctor
3729
+ * @returns
3730
+ */
3731
+ protected isAllowedError(ctor: unknown): ctor is A_TYPES__Error_Constructor<_ErrorType[number]>;
3732
+ /**
3733
+ * This method is used to check if the scope is inherited from another scope
3734
+ *
3735
+ * @param scope
3736
+ * @returns
3737
+ */
3738
+ isInheritedFrom(scope: A_Scope): boolean;
3739
+ /**
3740
+ * Helper method to check circular inheritance
3741
+ * Should return a full sequence of inheritance for logging purposes
3742
+ *
3743
+ * @param scope
3744
+ * @returns
3745
+ */
3746
+ checkCircularInheritance(scope: A_Scope): Array<string> | false;
3747
+ /**
3748
+ * Helper method to print the inheritance chain of the scope
3749
+ */
3750
+ printInheritanceChain(): void;
3751
+ }
3
3752
 
4
- declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES: {
3753
+ declare class A_ScopeError extends A_Error {
3754
+ static readonly InitializationError = "A-Scope Initialization Error";
3755
+ static readonly ConstructorError = "Unable to construct A-Scope instance";
3756
+ static readonly ResolutionError = "A-Scope Resolution Error";
3757
+ static readonly RegistrationError = "A-Scope Registration Error";
3758
+ static readonly CircularInheritanceError = "A-Scope Circular Inheritance Error";
3759
+ static readonly CircularImportError = "A-Scope Circular Import Error";
3760
+ static readonly DeregistrationError = "A-Scope Deregistration Error";
3761
+ }
3762
+
3763
+ /**
3764
+ * A-Component is a primary "extendable" object in the system
3765
+ * A unique combination of Components creates completely new functionality
3766
+ *
3767
+ * The most important thing is that A-Component is STATELESS, it means that it doesn't store any state in itself
3768
+ *
3769
+ *
3770
+ * [!] Every A-Component is a singleton, so if you need to create multiple instances of the same logic - use A-Container
3771
+ * [!] So one scope can have only one instance of the same A-Component
3772
+ * [!] Every A-Component can be extended by features and extensions
3773
+ * [!] ONLY A-Component can have A-Feature extensions
3774
+ *
3775
+ */
3776
+ declare class A_Component {
5
3777
  /**
6
- * Name of the application
3778
+ * Calls the feature with the given name in the given scope
7
3779
  *
8
- * DEFAULT value is 'a-concept'
3780
+ * [!] Note: This method creates a new instance of the feature every time it is called
9
3781
  *
10
- * [!] Provided name will be used for all aseids in the application by default
3782
+ * @param feature - the name of the feature to call
3783
+ * @param scope - the scope in which to call the feature
3784
+ * @returns - void
11
3785
  */
12
- readonly A_CONCEPT_NAME: "A_CONCEPT_NAME";
3786
+ call(
13
3787
  /**
14
- * Root scope of the application
3788
+ * Name of the feature to call
3789
+ */
3790
+ feature: string,
3791
+ /**
3792
+ * Scope in which the feature will be executed
3793
+ */
3794
+ scope?: A_Scope): Promise<any> | void;
3795
+ }
3796
+
3797
+ declare enum A_TYPES__ComponentMetaKey {
3798
+ EXTENSIONS = "a-component-extensions",
3799
+ FEATURES = "a-component-features",
3800
+ INJECTIONS = "a-component-injections",
3801
+ ABSTRACTIONS = "a-component-abstractions"
3802
+ }
3803
+
3804
+ /**
3805
+ * Component constructor type
3806
+ * Uses the generic type T to specify the type of the component
3807
+ */
3808
+ type A_TYPES__Component_Constructor<T = A_Component> = A_TYPES__Ctor<T>;
3809
+ /**
3810
+ * Component initialization type
3811
+ */
3812
+ type A_TYPES__Component_Init = any;
3813
+ /**
3814
+ * Component serialized type
3815
+ */
3816
+ type A_TYPES__Component_Serialized = {
3817
+ /**
3818
+ * The ASEID of the component
3819
+ */
3820
+ aseid: string;
3821
+ };
3822
+ /**
3823
+ * Component meta type
3824
+ */
3825
+ type A_TYPES__ComponentMeta = {
3826
+ /**
3827
+ * Extensions applied to the component per handler
3828
+ */
3829
+ [A_TYPES__ComponentMetaKey.EXTENSIONS]: A_Meta<{
3830
+ /**
3831
+ * Where Key the regexp for what to apply the extension
3832
+ * A set of container names or a wildcard, or a regexp
3833
+ *
3834
+ *
3835
+ * Where value is the extension instructions
3836
+ */
3837
+ [Key: string]: A_TYPES__FeatureExtendDecoratorMeta[];
3838
+ }>;
3839
+ /**
3840
+ * Features defined on the component per handler
3841
+ */
3842
+ [A_TYPES__ComponentMetaKey.FEATURES]: A_Meta<{
3843
+ /**
3844
+ * Where Key is the name of the feature
3845
+ *
3846
+ * Where value is the list of features
3847
+ */
3848
+ [Key: string]: A_TYPES__FeatureDefineDecoratorMeta;
3849
+ }>;
3850
+ /**
3851
+ * Injections defined on the component per handler
3852
+ */
3853
+ [A_TYPES__ComponentMetaKey.INJECTIONS]: A_Meta<{
3854
+ /**
3855
+ * Where Key is the name of the injection
3856
+ *
3857
+ * Where value is the list of injections
3858
+ */
3859
+ [Key: string]: A_TYPES__A_InjectDecorator_Meta;
3860
+ }>;
3861
+ /**
3862
+ * Abstractions extended by the component per handler
3863
+ */
3864
+ [A_TYPES__ComponentMetaKey.ABSTRACTIONS]: A_Meta<{
3865
+ /**
3866
+ * Where Key is the name of the stage
3867
+ *
3868
+ * Where value is the list of injections
3869
+ */
3870
+ [Key: string]: A_TYPES__ConceptAbstraction[];
3871
+ }>;
3872
+ };
3873
+ type A_TYPES__ComponentMetaExtension = A_TYPES__FeatureExtendDecoratorMeta;
3874
+
3875
+ declare class A_ComponentMeta<T extends A_TYPES__ComponentMeta = A_TYPES__ComponentMeta> extends A_Meta<T> {
3876
+ /**
3877
+ * Allows to get all the injections for a given handler
15
3878
  *
16
- * DEFAULT value is 'root'
3879
+ * @param handler
3880
+ * @returns
3881
+ */
3882
+ injections(handler: string): A_TYPES__A_InjectDecorator_Meta;
3883
+ /**
3884
+ * Allows to get all the extensions for a given feature
17
3885
  *
18
- * [!] Provided name will be used for all aseids in the application by default
3886
+ * @param feature
3887
+ * @returns
19
3888
  */
20
- readonly A_CONCEPT_ROOT_SCOPE: "A_CONCEPT_ROOT_SCOPE";
3889
+ extensions(feature: string): A_TYPES__ComponentMetaExtension[];
21
3890
  /**
22
- * Environment of the application e.g. development, production, staging
3891
+ * Returns all features defined in the Component
3892
+ *
3893
+ * @returns
23
3894
  */
24
- readonly A_CONCEPT_ENVIRONMENT: "A_CONCEPT_ENVIRONMENT";
3895
+ features(): Array<A_TYPES__FeatureDefineDecoratorMeta>;
25
3896
  /**
26
- * Runtime environment of the application e.g. browser, node
3897
+ * Returns a set of instructions to run proper methods in Component during A-Concept Stage
3898
+ *
3899
+ * @param stage
3900
+ * @returns
27
3901
  */
28
- readonly A_CONCEPT_RUNTIME_ENVIRONMENT: "A_CONCEPT_RUNTIME_ENVIRONMENT";
3902
+ abstractions(abstraction: any): A_TYPES__ConceptAbstractionMeta[];
3903
+ }
3904
+
3905
+ /**
3906
+ * Abstraction constructor type
3907
+ * Uses the generic type T to specify the type of the abstraction
3908
+ */
3909
+ type A_TYPES__Abstraction_Constructor<T = A_Abstraction> = A_TYPES__Ctor<T>;
3910
+ /**
3911
+ * Abstraction initialization type
3912
+ */
3913
+ type A_TYPES__Abstraction_Init = {
29
3914
  /**
30
- * Root folder of the application
31
- * [!] Automatically set by A-Concept when the application starts
3915
+ * Name of the A-Abstraction
32
3916
  */
33
- readonly A_CONCEPT_ROOT_FOLDER: "A_CONCEPT_ROOT_FOLDER";
3917
+ name: A_TYPES__ConceptAbstractions;
34
3918
  /**
35
- * Allows to define a default error description for errors thrown without a description
3919
+ * Features that compose the A-Abstraction
36
3920
  */
37
- readonly A_ERROR_DEFAULT_DESCRIPTION: "A_ERROR_DEFAULT_DESCRIPTION";
3921
+ containers: Array<A_Container>;
38
3922
  };
39
- type A_TYPES__ConceptENVVariables = (typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES][];
40
- declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY: readonly ["A_CONCEPT_NAME", "A_CONCEPT_ROOT_SCOPE", "A_CONCEPT_ENVIRONMENT", "A_CONCEPT_RUNTIME_ENVIRONMENT", "A_CONCEPT_ROOT_FOLDER", "A_ERROR_DEFAULT_DESCRIPTION"];
3923
+ /**
3924
+ * Abstraction serialized type
3925
+ */
3926
+ type A_TYPES__Abstraction_Serialized = {
3927
+ /**
3928
+ * The ASEID of the abstraction
3929
+ */
3930
+ aseid: string;
3931
+ };
3932
+ /**
3933
+ * Components that can extend Abstractions
3934
+ */
3935
+ type A_TYPES__AbstractionAvailableComponents = A_Component | A_Container;
3936
+ type A_TYPES__AbstractionDecoratorDescriptor = TypedPropertyDescriptor<() => any> | TypedPropertyDescriptor<(...args: any[]) => any> | TypedPropertyDescriptor<(...args: any[]) => Promise<any>> | TypedPropertyDescriptor<() => Promise<any>>;
3937
+ type A_TYPES__AbstractionDecoratorConfig = A_TYPES__FeatureExtendDecoratorConfig;
3938
+
3939
+ /**
3940
+ * A-Abstraction Extend decorator allows to extends behavior of each concept abstraction execution.
3941
+ * In case some components or containers requires to extend the behavior of the abstraction like 'start', 'build' or 'deploy'
3942
+ * for example, this decorator allows to do so.
3943
+ *
3944
+ * @param name - abstraction name
3945
+ * @param config - configuration of the abstraction extension
3946
+ * @returns
3947
+ */
3948
+ declare function A_Abstraction_Extend(
3949
+ /**
3950
+ * Name of the Concept Abstraction to extend
3951
+ */
3952
+ name: A_TYPES__ConceptAbstractions,
3953
+ /**
3954
+ * Configuration of the Abstraction Extension
3955
+ *
3956
+ */
3957
+ config?: Partial<A_TYPES__AbstractionDecoratorConfig>): (target: A_Container | A_Component, propertyKey: string, descriptor: A_TYPES__AbstractionDecoratorDescriptor) => void;
3958
+
3959
+ declare class A_Abstraction {
3960
+ /**
3961
+ * The name of the Abstraction e.g. 'deploy', 'start', 'test', etc.
3962
+ */
3963
+ protected _name: A_TYPES__ConceptAbstractions;
3964
+ /**
3965
+ * List of features that are part of this Abstraction
3966
+ */
3967
+ protected _features: A_Feature[];
3968
+ /**
3969
+ * The Feature currently being processed
3970
+ */
3971
+ protected _current?: A_Feature;
3972
+ /**
3973
+ * Actual Index of the current Feature being processed
3974
+ */
3975
+ protected _index: number;
3976
+ /**
3977
+ * Allows to extends A-Abstraction with additional methods
3978
+ */
3979
+ static get Extend(): typeof A_Abstraction_Extend;
3980
+ /**
3981
+ * A-Abstraction is an object that is common for any application.
3982
+ * By providing components and creating abstraction extensions it's possible to create a unique behavior of the whole solution.
3983
+ *
3984
+ * Every application has basic abstractions like 'start', 'stop', 'deploy', 'test', etc.
3985
+ * They can be easily extended with additional logic from both containers and components.
3986
+ *
3987
+ *
3988
+ * @param params
3989
+ */
3990
+ constructor(
3991
+ /**
3992
+ * Parameters to define the A-Abstraction
3993
+ */
3994
+ params: A_TYPES__Abstraction_Init);
3995
+ /**
3996
+ * Returns the name of the Abstraction
3997
+ */
3998
+ get name(): string;
3999
+ /**
4000
+ * Returns the current Feature being processed
4001
+ */
4002
+ get feature(): A_Feature | undefined;
4003
+ /**
4004
+ * This method checks if the A-Feature is done
4005
+ *
4006
+ * @returns
4007
+ */
4008
+ get isDone(): boolean;
4009
+ [Symbol.iterator](): Iterator<A_Feature, any>;
4010
+ /**
4011
+ * This method moves the Abstraction processing to the next Feature in the list
4012
+ *
4013
+ * @param stage
4014
+ */
4015
+ next(stage: any): void;
4016
+ /**
4017
+ * Allows to process all stages of the Abstraction
4018
+ *
4019
+ * @returns
4020
+ */
4021
+ process(
4022
+ /**
4023
+ * Allows to override the scope in which the Abstraction will be processed
4024
+ *
4025
+ */
4026
+ scope?: A_Scope): Promise<void>;
4027
+ }
4028
+
4029
+ declare class A_AbstractionError extends A_Error {
4030
+ /**
4031
+ * This error code indicates that there was an issue extending the abstraction execution
4032
+ */
4033
+ static readonly AbstractionExtensionError = "Unable to extend abstraction execution";
4034
+ }
4035
+
4036
+ type A_TYPES__ContextEnvironment = 'server' | 'browser' | 'mobile' | 'desktop' | 'embedded' | 'unknown';
4037
+ type A_TYPES__FeatureExtendableMeta = A_ContainerMeta | A_ComponentMeta | A_EntityMeta;
41
4038
 
42
4039
  declare class A_Context {
43
4040
  /**
@@ -193,11 +4190,11 @@ declare class A_Context {
193
4190
  * Get meta for the specific container class by constructor.
194
4191
  */
195
4192
  container: A_TYPES__Container_Constructor): T;
196
- static meta<T extends A_ContainerMeta>(
4193
+ static meta<T extends A_ContainerMeta, S extends A_Container>(
197
4194
  /**
198
4195
  * Get meta for the specific container instance.
199
4196
  */
200
- container: A_Container): T;
4197
+ container: S): T;
201
4198
  static meta<T extends A_EntityMeta>(
202
4199
  /**
203
4200
  * Get meta for the specific entity class by constructor.
@@ -213,11 +4210,11 @@ declare class A_Context {
213
4210
  * Get meta for the specific component class by constructor.
214
4211
  */
215
4212
  component: A_TYPES__Component_Constructor): T;
216
- static meta<T extends A_ComponentMeta>(
4213
+ static meta<T extends A_ComponentMeta, S extends A_Component>(
217
4214
  /**
218
4215
  * Get meta for the specific component instance.
219
4216
  */
220
- component: A_Component): T;
4217
+ component: S): T;
221
4218
  static meta<T extends A_Meta>(
222
4219
  /**
223
4220
  * Get meta for the specific component class by constructor.
@@ -455,191 +4452,108 @@ declare class A_ContextError extends A_Error {
455
4452
  static InvalidDeregisterParameterError: string;
456
4453
  }
457
4454
 
458
- declare class A_ConceptMeta extends A_Meta<any> {
459
- private containers;
460
- constructor(containers: Array<A_Container>);
461
- }
462
-
463
- declare class A_EntityError extends A_Error {
4455
+ declare class A_CONCEPT_BASE_ENV {
464
4456
  /**
465
- * Error code for validation errors.
4457
+ * Name of the application
4458
+ *
4459
+ * DEFAULT value is 'a-concept'
4460
+ *
4461
+ * [!] Provided name will be used for all aseids in the application by default
466
4462
  */
467
- static readonly ValidationError = "A-Entity Validation Error";
4463
+ static get A_CONCEPT_NAME(): string;
4464
+ /**
4465
+ * Root scope of the application
4466
+ *
4467
+ * DEFAULT value is 'root'
4468
+ *
4469
+ * [!] Provided name will be used for all aseids in the application by default
4470
+ */
4471
+ static get A_CONCEPT_ROOT_SCOPE(): string;
4472
+ /**
4473
+ * Environment of the application e.g. development, production, staging
4474
+ */
4475
+ static get A_CONCEPT_ENVIRONMENT(): string;
4476
+ /**
4477
+ * Runtime environment of the application e.g. browser, node
4478
+ */
4479
+ static get A_CONCEPT_RUNTIME_ENVIRONMENT(): A_TYPES__ContextEnvironment;
4480
+ /**
4481
+ * Root folder of the application
4482
+ * [!] Automatically set by A-Concept when the application starts
4483
+ */
4484
+ static get A_CONCEPT_ROOT_FOLDER(): string;
4485
+ /**
4486
+ * Allows to define a default error description for errors thrown without a description
4487
+ */
4488
+ static get A_ERROR_DEFAULT_DESCRIPTION(): string;
4489
+ /**
4490
+ * Generic getter for environment variables. This allows to access environment variables dynamically by name. It will return undefined if the variable does not exist.
4491
+ *
4492
+ * @param name
4493
+ * @returns
4494
+ */
4495
+ static get(name: string): any;
4496
+ /**
4497
+ * Generic setter for environment variables. This allows to set environment variables dynamically by name.
4498
+ *
4499
+ * @param name
4500
+ * @param value
4501
+ */
4502
+ static set(name: string, value: string): void;
4503
+ /**
4504
+ * This method returns all the environment variables that are available in the application. It combines the variables from process.env and the default environment variables defined in A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.
4505
+ *
4506
+ * @returns
4507
+ */
4508
+ static getAll<T extends Record<string, any>>(): T;
4509
+ /**
4510
+ * This method returns all the keys of the environment variables that are available in the application. It combines the keys from process.env and the default environment variables defined in A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.
4511
+ *
4512
+ * @returns
4513
+ */
4514
+ static getAllKeys<T extends Array<string>>(): T;
468
4515
  }
469
4516
 
470
- declare class A_AbstractionError extends A_Error {
4517
+ declare class A_CONCEPT_ENV extends A_CONCEPT_BASE_ENV {
471
4518
  /**
472
- * This error code indicates that there was an issue extending the abstraction execution
4519
+ * Name of the application
4520
+ *
4521
+ * DEFAULT value is 'a-concept'
4522
+ *
4523
+ * [!] Provided name will be used for all aseids in the application by default
4524
+ */
4525
+ static get A_CONCEPT_NAME(): string;
4526
+ /**
4527
+ * Root scope of the application
4528
+ *
4529
+ * DEFAULT value is 'root'
4530
+ *
4531
+ * [!] Provided name will be used for all aseids in the application by default
4532
+ */
4533
+ static get A_CONCEPT_ROOT_SCOPE(): string;
4534
+ /**
4535
+ * Environment of the application e.g. development, production, staging
4536
+ */
4537
+ static get A_CONCEPT_ENVIRONMENT(): string;
4538
+ /**
4539
+ * Runtime environment of the application e.g. browser, node
4540
+ */
4541
+ static get A_CONCEPT_RUNTIME_ENVIRONMENT(): A_TYPES__ContextEnvironment;
4542
+ /**
4543
+ * Root folder of the application
4544
+ * [!] Automatically set by A-Concept when the application starts
473
4545
  */
474
- static readonly AbstractionExtensionError = "Unable to extend abstraction execution";
475
- }
476
-
477
- declare class A_CallerError extends A_Error {
4546
+ static get A_CONCEPT_ROOT_FOLDER(): string;
478
4547
  /**
479
- * This error code indicates that there was an issue initializing the A-Caller
4548
+ * Allows to define a default error description for errors thrown without a description
480
4549
  */
481
- static readonly CallerInitializationError = "Unable to initialize A-Caller";
482
- }
483
-
484
- type A_TYPES__CallerComponent = A_Container | A_Component | A_Entity;
485
- /**
486
- * Caller constructor type
487
- * Uses the generic type T to specify the type of the caller component
488
- */
489
- type A_TYPES__Caller_Constructor<T = A_Caller> = A_TYPES__Ctor<T>;
490
- /**
491
- * Caller initialization type
492
- */
493
- type A_TYPES__Caller_Init = {};
494
- /**
495
- * Caller serialized type
496
- */
497
- type A_TYPES__Caller_Serialized = {};
498
-
499
- declare const A_CONSTANTS__ERROR_CODES: {
500
- readonly UNEXPECTED_ERROR: "A-Error Unexpected Error";
501
- readonly VALIDATION_ERROR: "A-Error Validation Error";
502
- };
503
- declare const A_CONSTANTS__ERROR_DESCRIPTION = "If you see this error please let us know.";
504
-
505
- declare class ASEID_Error extends A_Error {
506
- static readonly ASEIDInitializationError = "ASEID Initialization Error";
507
- static readonly ASEIDValidationError = "ASEID Validation Error";
508
- }
509
-
510
- declare class A_ScopeError extends A_Error {
511
- static readonly InitializationError = "A-Scope Initialization Error";
512
- static readonly ConstructorError = "Unable to construct A-Scope instance";
513
- static readonly ResolutionError = "A-Scope Resolution Error";
514
- static readonly RegistrationError = "A-Scope Registration Error";
515
- static readonly CircularInheritanceError = "A-Scope Circular Inheritance Error";
516
- static readonly CircularImportError = "A-Scope Circular Import Error";
517
- static readonly DeregistrationError = "A-Scope Deregistration Error";
518
- }
519
-
520
- /**
521
- *
522
- * This decorator should allow to set a default meta type for the class, this helps to avoid
523
- * the need to create custom meta classes for each class.
524
- *
525
- * @returns
526
- */
527
- declare function A_MetaDecorator<T extends A_Meta>(constructor: A_TYPES__Ctor<T>): <TTarget extends A_TYPES__MetaLinkedComponentConstructors>(target: TTarget) => TTarget;
528
-
529
- declare class A_DependencyError extends A_Error {
530
- static readonly InvalidDependencyTarget = "Invalid Dependency Target";
531
- static readonly InvalidLoadTarget = "Invalid Load Target";
532
- static readonly InvalidLoadPath = "Invalid Load Path";
533
- static readonly InvalidDefaultTarget = "Invalid Default Target";
534
- static readonly ResolutionParametersError = "Dependency Resolution Parameters Error";
4550
+ static get A_ERROR_DEFAULT_DESCRIPTION(): string;
4551
+ static get(name: string): any;
4552
+ static set(name: string, value: string): void;
4553
+ static getAll<T extends Record<string, any>>(): T;
4554
+ static getAllKeys<T extends Array<string>>(): T;
535
4555
  }
536
4556
 
537
- declare class A_InjectError extends A_Error {
538
- static readonly InvalidInjectionTarget = "Invalid target for A-Inject decorator";
539
- static readonly MissingInjectionTarget = "Missing target for A-Inject decorator";
540
- }
541
-
542
- /**
543
- * A-Inject decorator
544
- *
545
- * This Decorator allows to inject dependencies into the module like
546
- * - Namespaces
547
- * - Other Concepts
548
- * - or maybe Components
549
- *
550
- * @param params - see overloads
551
- * @returns - decorator function
552
- */
553
- declare function A_Inject<T extends A_Component>(
554
- /**
555
- * Provide the Component constructor that will be associated with the injection.
556
- *
557
- * [!] It returns an Instance of the Component from current Scope or from Parent Scopes.
558
- */
559
- component: A_TYPES__Component_Constructor<T>,
560
- /**
561
- * Provide additional instructions on how to perform the injection
562
- *
563
- * [!] Default Pagination is 1 if it's necessary to get multiple Fragments please customize it in the instructions
564
- */
565
- config?: Omit<Partial<A_TYPES__A_DependencyResolutionStrategy<T>>, 'query' | 'pagination'>): A_TYPES__A_InjectDecoratorReturn;
566
- declare function A_Inject<T extends A_Fragment>(
567
- /**
568
- * Provide the Fragment constructor to inject the Fragment instance
569
- *
570
- * [!] It returns the Fragment instance from current Scope or from Parent Scopes.
571
- */
572
- fragment: A_TYPES__Fragment_Constructor<T>,
573
- /**
574
- * Provide additional instructions on how to perform the injection
575
- *
576
- * [!] Default Pagination is 1 if it's necessary to get multiple Fragments please customize it in the instructions
577
- */
578
- config?: Omit<Partial<A_TYPES__A_DependencyResolutionStrategy<T>>, 'query' | 'pagination'>): A_TYPES__A_InjectDecoratorReturn;
579
- declare function A_Inject<T extends A_Entity>(
580
- /**
581
- * Provide the Entity constructor to inject the Entity instance
582
- *
583
- * [!] Note: It returns the Entity instance from current Scope or from Parent Scopes.
584
- * [!] Note: If instance has more than one Entity of the same type It returns FIRST found Entity
585
- * [!] Note: Use 'config' to specify to inject specific one or even Array of Entities
586
- */
587
- entity: A_TYPES__Entity_Constructor<T>,
588
- /**
589
- * Provide additional instructions on how to perform the injection
590
- *
591
- * [!] Default Pagination is 1 if it's necessary to get multiple Entities please customize it in the instructions
592
- */
593
- config?: Partial<A_TYPES__A_DependencyResolutionStrategy<T>>): A_TYPES__A_InjectDecoratorReturn<T>;
594
- declare function A_Inject<T extends A_Component>(
595
- /**
596
- * Provide the name of Component constructor to inject the Component instance
597
- *
598
- * [!] You can use both customized one or original depending on your overriding strategy
599
- */
600
- ctor: string): A_TYPES__A_InjectDecoratorReturn;
601
- declare function A_Inject<T extends A_Caller>(
602
- /**
603
- * Provide the A_Caller constructor to inject the Caller instance
604
- *
605
- * [!] It returns initiator of the call, e.g. Container/Component/Command who called Feature
606
- */
607
- caller: A_TYPES__Caller_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
608
- declare function A_Inject<T extends A_Error>(
609
- /***
610
- * Provide the Error constructor that will be associated with the injection.
611
- *
612
- * [!] It returns an Instance of the Error what is executed.
613
- */
614
- error: A_TYPES__Error_Constructor<T>,
615
- /**
616
- * Provide additional instructions on how to perform the injection
617
- *
618
- * [!] Default Pagination is 1 if it's necessary to get multiple Fragments please customize it in the instructions
619
- */
620
- config?: Omit<Partial<A_TYPES__A_DependencyResolutionStrategy<T>>, 'query' | 'pagination'>): A_TYPES__A_InjectDecoratorReturn;
621
- declare function A_Inject<T extends A_Feature>(
622
- /**
623
- * Provide the Feature constructor that will be associated with the injection.
624
- *
625
- * [!] It returns an Instance of the Feature what is executed.
626
- */
627
- feature: A_TYPES__Feature_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
628
- declare function A_Inject<T extends A_Scope>(
629
- /***
630
- * Provide the Scope constructor that will be associated with the injection.
631
- *
632
- * [!] It returns an instance of the Scope where the Entity/Component/Container is defined.
633
- */
634
- scope: A_TYPES__Scope_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
635
- declare function A_Inject<T extends A_TYPES__A_DependencyInjectable>(
636
- /***
637
- * Provide the Scope constructor that will be associated with the injection.
638
- *
639
- * [!] It returns an instance of the Scope where the Entity/Component/Container is defined.
640
- */
641
- dependency: A_Dependency<T>): A_TYPES__A_InjectDecoratorReturn;
642
-
643
4557
  declare class A_CommonHelper {
644
4558
  /**
645
4559
  * A simple promise that resolves immediately.
@@ -739,10 +4653,6 @@ declare class A_FormatterHelper {
739
4653
  static toKebabCase(str: string): string;
740
4654
  }
741
4655
 
742
- type A_ID_TYPES__TimeId_Parts = {
743
- timestamp: Date;
744
- random: string;
745
- };
746
4656
  declare class A_IdentityHelper {
747
4657
  /**
748
4658
  * Generates a short, time-based unique ID.
@@ -777,10 +4687,6 @@ declare class A_IdentityHelper {
777
4687
  static hashString(input: string): string;
778
4688
  }
779
4689
 
780
- declare class A_StepManagerError extends A_Error {
781
- static readonly CircularDependencyError = "A-StepManager Circular Dependency Error";
782
- }
783
-
784
4690
  declare class A_TypeGuards {
785
4691
  /**
786
4692
  * Check if value is a string
@@ -944,7 +4850,7 @@ declare class A_TypeGuards {
944
4850
  * @param instance
945
4851
  * @returns
946
4852
  */
947
- static isErrorInstance(instance: any): instance is A_Error;
4853
+ static isErrorInstance(instance: any): boolean;
948
4854
  /**
949
4855
  * Type guard to check if the instance is of type A_ComponentMeta
950
4856
  *
@@ -966,7 +4872,9 @@ declare class A_TypeGuards {
966
4872
  * @returns
967
4873
  */
968
4874
  static isEntityMetaInstance(instance: any): instance is A_EntityMeta;
969
- static hasASEID(value: any): value is A_Entity | A_Error;
4875
+ static hasASEID(value: any): value is A_Entity | {
4876
+ aseid: any;
4877
+ };
970
4878
  static isConstructorAllowedForScopeAllocation(target: any): target is A_TYPES__ScopeLinkedConstructors;
971
4879
  static isInstanceAllowedForScopeAllocation(target: any): target is A_TYPES__ScopeLinkedComponents;
972
4880
  static isConstructorAvailableForAbstraction(target: any): target is A_TYPES__AbstractionAvailableComponents;
@@ -987,4 +4895,99 @@ declare class A_TypeGuards {
987
4895
  static isPromiseInstance<T>(value: any): value is Promise<T>;
988
4896
  }
989
4897
 
990
- export { ASEID_Error, A_AbstractionError, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_CONSTANTS__ERROR_CODES, A_CONSTANTS__ERROR_DESCRIPTION, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_ContextError, A_Dependency, A_DependencyError, A_Entity, A_EntityError, A_EntityMeta, A_Error, A_Feature, A_FormatterHelper, A_Fragment, type A_ID_TYPES__TimeId_Parts, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_MetaDecorator, A_Scope, A_ScopeError, A_StepManagerError, A_TYPES_ScopeDependentComponents, A_TYPES__A_DependencyInjectable, A_TYPES__A_DependencyResolutionStrategy, A_TYPES__A_InjectDecoratorReturn, A_TYPES__A_StageStep, A_TYPES__AbstractionAvailableComponents, type A_TYPES__CallerComponent, type A_TYPES__Caller_Constructor, type A_TYPES__Caller_Init, type A_TYPES__Caller_Serialized, A_TYPES__Component_Constructor, A_TYPES__ConceptAbstractions, type A_TYPES__ConceptENVVariables, A_TYPES__Container_Constructor, A_TYPES__ContextEnvironment, A_TYPES__Ctor, A_TYPES__DeepPartial, A_TYPES__Entity_Constructor, A_TYPES__Error_Constructor, A_TYPES__Error_Init, A_TYPES__Error_Serialized, A_TYPES__FeatureAvailableComponents, A_TYPES__FeatureExtendDecoratorTarget, A_TYPES__Feature_Constructor, A_TYPES__Fragment_Constructor, A_TYPES__InjectableTargets, A_TYPES__MetaLinkedComponentConstructors, A_TYPES__MetaLinkedComponents, A_TYPES__ScopeConfig, A_TYPES__ScopeLinkedComponents, A_TYPES__ScopeLinkedConstructors, A_TYPES__Scope_Constructor, A_TYPES__Scope_Init, A_TypeGuards };
4898
+ /**
4899
+ * Basic TypeGuards that don't create circular dependencies
4900
+ * These are used by A_Error and other core classes
4901
+ */
4902
+ declare class A_BasicTypeGuards {
4903
+ /**
4904
+ * Check if value is a string
4905
+ *
4906
+ * @param value
4907
+ * @returns
4908
+ */
4909
+ static isString(value: any): value is string;
4910
+ /**
4911
+ * Check if value is a number
4912
+ *
4913
+ * @param value
4914
+ * @returns
4915
+ */
4916
+ static isNumber(value: any): value is number;
4917
+ /**
4918
+ * Check if value is a boolean
4919
+ *
4920
+ * @param value
4921
+ * @returns
4922
+ */
4923
+ static isBoolean(value: any): value is boolean;
4924
+ /**
4925
+ * Check if value is an object
4926
+ *
4927
+ * @param value
4928
+ * @returns
4929
+ */
4930
+ static isObject<T = object>(value: any): value is T;
4931
+ /**
4932
+ * Check if value is an array
4933
+ *
4934
+ * @param value
4935
+ * @returns
4936
+ */
4937
+ static isArray(value: any): value is any[];
4938
+ /**
4939
+ * Allows to check if the provided param is of constructor type.
4940
+ *
4941
+ * @param param
4942
+ * @returns
4943
+ */
4944
+ static isErrorConstructorType<T = any>(param: any): param is T;
4945
+ static isErrorSerializedType<T = any>(param: any): param is T;
4946
+ /**
4947
+ * Check if scope is of type A_Scope instance
4948
+ *
4949
+ * @param scope
4950
+ * @returns
4951
+ */
4952
+ static isScopeInstance(scope: any): boolean;
4953
+ }
4954
+
4955
+ declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES: {
4956
+ /**
4957
+ * Name of the application
4958
+ *
4959
+ * DEFAULT value is 'a-concept'
4960
+ *
4961
+ * [!] Provided name will be used for all aseids in the application by default
4962
+ */
4963
+ readonly A_CONCEPT_NAME: "A_CONCEPT_NAME";
4964
+ /**
4965
+ * Root scope of the application
4966
+ *
4967
+ * DEFAULT value is 'root'
4968
+ *
4969
+ * [!] Provided name will be used for all aseids in the application by default
4970
+ */
4971
+ readonly A_CONCEPT_ROOT_SCOPE: "A_CONCEPT_ROOT_SCOPE";
4972
+ /**
4973
+ * Environment of the application e.g. development, production, staging
4974
+ */
4975
+ readonly A_CONCEPT_ENVIRONMENT: "A_CONCEPT_ENVIRONMENT";
4976
+ /**
4977
+ * Runtime environment of the application e.g. browser, node
4978
+ */
4979
+ readonly A_CONCEPT_RUNTIME_ENVIRONMENT: "A_CONCEPT_RUNTIME_ENVIRONMENT";
4980
+ /**
4981
+ * Root folder of the application
4982
+ * [!] Automatically set by A-Concept when the application starts
4983
+ */
4984
+ readonly A_CONCEPT_ROOT_FOLDER: "A_CONCEPT_ROOT_FOLDER";
4985
+ /**
4986
+ * Allows to define a default error description for errors thrown without a description
4987
+ */
4988
+ readonly A_ERROR_DEFAULT_DESCRIPTION: "A_ERROR_DEFAULT_DESCRIPTION";
4989
+ };
4990
+ type A_TYPES__ConceptENVVariables = (typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES][];
4991
+ declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY: readonly ["A_CONCEPT_NAME", "A_CONCEPT_ROOT_SCOPE", "A_CONCEPT_ENVIRONMENT", "A_CONCEPT_RUNTIME_ENVIRONMENT", "A_CONCEPT_ROOT_FOLDER", "A_ERROR_DEFAULT_DESCRIPTION"];
4992
+
4993
+ export { ASEID, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, A_BasicTypeGuards, A_CONCEPT_ENV, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_CONSTANTS__ERROR_CODES, A_CONSTANTS__ERROR_DESCRIPTION, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_Concept, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_ContextError, A_Dependency, A_DependencyError, A_Dependency_All, A_Dependency_Default, A_Dependency_Flat, A_Dependency_Load, A_Dependency_Parent, A_Dependency_Query, A_Dependency_Require, A_Entity, A_EntityError, A_EntityMeta, A_Error, A_Feature, A_FeatureError, A_Feature_Define, A_Feature_Extend, A_FormatterHelper, A_Fragment, type A_ID_TYPES__TimeId_Parts, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_MetaDecorator, A_Scope, A_ScopeError, A_Stage, A_StageError, A_StepManagerError, A_StepsManager, type A_TYPES_ScopeDependentComponents, type A_TYPES_ScopeIndependentComponents, type A_TYPES_StageExecutionBehavior, type A_TYPES__ASEID_Constructor, type A_TYPES__ASEID_ConstructorConfig, type A_TYPES__ASEID_JSON, type A_TYPES__A_DependencyConstructor, type A_TYPES__A_DependencyInjectable, type A_TYPES__A_DependencyResolutionStrategy, type A_TYPES__A_DependencyResolutionType, type A_TYPES__A_Dependency_AllDecoratorReturn, type A_TYPES__A_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_EntityInjectionPagination, type A_TYPES__A_Dependency_EntityInjectionQuery, type A_TYPES__A_Dependency_EntityResolutionConfig, type A_TYPES__A_Dependency_FlatDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_ParentDecoratorReturn, type A_TYPES__A_Dependency_QueryDecoratorReturn, type A_TYPES__A_Dependency_QueryTarget, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_Dependency_Serialized, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_Meta, type A_TYPES__A_StageStep, type A_TYPES__A_StageStepProcessingExtraParams, A_TYPES__A_Stage_Status, type A_TYPES__AbstractionAvailableComponents, type A_TYPES__AbstractionDecoratorConfig, type A_TYPES__AbstractionDecoratorDescriptor, type A_TYPES__Abstraction_Constructor, type A_TYPES__Abstraction_Init, type A_TYPES__Abstraction_Serialized, type A_TYPES__CallerComponent, type A_TYPES__Caller_Constructor, type A_TYPES__Caller_Init, type A_TYPES__Caller_Serialized, type A_TYPES__ComponentMeta, type A_TYPES__ComponentMetaExtension, A_TYPES__ComponentMetaKey, type A_TYPES__Component_Constructor, type A_TYPES__Component_Init, type A_TYPES__Component_Serialized, type A_TYPES__ConceptAbstraction, type A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptAbstractions, type A_TYPES__ConceptENVVariables, A_TYPES__ConceptMetaKey, type A_TYPES__Concept_Constructor, type A_TYPES__Concept_Init, type A_TYPES__Concept_Serialized, type A_TYPES__ContainerMeta, type A_TYPES__ContainerMetaExtension, A_TYPES__ContainerMetaKey, type A_TYPES__Container_Constructor, type A_TYPES__Container_Init, type A_TYPES__Container_Serialized, type A_TYPES__ContextEnvironment, type A_TYPES__Ctor, type A_TYPES__DeepPartial, type A_TYPES__Dictionary, A_TYPES__EntityFeatures, type A_TYPES__EntityMeta, A_TYPES__EntityMetaKey, type A_TYPES__Entity_Constructor, type A_TYPES__Entity_Init, type A_TYPES__Entity_Serialized, type A_TYPES__Error_Constructor, type A_TYPES__Error_Init, type A_TYPES__Error_Serialized, type A_TYPES__ExtractNested, type A_TYPES__ExtractProperties, type A_TYPES__FeatureAvailableComponents, type A_TYPES__FeatureAvailableConstructors, type A_TYPES__FeatureDefineDecoratorConfig, type A_TYPES__FeatureDefineDecoratorDescriptor, type A_TYPES__FeatureDefineDecoratorMeta, type A_TYPES__FeatureDefineDecoratorTarget, type A_TYPES__FeatureDefineDecoratorTemplateItem, type A_TYPES__FeatureError_Init, type A_TYPES__FeatureExtendDecoratorConfig, type A_TYPES__FeatureExtendDecoratorDescriptor, type A_TYPES__FeatureExtendDecoratorMeta, type A_TYPES__FeatureExtendDecoratorScopeConfig, type A_TYPES__FeatureExtendDecoratorScopeItem, type A_TYPES__FeatureExtendDecoratorTarget, type A_TYPES__FeatureExtendableMeta, A_TYPES__FeatureState, type A_TYPES__Feature_Constructor, type A_TYPES__Feature_Init, type A_TYPES__Feature_InitWithComponent, type A_TYPES__Feature_InitWithTemplate, type A_TYPES__Feature_Serialized, type A_TYPES__Fragment_Constructor, type A_TYPES__Fragment_Init, type A_TYPES__Fragment_Serialized, type A_TYPES__IEntity, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, type A_TYPES__Meta_Constructor, type A_TYPES__NonObjectPaths, type A_TYPES__ObjectKeyEnum, type A_TYPES__Paths, type A_TYPES__PathsToObject, type A_TYPES__Required, type A_TYPES__ScopeConfig, type A_TYPES__ScopeLinkedComponents, type A_TYPES__ScopeLinkedConstructors, type A_TYPES__Scope_Constructor, type A_TYPES__Scope_Init, type A_TYPES__Scope_Serialized, type A_TYPES__Stage_Serialized, type A_TYPES__UnionToIntersection, A_TypeGuards };