@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
@@ -0,0 +1,254 @@
1
+ import { Immutable } from "./types-yh4pOGEm.js";
2
+ import { PerformanceTimeEntry } from "./index-oenqxDCa.js";
3
+
4
+ //#region src/pipelines/pipeline-status.d.ts
5
+
6
+ /**
7
+ * The PipelineStatus enum represents the different states a pipeline can be in.
8
+ *
9
+ * @remarks
10
+ * This enum is used to track the current status of the pipeline.
11
+ */
12
+ declare enum PipelineStatus {
13
+ /**
14
+ * The pipeline is currently idle and not processing any tasks.
15
+ */
16
+ idle = "idle",
17
+ /**
18
+ * The pipeline is currently processing tasks.
19
+ */
20
+ ongoing = "ongoing",
21
+ /**
22
+ * The pipeline has completed all tasks successfully.
23
+ */
24
+ completed = "completed",
25
+ /**
26
+ * The pipeline has been halted due to an error or middleware intervention.
27
+ */
28
+ halted = "halted",
29
+ }
30
+ //#endregion
31
+ //#region src/pipelines/pipeline-context.d.ts
32
+ /**
33
+ * The Pipeline Context allows exposing state to the Pipeline's middlewares.
34
+ */
35
+ interface IPipelineContext {
36
+ /**
37
+ * The runtime state of the pipeline.
38
+ */
39
+ readonly runtime?: PipelineRuntime;
40
+ }
41
+ /**
42
+ * The Pipeline Runtime exposes runtime status controls for Middlewares, as part of the PipelineContext.
43
+ * It allows controlling the pipeline's execution flow.
44
+ */
45
+ type PipelineRuntime = {
46
+ /**
47
+ * A flag indicating whether the pipeline should stop executing.
48
+ * If true, the pipeline execution will be stopped.
49
+ */
50
+ shouldStop: boolean;
51
+ /**
52
+ * The current status of the pipeline.
53
+ * It can be undefined if the status is not set.
54
+ */
55
+ status?: PipelineStatus;
56
+ /**
57
+ * An optional error that occurred during the pipeline operation.
58
+ */
59
+ error?: any;
60
+ };
61
+ //#endregion
62
+ //#region src/pipelines/pipeline-result.d.ts
63
+ /**
64
+ * Represents the result of a pipeline operation.
65
+ * It can provide performance metrics collected from self or inner middleware & pipeline calls.
66
+ */
67
+ type PipelineResult = {
68
+ /**
69
+ * Performance metrics collected from the current pipeline operation.
70
+ * This field is optional and can be `undefined` if no performance metrics were collected.
71
+ */
72
+ readonly performance?: PerformanceTimeEntry;
73
+ /**
74
+ * An array of results from inner middleware & pipeline calls.
75
+ * This field is optional and can be `undefined` if there were no inner calls.
76
+ */
77
+ readonly inner?: PipelineResult[];
78
+ };
79
+ //#endregion
80
+ //#region src/pipelines/middleware.d.ts
81
+ /**
82
+ * A middleware, the building block of a Pipeline. Middlewares will provide a unit-of-work implementation
83
+ * dealing with potential state changes over the input Context, or running cleanup logic over the input Context.
84
+ *
85
+ * @template TContext The type of the context that the middleware will operate on.
86
+ * @template TResult The type of the result that the middleware will return.
87
+ */
88
+ interface IMiddleware<TContext extends IPipelineContext> {
89
+ /**
90
+ * An optional name for the middleware.
91
+ */
92
+ readonly name?: string;
93
+ /**
94
+ * This optional function gets called before executing the middleware. It acts as a boolean gateway whether enough conditions are
95
+ * being met so this middleware's action should run.
96
+ *
97
+ * @param context The Context to determine whether the run condition is satisfied.
98
+ * @returns A boolean indicating whether the middleware should run.
99
+ */
100
+ shouldRun?(context: TContext): boolean;
101
+ /**
102
+ * The function gets called as part of the pipeline, based on the registration order.
103
+ *
104
+ * @param context The Context can be read or updated. The Context holds all the state necessary for the execution of the middleware.
105
+ * @returns The result of the middleware's action.
106
+ */
107
+ action(context: TContext): void | PipelineResult;
108
+ /**
109
+ * This optional function gets called when the cleanup of the Pipeline is necessary, based on reverse order of Middleware registration.
110
+ *
111
+ * @param context Part of the Context should be cleaned, and any allocated resources in the Action, should be disposed.
112
+ * @returns The result of the middleware's cleanup.
113
+ */
114
+ cleanup?(context: TContext): void | PipelineResult;
115
+ }
116
+ //#endregion
117
+ //#region src/pipelines/middleware-runner.d.ts
118
+ /**
119
+ * The `IMiddlewareRunner` interface allows for custom logic when running an {@link IMiddleware} method.
120
+ * It's useful for implementing different `Decorators` to compose extensible runtime logic.
121
+ *
122
+ * @template TContext The type of the context that will be passed to the middleware methods.
123
+ */
124
+ interface IMiddlewareRunner<TContext extends IPipelineContext> {
125
+ /**
126
+ * The `dispatch` method decides how to run the {@link IMiddleware.action} method on the provided {@link IMiddleware} instance.
127
+ *
128
+ * @param context The {@link IPipelineContext} passed to the Middleware's {@link IMiddleware.action} method.
129
+ * @param middleware The {@link IMiddleware} to call the {@link IMiddleware.action} method on.
130
+ * @returns A {@link MiddlewareResult} indicating the outcome of the middleware's action.
131
+ */
132
+ dispatch(context: TContext, middleware: IMiddleware<TContext>): void | PipelineResult;
133
+ /**
134
+ * The `cleanup` method decides how to run the {@link IMiddleware.cleanup} method on the provided {@link IMiddleware} instance.
135
+ *
136
+ * @param context The {@link IPipelineContext} passed to the Middleware's {@link IMiddleware.cleanup} method.
137
+ * @param middleware The {@link IMiddleware} to call the {@link IMiddleware.cleanup} method on.
138
+ * @returns A {@link MiddlewareResult} indicating the outcome of the middleware's cleanup.
139
+ */
140
+ cleanup(context: TContext, middleware: IMiddleware<TContext>): void | PipelineResult;
141
+ }
142
+ //#endregion
143
+ //#region src/pipelines/pipeline.d.ts
144
+ /**
145
+ * An interface representing a middleware container and dispatcher.
146
+ * It allows registering and executing middleware functions in a pipeline.
147
+ *
148
+ * @template TContext - The type of the context object that will be passed to each middleware function.
149
+ * @template TResult - The type of the result that each middleware function will return.
150
+ * Defaults to {@link MiddlewareResult}.
151
+ */
152
+ interface IPipeline<TContext extends IPipelineContext> {
153
+ /**
154
+ * Represents the name of the pipeline.
155
+ * This property is optional and can be used for debugging purposes.
156
+ */
157
+ readonly name?: string;
158
+ /**
159
+ * Represents the number of middleware functions registered in the pipeline.
160
+ * This property is optional.
161
+ */
162
+ readonly length?: number;
163
+ /**
164
+ * Represents the middleware functions registered in the pipeline.
165
+ * This property is optional.
166
+ */
167
+ readonly middleware?: Immutable<IMiddleware<TContext>[]>;
168
+ /**
169
+ * Register middleware for this pipeline.
170
+ *
171
+ * @param middleware - The middleware function to be added to the pipeline.
172
+ * @returns This instance of the pipeline, allowing for method chaining.
173
+ */
174
+ use(middleware: Immutable<IMiddleware<TContext>>): this;
175
+ /**
176
+ * Execute the Dispatch phase on the chain of middleware, with the given Context.
177
+ * The Dispatch phase is responsible for invoking the middleware functions in the pipeline.
178
+ *
179
+ * @param context - The context object that will be passed to each middleware function.
180
+ * @returns A {@link PipelineResult} object representing the result of the pipeline execution.
181
+ */
182
+ dispatch(context: Partial<TContext>): PipelineResult;
183
+ /**
184
+ * Execute the Cleanup phase on the chain of middleware, with the given Context.
185
+ * The Cleanup phase is responsible for performing any necessary cleanup operations after the pipeline execution.
186
+ *
187
+ * @param context - The context object that will be passed to each middleware function.
188
+ * @returns A {@link PipelineResult} object representing the result of the cleanup execution.
189
+ */
190
+ cleanup(context: Partial<TContext>): PipelineResult;
191
+ }
192
+ //#endregion
193
+ //#region src/pipelines/pipeline-nested.d.ts
194
+ /**
195
+ * A context that is passed to a parent pipeline in a nested setup.
196
+ *
197
+ * @template N - The context type of the nested pipeline.
198
+ */
199
+ interface IParentContext<N extends IPipelineContext> extends IPipelineContext {
200
+ readonly nestedPipeline: IPipeline<INestedContext<this>>;
201
+ readonly nestedContexts: Partial<N>[];
202
+ }
203
+ /**
204
+ * A context that is passed to a nested pipeline.
205
+ *
206
+ * @template P - The context type of the parent pipeline.
207
+ */
208
+ interface INestedContext<P extends IParentContext<any>> extends IPipelineContext {
209
+ readonly current: P extends IParentContext<infer N> ? N : never;
210
+ readonly previous?: P extends IParentContext<infer N> ? N : never;
211
+ readonly parent: P;
212
+ }
213
+ /**
214
+ * A middleware that is ran as part of a nested pipeline.
215
+ *
216
+ * @template P - The context type of the parent pipeline.
217
+ */
218
+ type INestedMiddleware<P extends IParentContext<any>> = IMiddleware<INestedContext<P>>;
219
+ /**
220
+ * A middleware that is ran as part of a parent pipeline.
221
+ *
222
+ * @template P - The context type of the parent pipeline.
223
+ */
224
+ type IParentMiddleware<P extends IParentContext<any>> = IMiddleware<P>;
225
+ //#endregion
226
+ //#region src/pipelines/pipeline-runner.d.ts
227
+ /**
228
+ * The `Pipeline Runner` allows for custom logic when running an {@link IMiddleware} Array.
229
+ * It's useful for implementing different `Decorators` to compose extensible runtime logic.
230
+ */
231
+ interface IPipelineRunner<TContext extends IPipelineContext> {
232
+ /**
233
+ * The {@link dispatch} method will decide how to run the {@link IMiddleware.action} method on the provided {@link IMiddleware} instances, starting with the provided {@link startIndex} (optional).
234
+ *
235
+ * @param context - The {@link IPipelineContext} passed to the Middleware's {@link IMiddleware.action} method.
236
+ * @param middleware - The {@link IMiddleware} Array to call the {@link IMiddleware.action} methods on.
237
+ * @param startIndex - (optional) the Start Index to run in the Middleware Array.
238
+ *
239
+ * @returns A {@link PipelineResult} indicating the success or failure of the operation.
240
+ */
241
+ dispatch(context: Partial<TContext>, middleware: IMiddleware<TContext>[], startIndex?: number): PipelineResult;
242
+ /**
243
+ * The {@link cleanup} method will decide how to run the {@link IMiddleware.cleanup} method on the provided {@link IMiddleware} instances.
244
+ *
245
+ * @param context - The {@link IPipelineContext} passed to the Middleware's {@link IMiddleware.cleanup} method.
246
+ * @param middleware - The {@link IMiddleware} Array to call the {@link IMiddleware.cleanup} methods on.
247
+ *
248
+ * @returns A {@link PipelineResult} indicating the success or failure of the operation.
249
+ */
250
+ cleanup(context: Partial<TContext>, middleware: IMiddleware<TContext>[]): PipelineResult;
251
+ }
252
+ //#endregion
253
+ export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineResult, PipelineRuntime, PipelineStatus };
254
+ //# sourceMappingURL=index-Cm-YSPhK.d.ts.map
@@ -0,0 +1,254 @@
1
+ import { Immutable } from "./types-DvzdpbLu.cjs";
2
+ import { PerformanceTimeEntry } from "./index-ChV4Q5j6.cjs";
3
+
4
+ //#region src/pipelines/pipeline-status.d.ts
5
+
6
+ /**
7
+ * The PipelineStatus enum represents the different states a pipeline can be in.
8
+ *
9
+ * @remarks
10
+ * This enum is used to track the current status of the pipeline.
11
+ */
12
+ declare enum PipelineStatus {
13
+ /**
14
+ * The pipeline is currently idle and not processing any tasks.
15
+ */
16
+ idle = "idle",
17
+ /**
18
+ * The pipeline is currently processing tasks.
19
+ */
20
+ ongoing = "ongoing",
21
+ /**
22
+ * The pipeline has completed all tasks successfully.
23
+ */
24
+ completed = "completed",
25
+ /**
26
+ * The pipeline has been halted due to an error or middleware intervention.
27
+ */
28
+ halted = "halted",
29
+ }
30
+ //#endregion
31
+ //#region src/pipelines/pipeline-context.d.ts
32
+ /**
33
+ * The Pipeline Context allows exposing state to the Pipeline's middlewares.
34
+ */
35
+ interface IPipelineContext {
36
+ /**
37
+ * The runtime state of the pipeline.
38
+ */
39
+ readonly runtime?: PipelineRuntime;
40
+ }
41
+ /**
42
+ * The Pipeline Runtime exposes runtime status controls for Middlewares, as part of the PipelineContext.
43
+ * It allows controlling the pipeline's execution flow.
44
+ */
45
+ type PipelineRuntime = {
46
+ /**
47
+ * A flag indicating whether the pipeline should stop executing.
48
+ * If true, the pipeline execution will be stopped.
49
+ */
50
+ shouldStop: boolean;
51
+ /**
52
+ * The current status of the pipeline.
53
+ * It can be undefined if the status is not set.
54
+ */
55
+ status?: PipelineStatus;
56
+ /**
57
+ * An optional error that occurred during the pipeline operation.
58
+ */
59
+ error?: any;
60
+ };
61
+ //#endregion
62
+ //#region src/pipelines/pipeline-result.d.ts
63
+ /**
64
+ * Represents the result of a pipeline operation.
65
+ * It can provide performance metrics collected from self or inner middleware & pipeline calls.
66
+ */
67
+ type PipelineResult = {
68
+ /**
69
+ * Performance metrics collected from the current pipeline operation.
70
+ * This field is optional and can be `undefined` if no performance metrics were collected.
71
+ */
72
+ readonly performance?: PerformanceTimeEntry;
73
+ /**
74
+ * An array of results from inner middleware & pipeline calls.
75
+ * This field is optional and can be `undefined` if there were no inner calls.
76
+ */
77
+ readonly inner?: PipelineResult[];
78
+ };
79
+ //#endregion
80
+ //#region src/pipelines/middleware.d.ts
81
+ /**
82
+ * A middleware, the building block of a Pipeline. Middlewares will provide a unit-of-work implementation
83
+ * dealing with potential state changes over the input Context, or running cleanup logic over the input Context.
84
+ *
85
+ * @template TContext The type of the context that the middleware will operate on.
86
+ * @template TResult The type of the result that the middleware will return.
87
+ */
88
+ interface IMiddleware<TContext extends IPipelineContext> {
89
+ /**
90
+ * An optional name for the middleware.
91
+ */
92
+ readonly name?: string;
93
+ /**
94
+ * This optional function gets called before executing the middleware. It acts as a boolean gateway whether enough conditions are
95
+ * being met so this middleware's action should run.
96
+ *
97
+ * @param context The Context to determine whether the run condition is satisfied.
98
+ * @returns A boolean indicating whether the middleware should run.
99
+ */
100
+ shouldRun?(context: TContext): boolean;
101
+ /**
102
+ * The function gets called as part of the pipeline, based on the registration order.
103
+ *
104
+ * @param context The Context can be read or updated. The Context holds all the state necessary for the execution of the middleware.
105
+ * @returns The result of the middleware's action.
106
+ */
107
+ action(context: TContext): void | PipelineResult;
108
+ /**
109
+ * This optional function gets called when the cleanup of the Pipeline is necessary, based on reverse order of Middleware registration.
110
+ *
111
+ * @param context Part of the Context should be cleaned, and any allocated resources in the Action, should be disposed.
112
+ * @returns The result of the middleware's cleanup.
113
+ */
114
+ cleanup?(context: TContext): void | PipelineResult;
115
+ }
116
+ //#endregion
117
+ //#region src/pipelines/middleware-runner.d.ts
118
+ /**
119
+ * The `IMiddlewareRunner` interface allows for custom logic when running an {@link IMiddleware} method.
120
+ * It's useful for implementing different `Decorators` to compose extensible runtime logic.
121
+ *
122
+ * @template TContext The type of the context that will be passed to the middleware methods.
123
+ */
124
+ interface IMiddlewareRunner<TContext extends IPipelineContext> {
125
+ /**
126
+ * The `dispatch` method decides how to run the {@link IMiddleware.action} method on the provided {@link IMiddleware} instance.
127
+ *
128
+ * @param context The {@link IPipelineContext} passed to the Middleware's {@link IMiddleware.action} method.
129
+ * @param middleware The {@link IMiddleware} to call the {@link IMiddleware.action} method on.
130
+ * @returns A {@link MiddlewareResult} indicating the outcome of the middleware's action.
131
+ */
132
+ dispatch(context: TContext, middleware: IMiddleware<TContext>): void | PipelineResult;
133
+ /**
134
+ * The `cleanup` method decides how to run the {@link IMiddleware.cleanup} method on the provided {@link IMiddleware} instance.
135
+ *
136
+ * @param context The {@link IPipelineContext} passed to the Middleware's {@link IMiddleware.cleanup} method.
137
+ * @param middleware The {@link IMiddleware} to call the {@link IMiddleware.cleanup} method on.
138
+ * @returns A {@link MiddlewareResult} indicating the outcome of the middleware's cleanup.
139
+ */
140
+ cleanup(context: TContext, middleware: IMiddleware<TContext>): void | PipelineResult;
141
+ }
142
+ //#endregion
143
+ //#region src/pipelines/pipeline.d.ts
144
+ /**
145
+ * An interface representing a middleware container and dispatcher.
146
+ * It allows registering and executing middleware functions in a pipeline.
147
+ *
148
+ * @template TContext - The type of the context object that will be passed to each middleware function.
149
+ * @template TResult - The type of the result that each middleware function will return.
150
+ * Defaults to {@link MiddlewareResult}.
151
+ */
152
+ interface IPipeline<TContext extends IPipelineContext> {
153
+ /**
154
+ * Represents the name of the pipeline.
155
+ * This property is optional and can be used for debugging purposes.
156
+ */
157
+ readonly name?: string;
158
+ /**
159
+ * Represents the number of middleware functions registered in the pipeline.
160
+ * This property is optional.
161
+ */
162
+ readonly length?: number;
163
+ /**
164
+ * Represents the middleware functions registered in the pipeline.
165
+ * This property is optional.
166
+ */
167
+ readonly middleware?: Immutable<IMiddleware<TContext>[]>;
168
+ /**
169
+ * Register middleware for this pipeline.
170
+ *
171
+ * @param middleware - The middleware function to be added to the pipeline.
172
+ * @returns This instance of the pipeline, allowing for method chaining.
173
+ */
174
+ use(middleware: Immutable<IMiddleware<TContext>>): this;
175
+ /**
176
+ * Execute the Dispatch phase on the chain of middleware, with the given Context.
177
+ * The Dispatch phase is responsible for invoking the middleware functions in the pipeline.
178
+ *
179
+ * @param context - The context object that will be passed to each middleware function.
180
+ * @returns A {@link PipelineResult} object representing the result of the pipeline execution.
181
+ */
182
+ dispatch(context: Partial<TContext>): PipelineResult;
183
+ /**
184
+ * Execute the Cleanup phase on the chain of middleware, with the given Context.
185
+ * The Cleanup phase is responsible for performing any necessary cleanup operations after the pipeline execution.
186
+ *
187
+ * @param context - The context object that will be passed to each middleware function.
188
+ * @returns A {@link PipelineResult} object representing the result of the cleanup execution.
189
+ */
190
+ cleanup(context: Partial<TContext>): PipelineResult;
191
+ }
192
+ //#endregion
193
+ //#region src/pipelines/pipeline-nested.d.ts
194
+ /**
195
+ * A context that is passed to a parent pipeline in a nested setup.
196
+ *
197
+ * @template N - The context type of the nested pipeline.
198
+ */
199
+ interface IParentContext<N extends IPipelineContext> extends IPipelineContext {
200
+ readonly nestedPipeline: IPipeline<INestedContext<this>>;
201
+ readonly nestedContexts: Partial<N>[];
202
+ }
203
+ /**
204
+ * A context that is passed to a nested pipeline.
205
+ *
206
+ * @template P - The context type of the parent pipeline.
207
+ */
208
+ interface INestedContext<P extends IParentContext<any>> extends IPipelineContext {
209
+ readonly current: P extends IParentContext<infer N> ? N : never;
210
+ readonly previous?: P extends IParentContext<infer N> ? N : never;
211
+ readonly parent: P;
212
+ }
213
+ /**
214
+ * A middleware that is ran as part of a nested pipeline.
215
+ *
216
+ * @template P - The context type of the parent pipeline.
217
+ */
218
+ type INestedMiddleware<P extends IParentContext<any>> = IMiddleware<INestedContext<P>>;
219
+ /**
220
+ * A middleware that is ran as part of a parent pipeline.
221
+ *
222
+ * @template P - The context type of the parent pipeline.
223
+ */
224
+ type IParentMiddleware<P extends IParentContext<any>> = IMiddleware<P>;
225
+ //#endregion
226
+ //#region src/pipelines/pipeline-runner.d.ts
227
+ /**
228
+ * The `Pipeline Runner` allows for custom logic when running an {@link IMiddleware} Array.
229
+ * It's useful for implementing different `Decorators` to compose extensible runtime logic.
230
+ */
231
+ interface IPipelineRunner<TContext extends IPipelineContext> {
232
+ /**
233
+ * The {@link dispatch} method will decide how to run the {@link IMiddleware.action} method on the provided {@link IMiddleware} instances, starting with the provided {@link startIndex} (optional).
234
+ *
235
+ * @param context - The {@link IPipelineContext} passed to the Middleware's {@link IMiddleware.action} method.
236
+ * @param middleware - The {@link IMiddleware} Array to call the {@link IMiddleware.action} methods on.
237
+ * @param startIndex - (optional) the Start Index to run in the Middleware Array.
238
+ *
239
+ * @returns A {@link PipelineResult} indicating the success or failure of the operation.
240
+ */
241
+ dispatch(context: Partial<TContext>, middleware: IMiddleware<TContext>[], startIndex?: number): PipelineResult;
242
+ /**
243
+ * The {@link cleanup} method will decide how to run the {@link IMiddleware.cleanup} method on the provided {@link IMiddleware} instances.
244
+ *
245
+ * @param context - The {@link IPipelineContext} passed to the Middleware's {@link IMiddleware.cleanup} method.
246
+ * @param middleware - The {@link IMiddleware} Array to call the {@link IMiddleware.cleanup} methods on.
247
+ *
248
+ * @returns A {@link PipelineResult} indicating the success or failure of the operation.
249
+ */
250
+ cleanup(context: Partial<TContext>, middleware: IMiddleware<TContext>[]): PipelineResult;
251
+ }
252
+ //#endregion
253
+ export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineResult, PipelineRuntime, PipelineStatus };
254
+ //# sourceMappingURL=index-D81Fo9XN.d.cts.map