@adaas/a-concept 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/A-Context.types-BtR_HJ0j.d.mts +3828 -0
- package/dist/browser/chunk-5ABP3TCO.mjs +57 -0
- package/dist/browser/chunk-5ABP3TCO.mjs.map +1 -0
- package/dist/browser/env.constants-CgDhS6pf.d.mts +39 -0
- package/dist/browser/env.d.mts +48 -0
- package/dist/browser/env.mjs +27 -0
- package/dist/browser/env.mjs.map +1 -0
- package/dist/browser/index.d.mts +990 -0
- package/dist/browser/index.mjs +5531 -0
- package/dist/browser/index.mjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/node/A-Context.types-BtR_HJ0j.d.mts +3828 -0
- package/dist/node/A-Context.types-BtR_HJ0j.d.ts +3828 -0
- package/dist/node/chunk-HIVDZ2X6.mjs +63 -0
- package/dist/node/chunk-HIVDZ2X6.mjs.map +1 -0
- package/dist/node/chunk-LKQAYXTD.mjs +161 -0
- package/dist/node/chunk-LKQAYXTD.mjs.map +1 -0
- package/dist/node/env.constants-CgDhS6pf.d.mts +39 -0
- package/dist/node/env.constants-CgDhS6pf.d.ts +39 -0
- package/dist/node/env.d.mts +75 -0
- package/dist/node/env.d.ts +75 -0
- package/dist/node/env.js +151 -0
- package/dist/node/env.js.map +1 -0
- package/dist/node/env.mjs +3 -0
- package/dist/node/env.mjs.map +1 -0
- package/dist/node/index.d.mts +990 -0
- package/dist/node/index.d.ts +990 -0
- package/dist/node/index.js +5639 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +5428 -0
- package/dist/node/index.mjs.map +1 -0
- package/jest.config.ts +1 -0
- package/package.json +16 -10
- package/src/constants/env.constants.ts +5 -0
- package/src/env/env-browser.ts +24 -0
- package/src/env/env-node.ts +58 -0
- package/src/env/env.base.ts +56 -0
- package/src/env/global.browser.d.ts +8 -0
- package/src/env/index.browser.ts +1 -0
- package/src/env/index.node.ts +1 -0
- package/src/global/A-Context/A-Context.class.ts +6 -26
- package/src/global/A-Error/A_Error.class.ts +2 -2
- package/src/global/A-Scope/A-Scope.class.ts +55 -1
- package/tests/A-Scope.test.ts +105 -0
- package/tsconfig.json +3 -1
- package/tsup.config.ts +91 -28
|
@@ -0,0 +1,990 @@
|
|
|
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.mjs';
|
|
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.mjs';
|
|
3
|
+
|
|
4
|
+
declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES: {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the application
|
|
7
|
+
*
|
|
8
|
+
* DEFAULT value is 'a-concept'
|
|
9
|
+
*
|
|
10
|
+
* [!] Provided name will be used for all aseids in the application by default
|
|
11
|
+
*/
|
|
12
|
+
readonly A_CONCEPT_NAME: "A_CONCEPT_NAME";
|
|
13
|
+
/**
|
|
14
|
+
* Root scope of the application
|
|
15
|
+
*
|
|
16
|
+
* DEFAULT value is 'root'
|
|
17
|
+
*
|
|
18
|
+
* [!] Provided name will be used for all aseids in the application by default
|
|
19
|
+
*/
|
|
20
|
+
readonly A_CONCEPT_ROOT_SCOPE: "A_CONCEPT_ROOT_SCOPE";
|
|
21
|
+
/**
|
|
22
|
+
* Environment of the application e.g. development, production, staging
|
|
23
|
+
*/
|
|
24
|
+
readonly A_CONCEPT_ENVIRONMENT: "A_CONCEPT_ENVIRONMENT";
|
|
25
|
+
/**
|
|
26
|
+
* Runtime environment of the application e.g. browser, node
|
|
27
|
+
*/
|
|
28
|
+
readonly A_CONCEPT_RUNTIME_ENVIRONMENT: "A_CONCEPT_RUNTIME_ENVIRONMENT";
|
|
29
|
+
/**
|
|
30
|
+
* Root folder of the application
|
|
31
|
+
* [!] Automatically set by A-Concept when the application starts
|
|
32
|
+
*/
|
|
33
|
+
readonly A_CONCEPT_ROOT_FOLDER: "A_CONCEPT_ROOT_FOLDER";
|
|
34
|
+
/**
|
|
35
|
+
* Allows to define a default error description for errors thrown without a description
|
|
36
|
+
*/
|
|
37
|
+
readonly A_ERROR_DEFAULT_DESCRIPTION: "A_ERROR_DEFAULT_DESCRIPTION";
|
|
38
|
+
};
|
|
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"];
|
|
41
|
+
|
|
42
|
+
declare class A_Context {
|
|
43
|
+
/**
|
|
44
|
+
* Default name of the application from environment variable A_CONCEPT_NAME
|
|
45
|
+
*
|
|
46
|
+
* [!] If environment variable is not set, it will default to 'a-concept'
|
|
47
|
+
*/
|
|
48
|
+
static get concept(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Root scope of the application from environment variable A_CONCEPT_ROOT_SCOPE
|
|
51
|
+
*
|
|
52
|
+
* [!] If environment variable is not set, it will default to 'root'
|
|
53
|
+
*/
|
|
54
|
+
static get root(): A_Scope;
|
|
55
|
+
/**
|
|
56
|
+
* Environment the application is running in.
|
|
57
|
+
* Can be either 'server' or 'browser'.
|
|
58
|
+
* [!] Determined by environment variable A_CONCEPT_RUNTIME_ENVIRONMENT that comes from the build tool or is set manually in the environment.
|
|
59
|
+
*/
|
|
60
|
+
static get environment(): A_TYPES__ContextEnvironment;
|
|
61
|
+
/**
|
|
62
|
+
* Singleton instance of the Context
|
|
63
|
+
*/
|
|
64
|
+
private static _instance;
|
|
65
|
+
/**
|
|
66
|
+
* Root Scope of the Concept and Environment
|
|
67
|
+
*
|
|
68
|
+
* Root scope is the top-level scope that all other scopes inherit from.
|
|
69
|
+
* It stores global configurations and settings and ALL SHAREABLE RESOURCES.
|
|
70
|
+
*
|
|
71
|
+
* [!] Root scope is created automatically when the Context is initialized.
|
|
72
|
+
* [!] Root scope name can be configured using environment variable A_CONCEPT_ROOT_SCOPE
|
|
73
|
+
*/
|
|
74
|
+
private _root;
|
|
75
|
+
/**
|
|
76
|
+
* A registry that keeps track of scopes for all components (Containers, Features, Commands)
|
|
77
|
+
* Which can issue a scope allocation.
|
|
78
|
+
*/
|
|
79
|
+
protected _registry: WeakMap<A_TYPES__ScopeLinkedComponents, A_Scope>;
|
|
80
|
+
/**
|
|
81
|
+
* This is a registry that stores an issuer of each scope allocation.
|
|
82
|
+
* It helps to track which component (Container, Feature, Command) allocated a specific scope.
|
|
83
|
+
*/
|
|
84
|
+
protected _scopeIssuers: WeakMap<A_Scope, A_TYPES__ScopeLinkedComponents>;
|
|
85
|
+
/**
|
|
86
|
+
* Stores a context associated with a specific component that depends on a scope.
|
|
87
|
+
* uses for quick retrieval of the scope for the component.
|
|
88
|
+
*/
|
|
89
|
+
protected _scopeStorage: WeakMap<A_TYPES_ScopeDependentComponents, A_Scope>;
|
|
90
|
+
/**
|
|
91
|
+
* Stores meta information for different component types by their constructors.
|
|
92
|
+
* Meta provides to store extra information about the class behavior and configuration.
|
|
93
|
+
*/
|
|
94
|
+
protected _metaStorage: Map<A_TYPES__MetaLinkedComponentConstructors, A_Meta>;
|
|
95
|
+
protected _globals: Map<string, any>;
|
|
96
|
+
/**
|
|
97
|
+
* Private constructor to enforce singleton pattern.
|
|
98
|
+
*
|
|
99
|
+
* [!] This class should not be instantiated directly. Use A_Context.getInstance() instead.
|
|
100
|
+
*/
|
|
101
|
+
private constructor();
|
|
102
|
+
/**
|
|
103
|
+
* Get the instance of the Namespace Provider.
|
|
104
|
+
*
|
|
105
|
+
* If the instance does not exist, it will be created.
|
|
106
|
+
*
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
static getInstance(): A_Context;
|
|
110
|
+
/**
|
|
111
|
+
* Register method allows to register a component with a specific scope in the context.
|
|
112
|
+
*
|
|
113
|
+
* @param component - Component to register with a specific scope. Can be either A_Container, A_Feature.
|
|
114
|
+
* @param scope - Scope to associate the component with.
|
|
115
|
+
* @returns
|
|
116
|
+
*/
|
|
117
|
+
static register(
|
|
118
|
+
/**
|
|
119
|
+
* Provide the scope that will be associated with the component.
|
|
120
|
+
*/
|
|
121
|
+
scope: A_Scope,
|
|
122
|
+
/**
|
|
123
|
+
* Provide a component that needs to be registered with a specific scope.
|
|
124
|
+
*/
|
|
125
|
+
component: A_TYPES_ScopeDependentComponents): A_Scope;
|
|
126
|
+
/**
|
|
127
|
+
* Deregister method allows to deregister a component from the context.
|
|
128
|
+
*
|
|
129
|
+
* @param component - Component to deregister from the context.
|
|
130
|
+
*/
|
|
131
|
+
static deregister(
|
|
132
|
+
/**
|
|
133
|
+
* Provide a component that needs to be deregistered from the context.
|
|
134
|
+
*/
|
|
135
|
+
component: A_TYPES_ScopeDependentComponents): void;
|
|
136
|
+
/**
|
|
137
|
+
* Allocate method instantiates a new scope for the given component and registers it in the context.
|
|
138
|
+
* It bounds the component (Container, Feature) to a new scope that can be configured and used independently.
|
|
139
|
+
*
|
|
140
|
+
*
|
|
141
|
+
* @param component - Component to allocate the scope for. Can be either A_Container, A_Feature.
|
|
142
|
+
* @param importing - Configuration of the scope that will be created for the component.
|
|
143
|
+
*/
|
|
144
|
+
static allocate(
|
|
145
|
+
/**
|
|
146
|
+
* Provide a component that needs a scope allocation.
|
|
147
|
+
*/
|
|
148
|
+
component: A_TYPES__ScopeLinkedComponents): A_Scope;
|
|
149
|
+
static allocate(
|
|
150
|
+
/**
|
|
151
|
+
* Provide a component that needs a scope allocation.
|
|
152
|
+
*/
|
|
153
|
+
component: A_TYPES__ScopeLinkedComponents,
|
|
154
|
+
/**
|
|
155
|
+
* Provide the scope that will be used as a base for the new scope.
|
|
156
|
+
*/
|
|
157
|
+
importing: A_Scope): A_Scope;
|
|
158
|
+
static allocate(
|
|
159
|
+
/**
|
|
160
|
+
* Provide a component that needs a scope allocation.
|
|
161
|
+
*/
|
|
162
|
+
component: A_TYPES__ScopeLinkedComponents,
|
|
163
|
+
/**
|
|
164
|
+
* Provide configuration for the scope that will be created for the component.
|
|
165
|
+
*/
|
|
166
|
+
config: Partial<A_TYPES__Scope_Init & A_TYPES__ScopeConfig>): A_Scope;
|
|
167
|
+
/**
|
|
168
|
+
* Deallocate method removes the scope allocation for the given component from the context.
|
|
169
|
+
*
|
|
170
|
+
* @param component
|
|
171
|
+
* @returns
|
|
172
|
+
*/
|
|
173
|
+
static deallocate(
|
|
174
|
+
/**
|
|
175
|
+
* A Scope that needs to be deallocated.
|
|
176
|
+
*/
|
|
177
|
+
scope: A_Scope): any;
|
|
178
|
+
static deallocate(
|
|
179
|
+
/**
|
|
180
|
+
* Provide a component that needs to have its scope deallocated.
|
|
181
|
+
*/
|
|
182
|
+
component: A_TYPES__ScopeLinkedComponents): any;
|
|
183
|
+
/**
|
|
184
|
+
* Get or Create Meta for the specific class or instance.
|
|
185
|
+
* This method will return the existing meta if it exists, or create a new one if it doesn't.
|
|
186
|
+
*
|
|
187
|
+
* Meta object contains custom metadata based on the class type.
|
|
188
|
+
*
|
|
189
|
+
* @param container
|
|
190
|
+
*/
|
|
191
|
+
static meta<T extends A_ContainerMeta>(
|
|
192
|
+
/**
|
|
193
|
+
* Get meta for the specific container class by constructor.
|
|
194
|
+
*/
|
|
195
|
+
container: A_TYPES__Container_Constructor): T;
|
|
196
|
+
static meta<T extends A_ContainerMeta>(
|
|
197
|
+
/**
|
|
198
|
+
* Get meta for the specific container instance.
|
|
199
|
+
*/
|
|
200
|
+
container: A_Container): T;
|
|
201
|
+
static meta<T extends A_EntityMeta>(
|
|
202
|
+
/**
|
|
203
|
+
* Get meta for the specific entity class by constructor.
|
|
204
|
+
*/
|
|
205
|
+
entity: A_TYPES__Entity_Constructor): T;
|
|
206
|
+
static meta<T extends A_EntityMeta>(
|
|
207
|
+
/**
|
|
208
|
+
* Get meta for the specific entity instance.
|
|
209
|
+
*/
|
|
210
|
+
entity: A_Entity): T;
|
|
211
|
+
static meta<T extends A_ComponentMeta>(
|
|
212
|
+
/**
|
|
213
|
+
* Get meta for the specific component class by constructor.
|
|
214
|
+
*/
|
|
215
|
+
component: A_TYPES__Component_Constructor): T;
|
|
216
|
+
static meta<T extends A_ComponentMeta>(
|
|
217
|
+
/**
|
|
218
|
+
* Get meta for the specific component instance.
|
|
219
|
+
*/
|
|
220
|
+
component: A_Component): T;
|
|
221
|
+
static meta<T extends A_Meta>(
|
|
222
|
+
/**
|
|
223
|
+
* Get meta for the specific component class by constructor.
|
|
224
|
+
*/
|
|
225
|
+
fragment: A_TYPES__Fragment_Constructor): T;
|
|
226
|
+
static meta<T extends A_Meta>(
|
|
227
|
+
/**
|
|
228
|
+
* Get meta for the specific component instance.
|
|
229
|
+
*/
|
|
230
|
+
fragment: A_Fragment): T;
|
|
231
|
+
static meta<T extends A_ComponentMeta>(
|
|
232
|
+
/**
|
|
233
|
+
* Get meta for the specific component by its name.
|
|
234
|
+
*/
|
|
235
|
+
component: string): T;
|
|
236
|
+
static meta(
|
|
237
|
+
/**
|
|
238
|
+
* Get meta for the specific meta linked component (class or instance).
|
|
239
|
+
*/
|
|
240
|
+
target: A_TYPES__MetaLinkedComponentConstructors | A_TYPES__MetaLinkedComponents): A_ComponentMeta;
|
|
241
|
+
static meta<T extends A_Meta>(
|
|
242
|
+
/**
|
|
243
|
+
* Get meta for the specific class or instance
|
|
244
|
+
*/
|
|
245
|
+
constructor: A_TYPES__Ctor<any>): T;
|
|
246
|
+
static meta<T extends Record<string, any>>(
|
|
247
|
+
/**
|
|
248
|
+
* Get meta for the specific class or instance
|
|
249
|
+
*/
|
|
250
|
+
constructor: A_TYPES__Ctor<any>): A_Meta<T>;
|
|
251
|
+
/**
|
|
252
|
+
* Allows to set meta for the specific class or instance.
|
|
253
|
+
*
|
|
254
|
+
* @param param1
|
|
255
|
+
* @param meta
|
|
256
|
+
*/
|
|
257
|
+
static setMeta<T extends A_ContainerMeta, S extends A_Container>(param1: S, meta: T): any;
|
|
258
|
+
static setMeta<T extends A_EntityMeta, S extends A_Entity>(param1: S, meta: T): any;
|
|
259
|
+
static setMeta<T extends A_ComponentMeta, S extends A_Component>(param1: S, meta: T): any;
|
|
260
|
+
static setMeta<T extends A_Meta>(param1: new (...args: any[]) => any, meta: T): any;
|
|
261
|
+
/**
|
|
262
|
+
*
|
|
263
|
+
* This method allows to get the issuer of a specific scope.
|
|
264
|
+
*
|
|
265
|
+
* @param scope - Scope to get the issuer for.
|
|
266
|
+
* @returns - Component that issued the scope.
|
|
267
|
+
*/
|
|
268
|
+
static issuer(
|
|
269
|
+
/**
|
|
270
|
+
* Provide the scope to get its issuer.
|
|
271
|
+
*/
|
|
272
|
+
scope: A_Scope): A_TYPES__ScopeLinkedComponents | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* Get the scope of the specific class or instance.
|
|
275
|
+
*
|
|
276
|
+
* Every execution in Concept has its own scope.
|
|
277
|
+
*
|
|
278
|
+
* This method will return the scope of the specific class or instance.
|
|
279
|
+
*
|
|
280
|
+
* @param entity
|
|
281
|
+
*/
|
|
282
|
+
static scope<T extends A_Entity>(
|
|
283
|
+
/**
|
|
284
|
+
* Provide an entity to get its scope.
|
|
285
|
+
*/
|
|
286
|
+
entity: T): A_Scope;
|
|
287
|
+
static scope<T extends A_Component>(
|
|
288
|
+
/**
|
|
289
|
+
* Provide a component to get its scope.
|
|
290
|
+
*/
|
|
291
|
+
component: T): A_Scope;
|
|
292
|
+
static scope<T extends A_Container>(
|
|
293
|
+
/**
|
|
294
|
+
* Provide a container to get its scope.
|
|
295
|
+
*/
|
|
296
|
+
container: T): A_Scope;
|
|
297
|
+
static scope<T extends A_Feature>(
|
|
298
|
+
/**
|
|
299
|
+
* Provide a feature to get its scope.
|
|
300
|
+
*/
|
|
301
|
+
feature: T): A_Scope;
|
|
302
|
+
static scope<T extends A_Fragment>(
|
|
303
|
+
/**
|
|
304
|
+
* Provide a fragment to get its scope.
|
|
305
|
+
*/
|
|
306
|
+
fragment: T): A_Scope;
|
|
307
|
+
/**
|
|
308
|
+
* Returns a template of the feature that can be then used to create a new A-Feature Instance
|
|
309
|
+
*
|
|
310
|
+
* [!] Note: Steps/Stages included are fully dependent on the scope provided since it dictates which components are active and can provide extensions for the feature.
|
|
311
|
+
*
|
|
312
|
+
* @param name
|
|
313
|
+
*/
|
|
314
|
+
static featureTemplate(
|
|
315
|
+
/**
|
|
316
|
+
* Provide the name of the feature to get the template for. Regular expressions are also supported to match multiple features.
|
|
317
|
+
*/
|
|
318
|
+
name: string | RegExp,
|
|
319
|
+
/**
|
|
320
|
+
* Provide the component to get the feature template from.
|
|
321
|
+
*/
|
|
322
|
+
component: A_TYPES__FeatureAvailableComponents,
|
|
323
|
+
/**
|
|
324
|
+
* Provide the scope that dictates which components are active and can provide extensions for the feature.
|
|
325
|
+
*/
|
|
326
|
+
scope?: A_Scope): Array<A_TYPES__A_StageStep>;
|
|
327
|
+
/**
|
|
328
|
+
* Returns all extensions for the specific feature in the specific component within the provided scope.
|
|
329
|
+
* Scope dictates which components are active and can provide extensions for the feature.
|
|
330
|
+
*
|
|
331
|
+
* [!] This method only returns extensions, not the base feature definition.
|
|
332
|
+
*
|
|
333
|
+
* @param scope
|
|
334
|
+
* @returns
|
|
335
|
+
*/
|
|
336
|
+
static featureExtensions(
|
|
337
|
+
/**
|
|
338
|
+
* Provide the name of the feature to get the template for. Regular expressions are also supported to match multiple features.
|
|
339
|
+
*/
|
|
340
|
+
name: string | RegExp,
|
|
341
|
+
/**
|
|
342
|
+
* Provide the component to get the feature template from.
|
|
343
|
+
*/
|
|
344
|
+
component: A_TYPES__FeatureAvailableComponents,
|
|
345
|
+
/**
|
|
346
|
+
* Provide the scope that dictates which components are active and can provide extensions for the feature.
|
|
347
|
+
*/
|
|
348
|
+
scope: A_Scope): Array<A_TYPES__A_StageStep>;
|
|
349
|
+
/**
|
|
350
|
+
* method helps to filter steps in a way that only the most derived classes are kept.
|
|
351
|
+
*
|
|
352
|
+
* @param scope
|
|
353
|
+
* @param items
|
|
354
|
+
* @returns
|
|
355
|
+
*/
|
|
356
|
+
private filterToMostDerived;
|
|
357
|
+
/**
|
|
358
|
+
* This method returns the feature template definition without any extensions.
|
|
359
|
+
* It can be used to retrieve the base template for a feature before any modifications are applied.
|
|
360
|
+
*
|
|
361
|
+
* [!] This method does not consider extensions from other components.
|
|
362
|
+
*
|
|
363
|
+
* @param feature
|
|
364
|
+
* @param component
|
|
365
|
+
* @returns
|
|
366
|
+
*/
|
|
367
|
+
static featureDefinition(
|
|
368
|
+
/**
|
|
369
|
+
* Name of the feature to get the template for.
|
|
370
|
+
* Regular expressions are also supported to match multiple features.
|
|
371
|
+
*/
|
|
372
|
+
feature: string | RegExp,
|
|
373
|
+
/**
|
|
374
|
+
* Component to get the feature template from.
|
|
375
|
+
*/
|
|
376
|
+
component: A_TYPES__FeatureAvailableComponents): Array<A_TYPES__A_StageStep>;
|
|
377
|
+
/**
|
|
378
|
+
* Returns a definition of the abstraction that can be then used to create a new A-Feature Instance
|
|
379
|
+
*
|
|
380
|
+
* [!] Note: Steps/Stages included are fully dependent on the scope provided since it dictates which components are active and can provide extensions for the abstraction.
|
|
381
|
+
*
|
|
382
|
+
* @param abstraction
|
|
383
|
+
*/
|
|
384
|
+
static abstractionTemplate(
|
|
385
|
+
/**
|
|
386
|
+
* Provide the abstraction stage to get the definition for.
|
|
387
|
+
*/
|
|
388
|
+
abstraction: A_TYPES__ConceptAbstractions,
|
|
389
|
+
/**
|
|
390
|
+
* Provide the component to get the abstraction definition from.
|
|
391
|
+
*/
|
|
392
|
+
component: A_TYPES__FeatureAvailableComponents): Array<A_TYPES__A_StageStep>;
|
|
393
|
+
static abstractionExtensions(
|
|
394
|
+
/**
|
|
395
|
+
* Provide the abstraction name to get the definition for.
|
|
396
|
+
*/
|
|
397
|
+
abstraction: A_TYPES__ConceptAbstractions,
|
|
398
|
+
/**
|
|
399
|
+
* Provide the component to get the abstraction definition from.
|
|
400
|
+
*/
|
|
401
|
+
component: A_TYPES__FeatureAvailableComponents): Array<A_TYPES__A_StageStep>;
|
|
402
|
+
/**
|
|
403
|
+
* Resets the Context to its initial state.
|
|
404
|
+
*/
|
|
405
|
+
static reset(): void;
|
|
406
|
+
/**
|
|
407
|
+
* Type guard to check if the param is allowed for scope allocation.
|
|
408
|
+
*
|
|
409
|
+
* @param param
|
|
410
|
+
* @returns
|
|
411
|
+
*/
|
|
412
|
+
static isAllowedForScopeAllocation(param: any): param is A_TYPES__ScopeLinkedComponents;
|
|
413
|
+
/**
|
|
414
|
+
* Type guard to check if the param is allowed to be registered in the context.
|
|
415
|
+
*
|
|
416
|
+
* @param param
|
|
417
|
+
* @returns
|
|
418
|
+
*/
|
|
419
|
+
static isAllowedToBeRegistered(param: any): param is A_TYPES_ScopeDependentComponents;
|
|
420
|
+
/**
|
|
421
|
+
* Type guard to check if the param is allowed for meta storage.
|
|
422
|
+
*
|
|
423
|
+
* @param param
|
|
424
|
+
* @returns
|
|
425
|
+
*/
|
|
426
|
+
static isAllowedForMeta(param: any): param is A_TYPES__MetaLinkedComponents;
|
|
427
|
+
/**
|
|
428
|
+
* Type guard to check if the param is allowed for meta storage by constructor.
|
|
429
|
+
*
|
|
430
|
+
* @param param
|
|
431
|
+
* @returns
|
|
432
|
+
*/
|
|
433
|
+
static isAllowedForMetaConstructor(param: any): param is A_TYPES__MetaLinkedComponentConstructors;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
declare class A_ContextError extends A_Error {
|
|
437
|
+
static NotAllowedForScopeAllocationError: string;
|
|
438
|
+
static ComponentAlreadyHasScopeAllocatedError: string;
|
|
439
|
+
static InvalidMetaParameterError: string;
|
|
440
|
+
static InvalidScopeParameterError: string;
|
|
441
|
+
static ScopeNotFoundError: string;
|
|
442
|
+
static InvalidFeatureParameterError: string;
|
|
443
|
+
static InvalidFeatureDefinitionParameterError: string;
|
|
444
|
+
static InvalidFeatureTemplateParameterError: string;
|
|
445
|
+
static InvalidFeatureExtensionParameterError: string;
|
|
446
|
+
static InvalidAbstractionParameterError: string;
|
|
447
|
+
static InvalidAbstractionDefinitionParameterError: string;
|
|
448
|
+
static InvalidAbstractionTemplateParameterError: string;
|
|
449
|
+
static InvalidAbstractionExtensionParameterError: string;
|
|
450
|
+
static InvalidInjectionParameterError: string;
|
|
451
|
+
static InvalidExtensionParameterError: string;
|
|
452
|
+
static InvalidRegisterParameterError: string;
|
|
453
|
+
static InvalidComponentParameterError: string;
|
|
454
|
+
static ComponentNotRegisteredError: string;
|
|
455
|
+
static InvalidDeregisterParameterError: string;
|
|
456
|
+
}
|
|
457
|
+
|
|
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 {
|
|
464
|
+
/**
|
|
465
|
+
* Error code for validation errors.
|
|
466
|
+
*/
|
|
467
|
+
static readonly ValidationError = "A-Entity Validation Error";
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
declare class A_AbstractionError extends A_Error {
|
|
471
|
+
/**
|
|
472
|
+
* This error code indicates that there was an issue extending the abstraction execution
|
|
473
|
+
*/
|
|
474
|
+
static readonly AbstractionExtensionError = "Unable to extend abstraction execution";
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare class A_CallerError extends A_Error {
|
|
478
|
+
/**
|
|
479
|
+
* This error code indicates that there was an issue initializing the A-Caller
|
|
480
|
+
*/
|
|
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";
|
|
535
|
+
}
|
|
536
|
+
|
|
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
|
+
declare class A_CommonHelper {
|
|
644
|
+
/**
|
|
645
|
+
* A simple promise that resolves immediately.
|
|
646
|
+
* Can be used in async functions to create a resolved promise.
|
|
647
|
+
*/
|
|
648
|
+
static resolve(): Promise<void>;
|
|
649
|
+
/**
|
|
650
|
+
* Check if a class is inherited from another class
|
|
651
|
+
*
|
|
652
|
+
* @param childClass
|
|
653
|
+
* @param parentClass
|
|
654
|
+
* @returns
|
|
655
|
+
*/
|
|
656
|
+
static isInheritedFrom(childClass: any, parentClass: any): boolean;
|
|
657
|
+
/**
|
|
658
|
+
* Get all parent classes of a given class
|
|
659
|
+
*
|
|
660
|
+
* @param childClass
|
|
661
|
+
* @returns
|
|
662
|
+
*/
|
|
663
|
+
static getParentClasses(childClass: any): any[];
|
|
664
|
+
/**
|
|
665
|
+
* Get the class inheritance chain as an array of class names
|
|
666
|
+
*
|
|
667
|
+
* @param childClass
|
|
668
|
+
* @returns
|
|
669
|
+
*/
|
|
670
|
+
static getClassInheritanceChain(childClass: any): any[];
|
|
671
|
+
/**
|
|
672
|
+
* Get the parent class of a given class
|
|
673
|
+
*
|
|
674
|
+
* @param childClass
|
|
675
|
+
* @returns
|
|
676
|
+
*/
|
|
677
|
+
static getParentClass(childClass: any): any;
|
|
678
|
+
/**
|
|
679
|
+
* Omit properties from an object or array with nested objects
|
|
680
|
+
*
|
|
681
|
+
* @param input
|
|
682
|
+
* @param paths
|
|
683
|
+
* @returns
|
|
684
|
+
*/
|
|
685
|
+
static omitProperties<T, S extends string>(input: T, paths: string[]): Omit<T, S>;
|
|
686
|
+
static isObject(item: unknown): item is Record<string, any>;
|
|
687
|
+
static deepMerge<T = any>(target: any, source: any, visited?: Map<any, any>): T;
|
|
688
|
+
static deepClone<T>(target: T): T;
|
|
689
|
+
static deepCloneAndMerge<T>(target: A_TYPES__DeepPartial<T>, source: T): T;
|
|
690
|
+
/**
|
|
691
|
+
* Get a readable name for a component (string, class, function, React element, instance, etc.)
|
|
692
|
+
*
|
|
693
|
+
* Covers:
|
|
694
|
+
* - string tags ("div")
|
|
695
|
+
* - symbols (Symbol.for('xxx'))
|
|
696
|
+
* - functions and classes (with name or displayName)
|
|
697
|
+
* - React elements (object with `type`)
|
|
698
|
+
* - component instances (constructor.name)
|
|
699
|
+
* - objects with custom toString returning meaningful info
|
|
700
|
+
*
|
|
701
|
+
* Falls back to sensible defaults ("Unknown" / "Anonymous").
|
|
702
|
+
*/
|
|
703
|
+
static getComponentName(component: any): string;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* A_FormatterHelper
|
|
708
|
+
*
|
|
709
|
+
* Helper class for formatting strings into different cases.
|
|
710
|
+
*/
|
|
711
|
+
declare class A_FormatterHelper {
|
|
712
|
+
/**
|
|
713
|
+
* Convert string to UPPER_SNAKE_CASE
|
|
714
|
+
*
|
|
715
|
+
* @param str
|
|
716
|
+
* @returns
|
|
717
|
+
*/
|
|
718
|
+
static toUpperSnakeCase(str: string): string;
|
|
719
|
+
/**
|
|
720
|
+
* Convert string to camelCase
|
|
721
|
+
*
|
|
722
|
+
* @param str
|
|
723
|
+
* @returns
|
|
724
|
+
*/
|
|
725
|
+
static toCamelCase(str: string): string;
|
|
726
|
+
/**
|
|
727
|
+
* Convert string to PascalCase
|
|
728
|
+
*
|
|
729
|
+
* @param str
|
|
730
|
+
* @returns
|
|
731
|
+
*/
|
|
732
|
+
static toPascalCase(str: string): string;
|
|
733
|
+
/**
|
|
734
|
+
* Convert string to kebab-case
|
|
735
|
+
*
|
|
736
|
+
* @param str
|
|
737
|
+
* @returns
|
|
738
|
+
*/
|
|
739
|
+
static toKebabCase(str: string): string;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
type A_ID_TYPES__TimeId_Parts = {
|
|
743
|
+
timestamp: Date;
|
|
744
|
+
random: string;
|
|
745
|
+
};
|
|
746
|
+
declare class A_IdentityHelper {
|
|
747
|
+
/**
|
|
748
|
+
* Generates a short, time-based unique ID.
|
|
749
|
+
* Encodes current time (ms since epoch) and random bits in base36.
|
|
750
|
+
* Example: "mb4f1g-7f9a1c"
|
|
751
|
+
*/
|
|
752
|
+
static generateTimeId(parts?: A_ID_TYPES__TimeId_Parts): string;
|
|
753
|
+
/**
|
|
754
|
+
* Parses a short ID back into its parts.
|
|
755
|
+
* Returns an object with the original timestamp (as Date) and random string.
|
|
756
|
+
*/
|
|
757
|
+
static parseTimeId(id: string): A_ID_TYPES__TimeId_Parts;
|
|
758
|
+
/**
|
|
759
|
+
* Format a number with leading zeros to a fixed length
|
|
760
|
+
*
|
|
761
|
+
* @param number
|
|
762
|
+
* @param maxZeros
|
|
763
|
+
* @returns
|
|
764
|
+
*/
|
|
765
|
+
static formatWithLeadingZeros(number: any, maxZeros?: number): string;
|
|
766
|
+
/**
|
|
767
|
+
* Remove leading zeros from a formatted number
|
|
768
|
+
*/
|
|
769
|
+
static removeLeadingZeros(formattedNumber: any): string;
|
|
770
|
+
/**
|
|
771
|
+
* Generates a simple hash string from the input string.
|
|
772
|
+
*
|
|
773
|
+
*
|
|
774
|
+
* @param input
|
|
775
|
+
* @returns
|
|
776
|
+
*/
|
|
777
|
+
static hashString(input: string): string;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
declare class A_StepManagerError extends A_Error {
|
|
781
|
+
static readonly CircularDependencyError = "A-StepManager Circular Dependency Error";
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
declare class A_TypeGuards {
|
|
785
|
+
/**
|
|
786
|
+
* Check if value is a string
|
|
787
|
+
*
|
|
788
|
+
* @param value
|
|
789
|
+
* @returns
|
|
790
|
+
*/
|
|
791
|
+
static isString(value: any): value is string;
|
|
792
|
+
/**
|
|
793
|
+
* Check if value is a number
|
|
794
|
+
*
|
|
795
|
+
* @param value
|
|
796
|
+
* @returns
|
|
797
|
+
*/
|
|
798
|
+
static isNumber(value: any): value is number;
|
|
799
|
+
/**
|
|
800
|
+
* Check if value is a boolean
|
|
801
|
+
*
|
|
802
|
+
* @param value
|
|
803
|
+
* @returns
|
|
804
|
+
*/
|
|
805
|
+
static isBoolean(value: any): value is boolean;
|
|
806
|
+
/**
|
|
807
|
+
* Check if value is an array
|
|
808
|
+
*
|
|
809
|
+
* @param value
|
|
810
|
+
* @returns
|
|
811
|
+
*/
|
|
812
|
+
static isArray(value: any): value is Array<any>;
|
|
813
|
+
/**
|
|
814
|
+
* Check if value is an object
|
|
815
|
+
*
|
|
816
|
+
* @param value
|
|
817
|
+
* @returns
|
|
818
|
+
*/
|
|
819
|
+
static isObject<T extends Object = Object>(value: any): value is T;
|
|
820
|
+
/**
|
|
821
|
+
* Check if value is a function
|
|
822
|
+
*
|
|
823
|
+
* @param value
|
|
824
|
+
* @returns
|
|
825
|
+
*/
|
|
826
|
+
static isFunction(value: any): value is Function;
|
|
827
|
+
static isUndefined(value: any): value is undefined;
|
|
828
|
+
static isRegExp(value: any): value is RegExp;
|
|
829
|
+
/**
|
|
830
|
+
* Type guard to check if the constructor is of type A_Container
|
|
831
|
+
*
|
|
832
|
+
* @param ctor
|
|
833
|
+
* @returns
|
|
834
|
+
*/
|
|
835
|
+
static isContainerConstructor(ctor: any): ctor is A_TYPES__Container_Constructor;
|
|
836
|
+
/**
|
|
837
|
+
* Type guard to check if the constructor is of type A_Component
|
|
838
|
+
*
|
|
839
|
+
* @param ctor
|
|
840
|
+
* @returns
|
|
841
|
+
*/
|
|
842
|
+
static isComponentConstructor(ctor: any): ctor is A_TYPES__Component_Constructor;
|
|
843
|
+
/**
|
|
844
|
+
* Type guard to check if the constructor is of type A_Fragment
|
|
845
|
+
*
|
|
846
|
+
* @param ctor
|
|
847
|
+
* @returns
|
|
848
|
+
*/
|
|
849
|
+
static isFragmentConstructor(ctor: any): ctor is A_TYPES__Fragment_Constructor;
|
|
850
|
+
/**
|
|
851
|
+
* Type guard to check if the constructor is of type A_Entity
|
|
852
|
+
*
|
|
853
|
+
* @param ctor
|
|
854
|
+
* @returns
|
|
855
|
+
*/
|
|
856
|
+
static isEntityConstructor(ctor: any): ctor is A_TYPES__Entity_Constructor;
|
|
857
|
+
/**
|
|
858
|
+
* Type guard to check if the constructor is of type A_Scope
|
|
859
|
+
*
|
|
860
|
+
* @param ctor
|
|
861
|
+
* @returns
|
|
862
|
+
*/
|
|
863
|
+
static isScopeConstructor(ctor: any): ctor is A_TYPES__Scope_Constructor;
|
|
864
|
+
/**
|
|
865
|
+
* Type guard to check if the constructor is of type A_Scope
|
|
866
|
+
*
|
|
867
|
+
* @param ctor
|
|
868
|
+
* @returns
|
|
869
|
+
*/
|
|
870
|
+
static isErrorConstructor(ctor: any): ctor is A_TYPES__Error_Constructor;
|
|
871
|
+
/**
|
|
872
|
+
* Type guard to check if the constructor is of type A_Feature
|
|
873
|
+
*
|
|
874
|
+
* @param ctor
|
|
875
|
+
* @returns
|
|
876
|
+
*/
|
|
877
|
+
static isFeatureConstructor(ctor: any): ctor is A_TYPES__Feature_Constructor;
|
|
878
|
+
/**
|
|
879
|
+
* Type guard to check if the constructor is of type A_Caller
|
|
880
|
+
*
|
|
881
|
+
* @param ctor
|
|
882
|
+
* @returns
|
|
883
|
+
*/
|
|
884
|
+
static isCallerConstructor(ctor: any): ctor is A_TYPES__Caller_Constructor;
|
|
885
|
+
/**
|
|
886
|
+
* Type guard to check if the constructor is of type A_Dependency
|
|
887
|
+
*
|
|
888
|
+
* @param ctor
|
|
889
|
+
* @returns
|
|
890
|
+
*/
|
|
891
|
+
static isDependencyConstructor<T extends A_TYPES__A_DependencyInjectable>(ctor: any): ctor is A_Dependency<T>;
|
|
892
|
+
/**
|
|
893
|
+
* Type guard to check if the instance is of type A_Dependency
|
|
894
|
+
*
|
|
895
|
+
* @param instance
|
|
896
|
+
* @returns
|
|
897
|
+
*/
|
|
898
|
+
static isDependencyInstance<T extends A_TYPES__A_DependencyInjectable>(instance: any): instance is A_Dependency<T>;
|
|
899
|
+
/**
|
|
900
|
+
* Type guard to check if the instance is of type A_Container
|
|
901
|
+
*
|
|
902
|
+
* @param instance
|
|
903
|
+
* @returns
|
|
904
|
+
*/
|
|
905
|
+
static isContainerInstance(instance: any): instance is A_Container;
|
|
906
|
+
/**
|
|
907
|
+
* Type guard to check if the instance is of type A_Component
|
|
908
|
+
*
|
|
909
|
+
* @param instance
|
|
910
|
+
* @returns
|
|
911
|
+
*/
|
|
912
|
+
static isComponentInstance(instance: any): instance is A_Component;
|
|
913
|
+
/**
|
|
914
|
+
* Type guard to check if the instance is of type A_Feature
|
|
915
|
+
*
|
|
916
|
+
* @param instance
|
|
917
|
+
* @returns
|
|
918
|
+
*/
|
|
919
|
+
static isFeatureInstance(instance: any): instance is A_Feature;
|
|
920
|
+
/**
|
|
921
|
+
* Type guard to check if the instance is of type A_Fragment
|
|
922
|
+
*
|
|
923
|
+
* @param instance
|
|
924
|
+
* @returns
|
|
925
|
+
*/
|
|
926
|
+
static isFragmentInstance(instance: any): instance is A_Fragment;
|
|
927
|
+
/**
|
|
928
|
+
* Type guard to check if the instance is of type A_Entity
|
|
929
|
+
*
|
|
930
|
+
* @param instance
|
|
931
|
+
* @returns
|
|
932
|
+
*/
|
|
933
|
+
static isEntityInstance(instance: any): instance is A_Entity;
|
|
934
|
+
/**
|
|
935
|
+
* Type guard to check if the instance is of type A_Scope
|
|
936
|
+
*
|
|
937
|
+
* @param instance
|
|
938
|
+
* @returns
|
|
939
|
+
*/
|
|
940
|
+
static isScopeInstance(instance: any): instance is A_Scope;
|
|
941
|
+
/**
|
|
942
|
+
* Type guard to check if the instance is of type A_Error
|
|
943
|
+
*
|
|
944
|
+
* @param instance
|
|
945
|
+
* @returns
|
|
946
|
+
*/
|
|
947
|
+
static isErrorInstance(instance: any): instance is A_Error;
|
|
948
|
+
/**
|
|
949
|
+
* Type guard to check if the instance is of type A_ComponentMeta
|
|
950
|
+
*
|
|
951
|
+
* @param instance
|
|
952
|
+
* @returns
|
|
953
|
+
*/
|
|
954
|
+
static isComponentMetaInstance(instance: any): instance is A_ComponentMeta;
|
|
955
|
+
/**
|
|
956
|
+
* Type guard to check if the instance is of type A_ContainerMeta
|
|
957
|
+
*
|
|
958
|
+
* @param instance
|
|
959
|
+
* @returns
|
|
960
|
+
*/
|
|
961
|
+
static isContainerMetaInstance(instance: any): instance is A_ContainerMeta;
|
|
962
|
+
/**
|
|
963
|
+
* Type guard to check if the instance is of type A_EntityMeta
|
|
964
|
+
*
|
|
965
|
+
* @param instance
|
|
966
|
+
* @returns
|
|
967
|
+
*/
|
|
968
|
+
static isEntityMetaInstance(instance: any): instance is A_EntityMeta;
|
|
969
|
+
static hasASEID(value: any): value is A_Entity | A_Error;
|
|
970
|
+
static isConstructorAllowedForScopeAllocation(target: any): target is A_TYPES__ScopeLinkedConstructors;
|
|
971
|
+
static isInstanceAllowedForScopeAllocation(target: any): target is A_TYPES__ScopeLinkedComponents;
|
|
972
|
+
static isConstructorAvailableForAbstraction(target: any): target is A_TYPES__AbstractionAvailableComponents;
|
|
973
|
+
static isTargetAvailableForInjection(target: any): target is A_TYPES__InjectableTargets;
|
|
974
|
+
static isAllowedForFeatureCall(param: any): param is A_TYPES__FeatureAvailableComponents;
|
|
975
|
+
static isAllowedForFeatureDefinition(param: any): param is A_TYPES__FeatureAvailableComponents;
|
|
976
|
+
static isAllowedForFeatureExtension(param: any): param is A_TYPES__FeatureExtendDecoratorTarget;
|
|
977
|
+
static isAllowedForAbstractionDefinition(param: any): param is A_TYPES__AbstractionAvailableComponents;
|
|
978
|
+
static isAllowedForDependencyDefaultCreation(param: any): param is A_TYPES__Entity_Constructor | A_TYPES__Fragment_Constructor;
|
|
979
|
+
/**
|
|
980
|
+
* Allows to check if the provided param is of constructor type.
|
|
981
|
+
*
|
|
982
|
+
* @param param
|
|
983
|
+
* @returns
|
|
984
|
+
*/
|
|
985
|
+
static isErrorConstructorType<T extends A_TYPES__Error_Init>(param: any): param is T;
|
|
986
|
+
static isErrorSerializedType<T extends A_TYPES__Error_Serialized>(param: any): param is T;
|
|
987
|
+
static isPromiseInstance<T>(value: any): value is Promise<T>;
|
|
988
|
+
}
|
|
989
|
+
|
|
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 };
|