@awesome-ecs/abstract 0.21.0 → 0.21.1

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 (59) hide show
  1. package/dist/components/index.cjs +10 -32
  2. package/dist/components/index.cjs.map +1 -1
  3. package/dist/components/index.d.cts +3 -2
  4. package/dist/components/index.d.ts +3 -2
  5. package/dist/components/index.js +11 -8
  6. package/dist/components/index.js.map +1 -1
  7. package/dist/entities/index.cjs +11 -33
  8. package/dist/entities/index.cjs.map +1 -1
  9. package/dist/entities/index.d.cts +4 -34
  10. package/dist/entities/index.d.ts +4 -34
  11. package/dist/entities/index.js +12 -9
  12. package/dist/entities/index.js.map +1 -1
  13. package/dist/factories/index.cjs +0 -18
  14. package/dist/factories/index.d.cts +44 -42
  15. package/dist/factories/index.d.ts +44 -42
  16. package/dist/factories/index.js +0 -1
  17. package/dist/identity-component-BDWEtAXA.d.cts +238 -0
  18. package/dist/identity-component-CR1ULadR.d.ts +238 -0
  19. package/dist/index-C3UGZqUG.d.ts +288 -0
  20. package/dist/index-CKh4A7mH.d.cts +460 -0
  21. package/dist/index-ChV4Q5j6.d.cts +137 -0
  22. package/dist/index-Cm-YSPhK.d.ts +254 -0
  23. package/dist/index-D81Fo9XN.d.cts +254 -0
  24. package/dist/index-DLm-DKAk.d.cts +288 -0
  25. package/dist/index-oenqxDCa.d.ts +137 -0
  26. package/dist/index-zpj0YApu.d.ts +460 -0
  27. package/dist/pipelines/index.cjs +28 -35
  28. package/dist/pipelines/index.cjs.map +1 -1
  29. package/dist/pipelines/index.d.cts +4 -89
  30. package/dist/pipelines/index.d.ts +4 -89
  31. package/dist/pipelines/index.js +29 -11
  32. package/dist/pipelines/index.js.map +1 -1
  33. package/dist/systems/index.cjs +31 -35
  34. package/dist/systems/index.cjs.map +1 -1
  35. package/dist/systems/index.d.cts +7 -114
  36. package/dist/systems/index.d.ts +7 -114
  37. package/dist/systems/index.js +32 -11
  38. package/dist/systems/index.js.map +1 -1
  39. package/dist/{types-cZ-1lGPD.d.ts → types-DvzdpbLu.d.cts} +9 -17
  40. package/dist/{types-cZ-1lGPD.d.cts → types-yh4pOGEm.d.ts} +9 -17
  41. package/dist/utils/index.cjs +25 -35
  42. package/dist/utils/index.cjs.map +1 -1
  43. package/dist/utils/index.d.cts +3 -92
  44. package/dist/utils/index.d.ts +3 -92
  45. package/dist/utils/index.js +26 -11
  46. package/dist/utils/index.js.map +1 -1
  47. package/package.json +3 -3
  48. package/dist/entity-repository-BlSpo-x2.d.ts +0 -253
  49. package/dist/entity-repository-DJ1xbvaN.d.cts +0 -253
  50. package/dist/factories/index.cjs.map +0 -1
  51. package/dist/factories/index.js.map +0 -1
  52. package/dist/index-B1KXekZD.d.ts +0 -199
  53. package/dist/index-CnlpX7ys.d.cts +0 -199
  54. package/dist/performance-timer-BVyl0SRs.d.cts +0 -45
  55. package/dist/performance-timer-BVyl0SRs.d.ts +0 -45
  56. package/dist/pipeline-9bVMwJKD.d.ts +0 -161
  57. package/dist/pipeline-CzwetuCd.d.cts +0 -161
  58. package/dist/systems-runtime-context-Bz9hIdKT.d.cts +0 -330
  59. package/dist/systems-runtime-context-C_Tsvoym.d.ts +0 -330
