@adaas/a-concept 0.1.31 → 0.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1186,7 +1186,7 @@ declare class A_Stage {
1186
1186
  * @param step
1187
1187
  * @returns
1188
1188
  */
1189
- protected getStepArgs(scope: A_Scope, step: A_TYPES__A_StageStep): Promise<(A_Container | A_Component | A_Entity<any, A_TYPES__Entity_Serialized> | A_Scope<A_TYPES__Component_Constructor[], A_TYPES__Error_Constructor[], A_TYPES__Entity_Constructor[], A_Fragment<any, any>[]> | A_Feature<A_TYPES__FeatureAvailableComponents> | A_Fragment<any, any> | A_TYPES__ScopeResolvableComponents[] | undefined)[]>;
1189
+ protected getStepArgs(scope: A_Scope, step: A_TYPES__A_StageStep): Promise<(A_Container | A_Component | A_Entity<any, A_TYPES__Entity_Serialized> | A_Scope<A_TYPES__Component_Constructor[], A_TYPES__Error_Constructor[], A_TYPES__Entity_Constructor[], A_Fragment<any, any>[]> | A_Feature<A_TYPES__FeatureAvailableComponents> | A_Fragment<any, any> | A_Error<A_TYPES__Error_Init, A_TYPES__Error_Serialized> | A_TYPES__ScopeResolvableComponents[] | undefined)[]>;
1190
1190
  /**
1191
1191
  * Resolves the component of the step
1192
1192
  *
@@ -1671,7 +1671,7 @@ type A_TYPES__FeatureExtendDecoratorDescriptor = TypedPropertyDescriptor<() => a
1671
1671
  *
1672
1672
  * [!] Can be applied only on A-Components
1673
1673
  */
1674
- type A_TYPES__FeatureExtendDecoratorTarget = A_Component;
1674
+ type A_TYPES__FeatureExtendDecoratorTarget = A_Component | A_Container | A_Entity;
1675
1675
  /**
1676
1676
  * Configuration type for A_Extend decorator
1677
1677
  *
@@ -2698,7 +2698,7 @@ type A_TYPES__A_InjectDecorator_Meta = Array<{
2698
2698
  *
2699
2699
  */
2700
2700
  type A_TYPES__InjectableTargets = A_TYPES__Component_Constructor | InstanceType<A_TYPES__Component_Constructor> | InstanceType<A_TYPES__Container_Constructor>;
2701
- type A_TYPES__InjectableConstructors = A_TYPES__Component_Constructor | A_TYPES__Container_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Feature_Constructor | A_TYPES__Caller_Constructor | A_TYPES__Fragment_Constructor | string;
2701
+ type A_TYPES__InjectableConstructors = A_TYPES__Component_Constructor | A_TYPES__Container_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Feature_Constructor | A_TYPES__Caller_Constructor | A_TYPES__Fragment_Constructor | A_TYPES__Error_Constructor | string;
2702
2702
  type A_TYPES__A_InjectDecorator_EntityInjectionInstructions<T extends A_Entity = A_Entity> = {
2703
2703
  query: Partial<A_TYPES__A_InjectDecorator_EntityInjectionQuery<T>>;
2704
2704
  pagination: Partial<A_TYPES__A_InjectDecorator_EntityInjectionPagination>;
@@ -2793,6 +2793,12 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
2793
2793
  * [!] One component instance per scope
2794
2794
  */
2795
2795
  get components(): Array<InstanceType<_ComponentType[number]>>;
2796
+ /**
2797
+ * Returns an Array of errors registered in the scope
2798
+ *
2799
+ * [!] One error per code
2800
+ */
2801
+ get errors(): Array<InstanceType<_ErrorType[number]>>;
2796
2802
  /**
2797
2803
  * Returns the parent scope of the current scope
2798
2804
  *
@@ -2922,6 +2928,11 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
2922
2928
  * Provide a fragment constructor to check if it's available in the scope
2923
2929
  */
2924
2930
  fragment: A_TYPES__Fragment_Constructor<T>): boolean;
2931
+ has<T extends A_Error>(
2932
+ /**
2933
+ * Provide an error constructor to check if it's available in the scope
2934
+ */
2935
+ error: A_TYPES__Error_Constructor<T>): boolean;
2925
2936
  has(
2926
2937
  /**
2927
2938
  * Provide a string to check if a component, entity or fragment with the provided name is available in the scope
@@ -2998,13 +3009,6 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
2998
3009
  * Provide an entity constructor to resolve its instance or an array of instances from the scope
2999
3010
  */
3000
3011
  entity: A_TYPES__Entity_Constructor<T>): T | undefined;
3001
- resolve<T extends A_Scope>(
3002
- /**
3003
- * Uses only in case of resolving a single entity
3004
- *
3005
- * Provide an entity constructor to resolve its instance from the scope
3006
- */
3007
- scope: new (...args: any[]) => T): T | undefined;
3008
3012
  resolve<T extends A_Entity>(
3009
3013
  /**
3010
3014
  * Provide an entity constructor to resolve its instance or an array of instances from the scope
@@ -3014,6 +3018,20 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
3014
3018
  * Provide optional instructions to find a specific entity or a set of entities
3015
3019
  */
3016
3020
  instructions: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions<T>>): Array<T>;
3021
+ resolve<T extends A_Scope>(
3022
+ /**
3023
+ * Uses only in case of resolving a single entity
3024
+ *
3025
+ * Provide an entity constructor to resolve its instance from the scope
3026
+ */
3027
+ scope: A_TYPES__Scope_Constructor<T>): T | undefined;
3028
+ resolve<T extends A_Error>(
3029
+ /**
3030
+ * Uses only in case of resolving a single entity
3031
+ *
3032
+ * Provide an entity constructor to resolve its instance from the scope
3033
+ */
3034
+ scope: A_TYPES__Error_Constructor<T>): T | undefined;
3017
3035
  resolve<T extends A_TYPES__ScopeResolvableComponents>(constructorName: string): T | undefined;
3018
3036
  resolve<T extends A_TYPES__ScopeResolvableComponents>(
3019
3037
  /**
@@ -3053,6 +3071,13 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
3053
3071
  * @returns
3054
3072
  */
3055
3073
  private resolveEntity;
3074
+ /**
3075
+ * This method is used internally to resolve a single error from the scope
3076
+ *
3077
+ * @param error
3078
+ * @returns
3079
+ */
3080
+ private resolveError;
3056
3081
  /**
3057
3082
  * This method is used internally to resolve a single fragment from the scope
3058
3083
  *
@@ -3119,6 +3144,51 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
3119
3144
  * Provide an entity instance to register it in the scope
3120
3145
  */
3121
3146
  entity: A_Entity): void;
3147
+ /**
3148
+ * This method is used to deregister the component from the scope
3149
+ *
3150
+ * @param fragment
3151
+ */
3152
+ deregister<T extends A_Component>(
3153
+ /**
3154
+ * Provide a component constructor to deregister it in the scope
3155
+ */
3156
+ component: A_TYPES__Component_Constructor<T>): void;
3157
+ deregister(
3158
+ /**
3159
+ * Provide a command instance to deregister it in the scope
3160
+ */
3161
+ component: A_Component): void;
3162
+ deregister<T extends A_Error>(
3163
+ /**
3164
+ * Provide an error constructor to deregister it in the scope
3165
+ */
3166
+ error: A_TYPES__Error_Constructor<T>): void;
3167
+ deregister(
3168
+ /**
3169
+ * Provide an error instance to deregister it in the scope
3170
+ */
3171
+ error: A_Error): void;
3172
+ deregister<T extends A_Fragment>(
3173
+ /**
3174
+ * Provide a command instance to deregister it in the scope
3175
+ */
3176
+ fragment: A_TYPES__Fragment_Constructor<T>): void;
3177
+ deregister(
3178
+ /**
3179
+ * Provide a fragment instance to deregister it in the scope
3180
+ */
3181
+ fragment: A_Fragment): void;
3182
+ deregister<T extends A_Entity>(
3183
+ /**
3184
+ * Provide an entity constructor to deregister it in the scope
3185
+ */
3186
+ entity: A_TYPES__Entity_Constructor<T>): void;
3187
+ deregister(
3188
+ /**
3189
+ * Provide an entity instance to deregister it in the scope
3190
+ */
3191
+ entity: A_Entity): void;
3122
3192
  /**
3123
3193
  * This method is useful when you want to serialize the scope to JSON
3124
3194
  *
@@ -3269,11 +3339,11 @@ type A_TYPES__ScopeLinkedComponents = A_Container | A_Feature;
3269
3339
  /**
3270
3340
  * A list of components that can be resolved by a scope
3271
3341
  */
3272
- type A_TYPES__ScopeResolvableComponents = A_Component | A_Fragment | A_Entity;
3342
+ type A_TYPES__ScopeResolvableComponents = A_Component | A_Fragment | A_Entity | A_Error | A_Scope;
3273
3343
  /**
3274
3344
  * A list of components that are dependent on a scope and do not have their own scope
3275
3345
  */
3276
- type A_TYPES_ScopeDependentComponents = A_Component | A_Entity | A_Fragment;
3346
+ type A_TYPES_ScopeDependentComponents = A_Component | A_Entity | A_Fragment | A_Error;
3277
3347
  /**
3278
3348
  * A list of components that are independent of a scope. They don't need a scope to be resolved
3279
3349
  * Those components haven't scope dependent features.
@@ -3759,6 +3829,7 @@ declare class A_ScopeError extends A_Error {
3759
3829
  static readonly ResolutionError = "A-Scope Resolution Error";
3760
3830
  static readonly RegistrationError = "A-Scope Registration Error";
3761
3831
  static readonly CircularInheritanceError = "A-Scope Circular Inheritance Error";
3832
+ static readonly DeregistrationError = "A-Scope Deregistration Error";
3762
3833
  }
3763
3834
 
3764
3835
  /**
@@ -3845,6 +3916,13 @@ declare function A_Inject<T extends A_Scope>(
3845
3916
  * [!] It returns an instance of the Scope where the Entity/Component/Container is defined.
3846
3917
  */
3847
3918
  scope: A_TYPES__Scope_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
3919
+ declare function A_Inject<T extends A_Error>(
3920
+ /***
3921
+ * Provide the Error constructor that will be associated with the injection.
3922
+ *
3923
+ * [!] It returns an Instance of the Error what is executed.
3924
+ */
3925
+ error: A_TYPES__Error_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
3848
3926
  declare function A_Inject<T extends A_Feature>(
3849
3927
  /**
3850
3928
  * Provide the Feature constructor that will be associated with the injection.
package/dist/index.d.ts CHANGED
@@ -1186,7 +1186,7 @@ declare class A_Stage {
1186
1186
  * @param step
1187
1187
  * @returns
1188
1188
  */
1189
- protected getStepArgs(scope: A_Scope, step: A_TYPES__A_StageStep): Promise<(A_Container | A_Component | A_Entity<any, A_TYPES__Entity_Serialized> | A_Scope<A_TYPES__Component_Constructor[], A_TYPES__Error_Constructor[], A_TYPES__Entity_Constructor[], A_Fragment<any, any>[]> | A_Feature<A_TYPES__FeatureAvailableComponents> | A_Fragment<any, any> | A_TYPES__ScopeResolvableComponents[] | undefined)[]>;
1189
+ protected getStepArgs(scope: A_Scope, step: A_TYPES__A_StageStep): Promise<(A_Container | A_Component | A_Entity<any, A_TYPES__Entity_Serialized> | A_Scope<A_TYPES__Component_Constructor[], A_TYPES__Error_Constructor[], A_TYPES__Entity_Constructor[], A_Fragment<any, any>[]> | A_Feature<A_TYPES__FeatureAvailableComponents> | A_Fragment<any, any> | A_Error<A_TYPES__Error_Init, A_TYPES__Error_Serialized> | A_TYPES__ScopeResolvableComponents[] | undefined)[]>;
1190
1190
  /**
1191
1191
  * Resolves the component of the step
1192
1192
  *
@@ -1671,7 +1671,7 @@ type A_TYPES__FeatureExtendDecoratorDescriptor = TypedPropertyDescriptor<() => a
1671
1671
  *
1672
1672
  * [!] Can be applied only on A-Components
1673
1673
  */
1674
- type A_TYPES__FeatureExtendDecoratorTarget = A_Component;
1674
+ type A_TYPES__FeatureExtendDecoratorTarget = A_Component | A_Container | A_Entity;
1675
1675
  /**
1676
1676
  * Configuration type for A_Extend decorator
1677
1677
  *
@@ -2698,7 +2698,7 @@ type A_TYPES__A_InjectDecorator_Meta = Array<{
2698
2698
  *
2699
2699
  */
2700
2700
  type A_TYPES__InjectableTargets = A_TYPES__Component_Constructor | InstanceType<A_TYPES__Component_Constructor> | InstanceType<A_TYPES__Container_Constructor>;
2701
- type A_TYPES__InjectableConstructors = A_TYPES__Component_Constructor | A_TYPES__Container_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Feature_Constructor | A_TYPES__Caller_Constructor | A_TYPES__Fragment_Constructor | string;
2701
+ type A_TYPES__InjectableConstructors = A_TYPES__Component_Constructor | A_TYPES__Container_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Feature_Constructor | A_TYPES__Caller_Constructor | A_TYPES__Fragment_Constructor | A_TYPES__Error_Constructor | string;
2702
2702
  type A_TYPES__A_InjectDecorator_EntityInjectionInstructions<T extends A_Entity = A_Entity> = {
2703
2703
  query: Partial<A_TYPES__A_InjectDecorator_EntityInjectionQuery<T>>;
2704
2704
  pagination: Partial<A_TYPES__A_InjectDecorator_EntityInjectionPagination>;
@@ -2793,6 +2793,12 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
2793
2793
  * [!] One component instance per scope
2794
2794
  */
2795
2795
  get components(): Array<InstanceType<_ComponentType[number]>>;
2796
+ /**
2797
+ * Returns an Array of errors registered in the scope
2798
+ *
2799
+ * [!] One error per code
2800
+ */
2801
+ get errors(): Array<InstanceType<_ErrorType[number]>>;
2796
2802
  /**
2797
2803
  * Returns the parent scope of the current scope
2798
2804
  *
@@ -2922,6 +2928,11 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
2922
2928
  * Provide a fragment constructor to check if it's available in the scope
2923
2929
  */
2924
2930
  fragment: A_TYPES__Fragment_Constructor<T>): boolean;
2931
+ has<T extends A_Error>(
2932
+ /**
2933
+ * Provide an error constructor to check if it's available in the scope
2934
+ */
2935
+ error: A_TYPES__Error_Constructor<T>): boolean;
2925
2936
  has(
2926
2937
  /**
2927
2938
  * Provide a string to check if a component, entity or fragment with the provided name is available in the scope
@@ -2998,13 +3009,6 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
2998
3009
  * Provide an entity constructor to resolve its instance or an array of instances from the scope
2999
3010
  */
3000
3011
  entity: A_TYPES__Entity_Constructor<T>): T | undefined;
3001
- resolve<T extends A_Scope>(
3002
- /**
3003
- * Uses only in case of resolving a single entity
3004
- *
3005
- * Provide an entity constructor to resolve its instance from the scope
3006
- */
3007
- scope: new (...args: any[]) => T): T | undefined;
3008
3012
  resolve<T extends A_Entity>(
3009
3013
  /**
3010
3014
  * Provide an entity constructor to resolve its instance or an array of instances from the scope
@@ -3014,6 +3018,20 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
3014
3018
  * Provide optional instructions to find a specific entity or a set of entities
3015
3019
  */
3016
3020
  instructions: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions<T>>): Array<T>;
3021
+ resolve<T extends A_Scope>(
3022
+ /**
3023
+ * Uses only in case of resolving a single entity
3024
+ *
3025
+ * Provide an entity constructor to resolve its instance from the scope
3026
+ */
3027
+ scope: A_TYPES__Scope_Constructor<T>): T | undefined;
3028
+ resolve<T extends A_Error>(
3029
+ /**
3030
+ * Uses only in case of resolving a single entity
3031
+ *
3032
+ * Provide an entity constructor to resolve its instance from the scope
3033
+ */
3034
+ scope: A_TYPES__Error_Constructor<T>): T | undefined;
3017
3035
  resolve<T extends A_TYPES__ScopeResolvableComponents>(constructorName: string): T | undefined;
3018
3036
  resolve<T extends A_TYPES__ScopeResolvableComponents>(
3019
3037
  /**
@@ -3053,6 +3071,13 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
3053
3071
  * @returns
3054
3072
  */
3055
3073
  private resolveEntity;
3074
+ /**
3075
+ * This method is used internally to resolve a single error from the scope
3076
+ *
3077
+ * @param error
3078
+ * @returns
3079
+ */
3080
+ private resolveError;
3056
3081
  /**
3057
3082
  * This method is used internally to resolve a single fragment from the scope
3058
3083
  *
@@ -3119,6 +3144,51 @@ declare class A_Scope<_ComponentType extends A_TYPES__Component_Constructor[] =
3119
3144
  * Provide an entity instance to register it in the scope
3120
3145
  */
3121
3146
  entity: A_Entity): void;
3147
+ /**
3148
+ * This method is used to deregister the component from the scope
3149
+ *
3150
+ * @param fragment
3151
+ */
3152
+ deregister<T extends A_Component>(
3153
+ /**
3154
+ * Provide a component constructor to deregister it in the scope
3155
+ */
3156
+ component: A_TYPES__Component_Constructor<T>): void;
3157
+ deregister(
3158
+ /**
3159
+ * Provide a command instance to deregister it in the scope
3160
+ */
3161
+ component: A_Component): void;
3162
+ deregister<T extends A_Error>(
3163
+ /**
3164
+ * Provide an error constructor to deregister it in the scope
3165
+ */
3166
+ error: A_TYPES__Error_Constructor<T>): void;
3167
+ deregister(
3168
+ /**
3169
+ * Provide an error instance to deregister it in the scope
3170
+ */
3171
+ error: A_Error): void;
3172
+ deregister<T extends A_Fragment>(
3173
+ /**
3174
+ * Provide a command instance to deregister it in the scope
3175
+ */
3176
+ fragment: A_TYPES__Fragment_Constructor<T>): void;
3177
+ deregister(
3178
+ /**
3179
+ * Provide a fragment instance to deregister it in the scope
3180
+ */
3181
+ fragment: A_Fragment): void;
3182
+ deregister<T extends A_Entity>(
3183
+ /**
3184
+ * Provide an entity constructor to deregister it in the scope
3185
+ */
3186
+ entity: A_TYPES__Entity_Constructor<T>): void;
3187
+ deregister(
3188
+ /**
3189
+ * Provide an entity instance to deregister it in the scope
3190
+ */
3191
+ entity: A_Entity): void;
3122
3192
  /**
3123
3193
  * This method is useful when you want to serialize the scope to JSON
3124
3194
  *
@@ -3269,11 +3339,11 @@ type A_TYPES__ScopeLinkedComponents = A_Container | A_Feature;
3269
3339
  /**
3270
3340
  * A list of components that can be resolved by a scope
3271
3341
  */
3272
- type A_TYPES__ScopeResolvableComponents = A_Component | A_Fragment | A_Entity;
3342
+ type A_TYPES__ScopeResolvableComponents = A_Component | A_Fragment | A_Entity | A_Error | A_Scope;
3273
3343
  /**
3274
3344
  * A list of components that are dependent on a scope and do not have their own scope
3275
3345
  */
3276
- type A_TYPES_ScopeDependentComponents = A_Component | A_Entity | A_Fragment;
3346
+ type A_TYPES_ScopeDependentComponents = A_Component | A_Entity | A_Fragment | A_Error;
3277
3347
  /**
3278
3348
  * A list of components that are independent of a scope. They don't need a scope to be resolved
3279
3349
  * Those components haven't scope dependent features.
@@ -3759,6 +3829,7 @@ declare class A_ScopeError extends A_Error {
3759
3829
  static readonly ResolutionError = "A-Scope Resolution Error";
3760
3830
  static readonly RegistrationError = "A-Scope Registration Error";
3761
3831
  static readonly CircularInheritanceError = "A-Scope Circular Inheritance Error";
3832
+ static readonly DeregistrationError = "A-Scope Deregistration Error";
3762
3833
  }
3763
3834
 
3764
3835
  /**
@@ -3845,6 +3916,13 @@ declare function A_Inject<T extends A_Scope>(
3845
3916
  * [!] It returns an instance of the Scope where the Entity/Component/Container is defined.
3846
3917
  */
3847
3918
  scope: A_TYPES__Scope_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
3919
+ declare function A_Inject<T extends A_Error>(
3920
+ /***
3921
+ * Provide the Error constructor that will be associated with the injection.
3922
+ *
3923
+ * [!] It returns an Instance of the Error what is executed.
3924
+ */
3925
+ error: A_TYPES__Error_Constructor<T>): A_TYPES__A_InjectDecoratorReturn;
3848
3926
  declare function A_Inject<T extends A_Feature>(
3849
3927
  /**
3850
3928
  * Provide the Feature constructor that will be associated with the injection.