@@ -1,45 +0,0 @@
1
- /**
2
- * A unique identifier for a timer.
3
- */
4
- type PerformanceTimerUid = number;
5
- /**
6
- * A record of a timer's execution.
7
- *
8
- * @remarks
9
- * This interface represents the details of a timer's execution.
10
- * It includes the timer's name, start timestamp, end timestamp, and the duration of the timer's execution in milliseconds.
11
- *
12
- * @property {string} name - The name of the timer.
13
- * @property {number} startedAt - The timestamp when the timer started.
14
- * @property {number} [endedAt] - The timestamp when the timer ended.
15
- * @property {number} [msPassed] - The time in milliseconds that the timer was active.
16
- */
17
- interface PerformanceTimeEntry {
18
- name: string;
19
- startedAt: number;
20
- endedAt?: number;
21
- msPassed?: number;
22
- }
23
- /**
24
- * An interface for a performance timer.
25
- * This interface provides methods to start and end timers,
26
- * and retrieve information about their execution.
27
- */
28
- interface IPerformanceTimer {
29
- /**
30
- * Starts a new timer with the given name.
31
- * @param {string} name - The name of the timer.
32
- * @returns {PerformanceTimerUid} - A unique identifier for the newly started timer.
33
- */
34
- startTimer(name: string): PerformanceTimerUid;
35
- /**
36
- * Ends the timer with the given timerUid and returns a record of its execution.
37
- * @param {PerformanceTimerUid} timerUid - The unique identifier of the timer to end.
38
- * @returns {PerformanceTimeEntry} - A record of the timer's execution.
39
- * The returned object contains the timer's name, start timestamp, end timestamp,
40
- * and the duration of the timer's execution in milliseconds.
41
- */
42
- endTimer(timerUid: PerformanceTimerUid): PerformanceTimeEntry;
43
- }
44
-
45
- export type { IPerformanceTimer as I, PerformanceTimeEntry as P, PerformanceTimerUid as a };
@@ -1,45 +0,0 @@
1
- /**
2
- * A unique identifier for a timer.
3
- */
4
- type PerformanceTimerUid = number;
5
- /**
6
- * A record of a timer's execution.
7
- *
8
- * @remarks
9
- * This interface represents the details of a timer's execution.
10
- * It includes the timer's name, start timestamp, end timestamp, and the duration of the timer's execution in milliseconds.
11
- *
12
- * @property {string} name - The name of the timer.
13
- * @property {number} startedAt - The timestamp when the timer started.
14
- * @property {number} [endedAt] - The timestamp when the timer ended.
15
- * @property {number} [msPassed] - The time in milliseconds that the timer was active.
16
- */
17
- interface PerformanceTimeEntry {
18
- name: string;
19
- startedAt: number;
20
- endedAt?: number;
21
- msPassed?: number;
22
- }
23
- /**
24
- * An interface for a performance timer.
25
- * This interface provides methods to start and end timers,
26
- * and retrieve information about their execution.
27
- */
28
- interface IPerformanceTimer {
29
- /**
30
- * Starts a new timer with the given name.
31
- * @param {string} name - The name of the timer.
32
- * @returns {PerformanceTimerUid} - A unique identifier for the newly started timer.
33
- */
34
- startTimer(name: string): PerformanceTimerUid;
35
- /**
36
- * Ends the timer with the given timerUid and returns a record of its execution.
37
- * @param {PerformanceTimerUid} timerUid - The unique identifier of the timer to end.
38
- * @returns {PerformanceTimeEntry} - A record of the timer's execution.
39
- * The returned object contains the timer's name, start timestamp, end timestamp,
40
- * and the duration of the timer's execution in milliseconds.
41
- */
42
- endTimer(timerUid: PerformanceTimerUid): PerformanceTimeEntry;
43
- }
44
-
45
- export type { IPerformanceTimer as I, PerformanceTimeEntry as P, PerformanceTimerUid as a };
@@ -1,161 +0,0 @@
1
- import { I as Immutable } from './types-cZ-1lGPD.js';
2
- import { P as PerformanceTimeEntry } from './performance-timer-BVyl0SRs.js';
3
-
4
- /**
5
- * The PipelineStatus enum represents the different states a pipeline can be in.
6
- *
7
- * @remarks
8
- * This enum is used to track the current status of the pipeline.
9
- */
10
- declare enum PipelineStatus {
11
- /**
12
- * The pipeline is currently idle and not processing any tasks.
13
- */
14
- idle = "idle",
15
- /**
16
- * The pipeline is currently processing tasks.
17
- */
18
- ongoing = "ongoing",
19
- /**
20
- * The pipeline has completed all tasks successfully.
21
- */
22
- completed = "completed",
23
- /**
24
- * The pipeline has been halted due to an error or middleware intervention.
25
- */
26
- halted = "halted"
27
- }
28
-
29
- /**
30
- * The Pipeline Context allows exposing state to the Pipeline's middlewares.
31
- */
32
- interface IPipelineContext {
33
- /**
34
- * The runtime state of the pipeline.
35
- */
36
- readonly runtime?: PipelineRuntime;
37
- }
38
- /**
39
- * The Pipeline Runtime exposes runtime status controls for Middlewares, as part of the PipelineContext.
40
- * It allows controlling the pipeline's execution flow.
41
- */
42
- type PipelineRuntime = {
43
- /**
44
- * A flag indicating whether the pipeline should stop executing.
45
- * If true, the pipeline execution will be stopped.
46
- */
47
- shouldStop: boolean;
48
- /**
49
- * The current status of the pipeline.
50
- * It can be undefined if the status is not set.
51
- */
52
- status?: PipelineStatus;
53
- /**
54
- * An optional error that occurred during the pipeline operation.
55
- */
56
- error?: any;
57
- };
58
-
59
- /**
60
- * Represents the result of a pipeline operation.
61
- * It can provide performance metrics collected from self or inner middleware & pipeline calls.
62
- */
63
- type PipelineResult = {
64
- /**
65
- * Performance metrics collected from the current pipeline operation.
66
- * This field is optional and can be `undefined` if no performance metrics were collected.
67
- */
68
- readonly performance?: PerformanceTimeEntry;
69
- /**
70
- * An array of results from inner middleware & pipeline calls.
71
- * This field is optional and can be `undefined` if there were no inner calls.
72
- */
73
- readonly inner?: PipelineResult[];
74
- };
75
-
76
- /**
77
- * A middleware, the building block of a Pipeline. Middlewares will provide a unit-of-work implementation
78
- * dealing with potential state changes over the input Context, or running cleanup logic over the input Context.
79
- *
80
- * @template TContext The type of the context that the middleware will operate on.
81
- * @template TResult The type of the result that the middleware will return.
82
- */
83
- interface IMiddleware<TContext extends IPipelineContext> {
84
- /**
85
- * An optional name for the middleware.
86
- */
87
- readonly name?: string;
88
- /**
89
- * This optional function gets called before executing the middleware. It acts as a boolean gateway whether enough conditions are
90
- * being met so this middleware's action should run.
91
- *
92
- * @param context The Context to determine whether the run condition is satisfied.
93
- * @returns A boolean indicating whether the middleware should run.
94
- */
95
- shouldRun?(context: TContext): boolean;
96
- /**
97
- * The function gets called as part of the pipeline, based on the registration order.
98
- *
99
- * @param context The Context can be read or updated. The Context holds all the state necessary for the execution of the middleware.
100
- * @returns The result of the middleware's action.
101
- */
102
- action(context: TContext): void | PipelineResult;
103
- /**
104
- * This optional function gets called when the cleanup of the Pipeline is necessary, based on reverse order of Middleware registration.
105
- *
106
- * @param context Part of the Context should be cleaned, and any allocated resources in the Action, should be disposed.
107
- * @returns The result of the middleware's cleanup.
108
- */
109
- cleanup?(context: TContext): void | PipelineResult;
110
- }
111
-
112
- /**
113
- * An interface representing a middleware container and dispatcher.
114
- * It allows registering and executing middleware functions in a pipeline.
115
- *
116
- * @template TContext - The type of the context object that will be passed to each middleware function.
117
- * @template TResult - The type of the result that each middleware function will return.
118
- * Defaults to {@link MiddlewareResult}.
119
- */
120
- interface IPipeline<TContext extends IPipelineContext> {
121
- /**
122
- * Represents the name of the pipeline.
123
- * This property is optional and can be used for debugging purposes.
124
- */
125
- readonly name?: string;
126
- /**
127
- * Represents the number of middleware functions registered in the pipeline.
128
- * This property is optional.
129
- */
130
- readonly length?: number;
131
- /**
132
- * Represents the middleware functions registered in the pipeline.
133
- * This property is optional.
134
- */
135
- readonly middleware?: Immutable<IMiddleware<TContext>[]>;
136
- /**
137
- * Register middleware for this pipeline.
138
- *
139
- * @param middleware - The middleware function to be added to the pipeline.
140
- * @returns This instance of the pipeline, allowing for method chaining.
141
- */
142
- use(middleware: Immutable<IMiddleware<TContext>>): this;
143
- /**
144
- * Execute the Dispatch phase on the chain of middleware, with the given Context.
145
- * The Dispatch phase is responsible for invoking the middleware functions in the pipeline.
146
- *
147
- * @param context - The context object that will be passed to each middleware function.
148
- * @returns A {@link PipelineResult} object representing the result of the pipeline execution.
149
- */
150
- dispatch(context: Partial<TContext>): PipelineResult;
151
- /**
152
- * Execute the Cleanup phase on the chain of middleware, with the given Context.
153
- * The Cleanup phase is responsible for performing any necessary cleanup operations after the pipeline execution.
154
- *
155
- * @param context - The context object that will be passed to each middleware function.
156
- * @returns A {@link PipelineResult} object representing the result of the cleanup execution.
157
- */
158
- cleanup(context: Partial<TContext>): PipelineResult;
159
- }
160
-
161
- export { type IPipelineContext as I, type PipelineResult as P, type IPipeline as a, type IMiddleware as b, type PipelineRuntime as c, PipelineStatus as d };
@@ -1,161 +0,0 @@
1
- import { I as Immutable } from './types-cZ-1lGPD.cjs';
2
- import { P as PerformanceTimeEntry } from './performance-timer-BVyl0SRs.cjs';
3
-
4
- /**
5
- * The PipelineStatus enum represents the different states a pipeline can be in.
6
- *
7
- * @remarks
8
- * This enum is used to track the current status of the pipeline.
9
- */
10
- declare enum PipelineStatus {
11
- /**
12
- * The pipeline is currently idle and not processing any tasks.
13
- */
14
- idle = "idle",
15
- /**
16
- * The pipeline is currently processing tasks.
17
- */
18
- ongoing = "ongoing",
19
- /**
20
- * The pipeline has completed all tasks successfully.
21
- */
22
- completed = "completed",
23
- /**
24
- * The pipeline has been halted due to an error or middleware intervention.
25
- */
26
- halted = "halted"
27
- }
28
-
29
- /**
30
- * The Pipeline Context allows exposing state to the Pipeline's middlewares.
31
- */
32
- interface IPipelineContext {
33
- /**
34
- * The runtime state of the pipeline.
35
- */
36
- readonly runtime?: PipelineRuntime;
37
- }
38
- /**
39
- * The Pipeline Runtime exposes runtime status controls for Middlewares, as part of the PipelineContext.
40
- * It allows controlling the pipeline's execution flow.
41
- */
42
- type PipelineRuntime = {
43
- /**
44
- * A flag indicating whether the pipeline should stop executing.
45
- * If true, the pipeline execution will be stopped.
46
- */
47
- shouldStop: boolean;
48
- /**
49
- * The current status of the pipeline.
50
- * It can be undefined if the status is not set.
51
- */
52
- status?: PipelineStatus;
53
- /**
54
- * An optional error that occurred during the pipeline operation.
55
- */
56
- error?: any;
57
- };
58
-
59
- /**
60
- * Represents the result of a pipeline operation.
61
- * It can provide performance metrics collected from self or inner middleware & pipeline calls.
62
- */
63
- type PipelineResult = {
64
- /**
65
- * Performance metrics collected from the current pipeline operation.
66
- * This field is optional and can be `undefined` if no performance metrics were collected.
67
- */
68
- readonly performance?: PerformanceTimeEntry;
69
- /**
70
- * An array of results from inner middleware & pipeline calls.
71
- * This field is optional and can be `undefined` if there were no inner calls.
72
- */
73
- readonly inner?: PipelineResult[];
74
- };
75
-
76
- /**
77
- * A middleware, the building block of a Pipeline. Middlewares will provide a unit-of-work implementation
78
- * dealing with potential state changes over the input Context, or running cleanup logic over the input Context.
79
- *
80
- * @template TContext The type of the context that the middleware will operate on.
81
- * @template TResult The type of the result that the middleware will return.
82
- */
83
- interface IMiddleware<TContext extends IPipelineContext> {
84
- /**
85
- * An optional name for the middleware.
86
- */
87
- readonly name?: string;
88
- /**
89
- * This optional function gets called before executing the middleware. It acts as a boolean gateway whether enough conditions are
90
- * being met so this middleware's action should run.
91
- *
92
- * @param context The Context to determine whether the run condition is satisfied.
93
- * @returns A boolean indicating whether the middleware should run.
94
- */
95
- shouldRun?(context: TContext): boolean;
96
- /**
97
- * The function gets called as part of the pipeline, based on the registration order.
98
- *
99
- * @param context The Context can be read or updated. The Context holds all the state necessary for the execution of the middleware.
100
- * @returns The result of the middleware's action.
101
- */
102
- action(context: TContext): void | PipelineResult;
103
- /**
104
- * This optional function gets called when the cleanup of the Pipeline is necessary, based on reverse order of Middleware registration.
105
- *
106
- * @param context Part of the Context should be cleaned, and any allocated resources in the Action, should be disposed.
107
- * @returns The result of the middleware's cleanup.
108
- */
109
- cleanup?(context: TContext): void | PipelineResult;
110
- }
111
-
112
- /**
113
- * An interface representing a middleware container and dispatcher.
114
- * It allows registering and executing middleware functions in a pipeline.
115
- *
116
- * @template TContext - The type of the context object that will be passed to each middleware function.
117
- * @template TResult - The type of the result that each middleware function will return.
118
- * Defaults to {@link MiddlewareResult}.
119
- */
120
- interface IPipeline<TContext extends IPipelineContext> {
121
- /**
122
- * Represents the name of the pipeline.
123
- * This property is optional and can be used for debugging purposes.
124
- */
125
- readonly name?: string;
126
- /**
127
- * Represents the number of middleware functions registered in the pipeline.
128
- * This property is optional.
129
- */
130
- readonly length?: number;
131
- /**
132
- * Represents the middleware functions registered in the pipeline.
133
- * This property is optional.
134
- */
135
- readonly middleware?: Immutable<IMiddleware<TContext>[]>;
136
- /**
137
- * Register middleware for this pipeline.
138
- *
139
- * @param middleware - The middleware function to be added to the pipeline.
140
- * @returns This instance of the pipeline, allowing for method chaining.
141
- */
142
- use(middleware: Immutable<IMiddleware<TContext>>): this;
143
- /**
144
- * Execute the Dispatch phase on the chain of middleware, with the given Context.
145
- * The Dispatch phase is responsible for invoking the middleware functions in the pipeline.
146
- *
147
- * @param context - The context object that will be passed to each middleware function.
148
- * @returns A {@link PipelineResult} object representing the result of the pipeline execution.
149
- */
150
- dispatch(context: Partial<TContext>): PipelineResult;
151
- /**
152
- * Execute the Cleanup phase on the chain of middleware, with the given Context.
153
- * The Cleanup phase is responsible for performing any necessary cleanup operations after the pipeline execution.
154
- *
155
- * @param context - The context object that will be passed to each middleware function.
156
- * @returns A {@link PipelineResult} object representing the result of the cleanup execution.
157
- */
158
- cleanup(context: Partial<TContext>): PipelineResult;
159
- }
160
-
161
- export { type IPipelineContext as I, type PipelineResult as P, type IPipeline as a, type IMiddleware as b, type PipelineRuntime as c, PipelineStatus as d };