@awesome-ecs/abstract 0.28.0 → 0.30.0
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/components/index.cjs +2 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/entities/index.cjs +2 -3
- package/dist/entities/index.cjs.map +1 -1
- package/dist/entities/index.d.cts +3 -3
- package/dist/entities/index.d.mts +3 -3
- package/dist/entities/index.mjs +1 -2
- package/dist/entities/index.mjs.map +1 -1
- package/dist/factories/index.cjs +2 -2
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +2 -95
- package/dist/factories/index.d.mts +2 -95
- package/dist/factories/index.mjs +1 -1
- package/dist/factories/index.mjs.map +1 -1
- package/dist/{identity-component-CgzvgBVh.d.mts → identity-component-CuWHf7jX.d.mts} +76 -10
- package/dist/{identity-component-uU0yDR-y.d.cts → identity-component-DLDaOTyK.d.cts} +76 -10
- package/dist/index-8XDo0pla.d.mts +1065 -0
- package/dist/index-BVkmidEx.d.cts +1065 -0
- package/dist/{index-C1Ojam4M.d.cts → index-BguFn1Xj.d.cts} +62 -3
- package/dist/{index-C0v9GTM7.d.mts → index-kNcUiDBd.d.mts} +62 -3
- package/dist/pipelines/index.d.cts +1 -1
- package/dist/pipelines/index.d.mts +1 -1
- package/dist/pipelines/index.mjs +1 -1
- package/dist/systems/index.cjs +2 -2
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +2 -2
- package/dist/systems/index.d.mts +2 -2
- package/dist/systems/index.mjs +1 -1
- package/dist/systems/index.mjs.map +1 -1
- package/dist/utils/index.cjs +2 -3
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +3 -3
- package/dist/utils/index.d.mts +3 -3
- package/dist/utils/index.mjs +1 -2
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/index-BQojRXVz.d.cts +0 -224
- package/dist/index-CrMUhuEK.d.cts +0 -544
- package/dist/index-Cs9Eerjt.d.cts +0 -175
- package/dist/index-DQYLun1o.d.mts +0 -544
- package/dist/index-DeYfvKO0.d.mts +0 -224
- package/dist/index-hHkhvmkO.d.mts +0 -175
- package/dist/types-CnDtpKsY.d.mts +0 -70
- package/dist/types-DLOd2zXO.d.cts +0 -70
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { n as Immutable } from "./types-CnDtpKsY.mjs";
|
|
2
|
-
import { r as PerformanceTimeEntry } from "./index-hHkhvmkO.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/pipelines/pipeline-context.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Base interface for all pipeline context objects.
|
|
7
|
-
* Provides hooks for runtime state and control flow during pipeline execution.
|
|
8
|
-
*/
|
|
9
|
-
interface IPipelineContext {
|
|
10
|
-
/**
|
|
11
|
-
* The runtime state and control interface for the pipeline.
|
|
12
|
-
* Allows middleware to query and influence pipeline behavior.
|
|
13
|
-
*/
|
|
14
|
-
readonly runtime?: PipelineRuntime;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Runtime state and control interface for pipeline execution.
|
|
18
|
-
* Allows middleware to query status and influence pipeline flow.
|
|
19
|
-
*/
|
|
20
|
-
type PipelineRuntime = {
|
|
21
|
-
/**
|
|
22
|
-
* Flag to request pipeline halt.
|
|
23
|
-
* Set to true to stop executing remaining middleware (cleanup still runs).
|
|
24
|
-
*/
|
|
25
|
-
shouldStop?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Optional error state if an exception occurred during execution.
|
|
28
|
-
*/
|
|
29
|
-
error?: any;
|
|
30
|
-
/**
|
|
31
|
-
* Results collected from middleware execution.
|
|
32
|
-
* Typically includes performance metrics and operational results.
|
|
33
|
-
*/
|
|
34
|
-
readonly metrics?: PerformanceTimeEntry[];
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/pipelines/middleware.d.ts
|
|
38
|
-
/**
|
|
39
|
-
* The basic unit of work in a pipeline.
|
|
40
|
-
* Middleware are chained together to form processing pipelines.
|
|
41
|
-
* Each middleware can inspect/modify context during dispatch and perform cleanup on their changes.
|
|
42
|
-
*
|
|
43
|
-
* @template TContext The context type passed through the middleware chain.
|
|
44
|
-
*/
|
|
45
|
-
interface IMiddleware<TContext extends IPipelineContext> {
|
|
46
|
-
/**
|
|
47
|
-
* Optional name for debugging and logging purposes.
|
|
48
|
-
*/
|
|
49
|
-
readonly name?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Optional guard condition before running the action.
|
|
52
|
-
* Allows middleware to skip execution based on context state.
|
|
53
|
-
* @param context The current pipeline context.
|
|
54
|
-
* @returns True to execute action, false to skip.
|
|
55
|
-
*/
|
|
56
|
-
shouldRun?(context: TContext): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* The main unit of work executed as part of the pipeline.
|
|
59
|
-
* Middlewares execute in registration order during dispatch phase.
|
|
60
|
-
* Can read and modify the context to influence downstream middleware and results.
|
|
61
|
-
* @param context The pipeline context containing all relevant state.
|
|
62
|
-
*/
|
|
63
|
-
action(context: TContext): void | Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* Optional cleanup function executed during pipeline teardown.
|
|
66
|
-
* Middlewares execute in reverse registration order during cleanup phase.
|
|
67
|
-
* Used to release resources, clear temporary state, and perform final operations.
|
|
68
|
-
* @param context The pipeline context (may be in modified state from action phases).
|
|
69
|
-
*/
|
|
70
|
-
cleanup?(context: TContext): void | Promise<void>;
|
|
71
|
-
}
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/pipelines/middleware-runner.d.ts
|
|
74
|
-
/**
|
|
75
|
-
* Customizes how middleware is executed within a pipeline.
|
|
76
|
-
* Allows decorators to wrap, intercept, or modify middleware execution behavior.
|
|
77
|
-
* Useful for implementing middleware decorators (logging, timing, error handling, etc.).
|
|
78
|
-
*
|
|
79
|
-
* @template TContext The type of context passed to middleware.
|
|
80
|
-
*/
|
|
81
|
-
interface IMiddlewareRunner<TContext extends IPipelineContext> {
|
|
82
|
-
/**
|
|
83
|
-
* Decides how to execute a middleware's action.
|
|
84
|
-
* Can add pre/post processing, error handling, or performance tracking around the middleware.
|
|
85
|
-
* @param context The current pipeline context.
|
|
86
|
-
* @param middleware The middleware whose action should be executed.
|
|
87
|
-
*/
|
|
88
|
-
dispatch(context: TContext, middleware: IMiddleware<TContext>): void | Promise<void>;
|
|
89
|
-
/**
|
|
90
|
-
* Decides how to execute a middleware's cleanup.
|
|
91
|
-
* Can add pre/post processing or error handling around cleanup operations.
|
|
92
|
-
* @param context The current pipeline context.
|
|
93
|
-
* @param middleware The middleware whose cleanup should be executed.
|
|
94
|
-
*/
|
|
95
|
-
cleanup(context: TContext, middleware: IMiddleware<TContext>): void | Promise<void>;
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/pipelines/pipeline.d.ts
|
|
99
|
-
/**
|
|
100
|
-
* A composable middleware chain for ordered execution of operations.
|
|
101
|
-
* Pipelines provide a framework for registering and executing middleware with dispatch and cleanup phases.
|
|
102
|
-
* Used throughout the ECS system for entity initialization, updates, rendering, and synchronization.
|
|
103
|
-
*
|
|
104
|
-
* @template TContext - The context type passed to all registered middleware.
|
|
105
|
-
*/
|
|
106
|
-
interface IPipeline<TContext extends IPipelineContext> {
|
|
107
|
-
/**
|
|
108
|
-
* The pipeline's name, useful for debugging and logging.
|
|
109
|
-
*/
|
|
110
|
-
readonly name?: string;
|
|
111
|
-
/**
|
|
112
|
-
* The number of middleware currently registered in this pipeline.
|
|
113
|
-
*/
|
|
114
|
-
readonly length?: number;
|
|
115
|
-
/**
|
|
116
|
-
* Direct access to the ordered list of registered middleware.
|
|
117
|
-
* Allows inspection of the execution chain.
|
|
118
|
-
*/
|
|
119
|
-
readonly middleware?: Immutable<IMiddleware<TContext>[]>;
|
|
120
|
-
/**
|
|
121
|
-
* Registers middleware to be executed as part of this pipeline.
|
|
122
|
-
* Middleware is added to the end of the chain and executed in registration order during dispatch.
|
|
123
|
-
* @param middleware - The middleware to register.
|
|
124
|
-
* @returns This instance for method chaining.
|
|
125
|
-
*/
|
|
126
|
-
use(middleware: Immutable<IMiddleware<TContext>>): this;
|
|
127
|
-
/**
|
|
128
|
-
* Executes the dispatch phase with all registered middleware in order.
|
|
129
|
-
* Each middleware's action is called, allowing modifications to context state.
|
|
130
|
-
* Execution continues until all middleware complete or a middleware requests early termination.
|
|
131
|
-
* @param context - The context object passed to all middleware.
|
|
132
|
-
*/
|
|
133
|
-
dispatch(context: Partial<TContext>): void | Promise<void>;
|
|
134
|
-
/**
|
|
135
|
-
* Executes the cleanup phase with all registered middleware in reverse order.
|
|
136
|
-
* Allows middleware to perform resource cleanup and final operations.
|
|
137
|
-
* Typically called after dispatch to ensure proper teardown.
|
|
138
|
-
*
|
|
139
|
-
* @param context - The context object that will be passed to each middleware function.
|
|
140
|
-
*/
|
|
141
|
-
cleanup(context: Partial<TContext>): void | Promise<void>;
|
|
142
|
-
}
|
|
143
|
-
//#endregion
|
|
144
|
-
//#region src/pipelines/pipeline-nested.d.ts
|
|
145
|
-
/**
|
|
146
|
-
* Context for a parent pipeline containing nested pipelines.
|
|
147
|
-
* Allows coordination between outer and inner pipeline execution.
|
|
148
|
-
*
|
|
149
|
-
* @template N - The context type for the nested pipelines.
|
|
150
|
-
*/
|
|
151
|
-
interface IParentContext<N extends IPipelineContext> extends IPipelineContext {
|
|
152
|
-
/**
|
|
153
|
-
* The nested pipeline to execute for each context in nestedContexts.
|
|
154
|
-
*/
|
|
155
|
-
readonly nestedPipeline: IPipeline<INestedContext<this>>;
|
|
156
|
-
/**
|
|
157
|
-
* Contexts to pass to the nested pipeline.
|
|
158
|
-
* The parent pipeline iterates these and executes the nested pipeline for each.
|
|
159
|
-
*/
|
|
160
|
-
readonly nestedContexts: Partial<N>[];
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Context for a nested pipeline.
|
|
164
|
-
* Provides access to both current and previous nested context data plus the parent context.
|
|
165
|
-
*
|
|
166
|
-
* @template P - The context type of the parent pipeline.
|
|
167
|
-
*/
|
|
168
|
-
interface INestedContext<P extends IParentContext<any>> extends IPipelineContext {
|
|
169
|
-
/**
|
|
170
|
-
* The current context item being processed in the nested pipeline.
|
|
171
|
-
*/
|
|
172
|
-
readonly current: P extends IParentContext<infer N> ? N : never;
|
|
173
|
-
/**
|
|
174
|
-
* The previous context item (if this is not the first iteration).
|
|
175
|
-
*/
|
|
176
|
-
readonly previous?: P extends IParentContext<infer N> ? N : never;
|
|
177
|
-
/**
|
|
178
|
-
* Reference back to the parent pipeline context.
|
|
179
|
-
*/
|
|
180
|
-
readonly parent: P;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Middleware executing within a nested pipeline.
|
|
184
|
-
*
|
|
185
|
-
* @template P - The context type of the parent pipeline.
|
|
186
|
-
*/
|
|
187
|
-
type INestedMiddleware<P extends IParentContext<any>> = IMiddleware<INestedContext<P>>;
|
|
188
|
-
/**
|
|
189
|
-
* Middleware executing within a parent pipeline (containing nested pipelines).
|
|
190
|
-
*
|
|
191
|
-
* @template P - The context type of the parent pipeline.
|
|
192
|
-
*/
|
|
193
|
-
type IParentMiddleware<P extends IParentContext<any>> = IMiddleware<P>;
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region src/pipelines/pipeline-runner.d.ts
|
|
196
|
-
/**
|
|
197
|
-
* Executes an array of middleware in a controlled sequence.
|
|
198
|
-
* Supports custom execution strategies through implementation flexibility.
|
|
199
|
-
* Used by pipelines to manage complex middleware chains with features like early termination and nested pipelines.
|
|
200
|
-
*
|
|
201
|
-
* @template TContext - The context type passed to all middleware.
|
|
202
|
-
*/
|
|
203
|
-
interface IPipelineRunner<TContext extends IPipelineContext> {
|
|
204
|
-
/**
|
|
205
|
-
* Executes the action phase of all middleware in sequence.
|
|
206
|
-
* Middleware at startIndex and onward are executed in order.
|
|
207
|
-
* Execution may terminate early if middleware requests it via context.runtime.shouldStop.
|
|
208
|
-
* @param context - The context passed to each middleware action.
|
|
209
|
-
* @param middleware - The ordered middleware array to execute.
|
|
210
|
-
* @param startIndex - Optional starting position in the middleware array (default: 0).
|
|
211
|
-
*/
|
|
212
|
-
dispatch(context: Partial<TContext>, middleware: IMiddleware<TContext>[], startIndex?: number): void | Promise<void>;
|
|
213
|
-
/**
|
|
214
|
-
* Executes the cleanup phase of all middleware in reverse order.
|
|
215
|
-
* All middleware cleanup functions are called (if defined), regardless of errors.
|
|
216
|
-
* Allows proper resource release and final state management.
|
|
217
|
-
* @param context - The context passed to each middleware cleanup.
|
|
218
|
-
* @param middleware - The ordered middleware array for cleanup (reversed during execution).
|
|
219
|
-
*/
|
|
220
|
-
cleanup(context: Partial<TContext>, middleware: IMiddleware<TContext>[]): void | Promise<void>;
|
|
221
|
-
}
|
|
222
|
-
//#endregion
|
|
223
|
-
export { IParentMiddleware as a, IMiddleware as c, IParentContext as i, IPipelineContext as l, INestedContext as n, IPipeline as o, INestedMiddleware as r, IMiddlewareRunner as s, IPipelineRunner as t, PipelineRuntime as u };
|
|
224
|
-
//# sourceMappingURL=index-DeYfvKO0.d.mts.map
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
//#region src/utils/dispatch-sequential.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Executes a function for each item in an iterable, sequentially.
|
|
4
|
-
*
|
|
5
|
-
* Uses a sync fast-path: iterates synchronously until the first Promise is
|
|
6
|
-
* encountered, then switches to async for the remainder. If no item produces
|
|
7
|
-
* a Promise, the entire call stays synchronous with zero async overhead.
|
|
8
|
-
*
|
|
9
|
-
* @param items - The iterable to iterate over.
|
|
10
|
-
* @param fn - The function to call for each item. May return void or a Promise.
|
|
11
|
-
* @returns void if all calls were synchronous, or a Promise if any were async.
|
|
12
|
-
*/
|
|
13
|
-
declare function dispatchSequential<T>(items: Iterable<T>, fn: (item: T) => void | Promise<void>): void | Promise<void>;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/utils/json-serializer.d.ts
|
|
16
|
-
/**
|
|
17
|
-
* Custom JSON serialization and deserialization interface.
|
|
18
|
-
* Allows different serialization strategies for handling complex types.
|
|
19
|
-
* Used for entity snapshots, events, and any data needing JSON conversion.
|
|
20
|
-
*/
|
|
21
|
-
interface IJsonSerializer {
|
|
22
|
-
/**
|
|
23
|
-
* Converts an object to a serializable JSON representation.
|
|
24
|
-
* Handles types that don't serialize naturally (dates, maps, custom objects, etc.).
|
|
25
|
-
* @param value - The object to serialize.
|
|
26
|
-
* @returns A JSON-serializable representation.
|
|
27
|
-
*/
|
|
28
|
-
serializeCustom(value: object): string;
|
|
29
|
-
/**
|
|
30
|
-
* Converts a JSON string back to its original object type.
|
|
31
|
-
* Reconstructs complex types from their serialized form.
|
|
32
|
-
* @template TObject - The target object type.
|
|
33
|
-
* @param text - The JSON string to deserialize.
|
|
34
|
-
* @returns The deserialized object of the specified type.
|
|
35
|
-
*/
|
|
36
|
-
parseCustom<TObject>(text: string): TObject;
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/utils/logger.d.ts
|
|
40
|
-
/**
|
|
41
|
-
* Logger interface for debug and diagnostic output.
|
|
42
|
-
* Supports multiple log levels for controlling verbosity.
|
|
43
|
-
* Implementations can target different outputs (console, file, remote, etc.).
|
|
44
|
-
*/
|
|
45
|
-
interface ILogger {
|
|
46
|
-
/**
|
|
47
|
-
* Logs a message with a specified severity level.
|
|
48
|
-
* @param level - The severity level of the message.
|
|
49
|
-
* @param message - The primary message content.
|
|
50
|
-
* @param args - Additional arguments to include in the log output.
|
|
51
|
-
*/
|
|
52
|
-
log(level: LogLevel, message: any, ...args: any[]): void;
|
|
53
|
-
/**
|
|
54
|
-
* Logs detailed diagnostic information.
|
|
55
|
-
* Typically the lowest level, most verbose output.
|
|
56
|
-
* @param message - The message to log.
|
|
57
|
-
* @param args - Additional data.
|
|
58
|
-
*/
|
|
59
|
-
trace(message: any, ...args: any[]): void;
|
|
60
|
-
/**
|
|
61
|
-
* Logs debug-level information.
|
|
62
|
-
* Useful during development and troubleshooting.
|
|
63
|
-
* @param message - The message to log.
|
|
64
|
-
* @param args - Additional data.
|
|
65
|
-
*/
|
|
66
|
-
debug(message: any, ...args: any[]): void;
|
|
67
|
-
/**
|
|
68
|
-
* Logs warning-level messages.
|
|
69
|
-
* Indicates potentially problematic conditions.
|
|
70
|
-
* @param message - The message to log.
|
|
71
|
-
* @param args - Additional data.
|
|
72
|
-
*/
|
|
73
|
-
warn(message: any, ...args: any[]): void;
|
|
74
|
-
/**
|
|
75
|
-
* Logs error-level messages.
|
|
76
|
-
* Indicates error conditions that may require attention.
|
|
77
|
-
* @param message - The message to log.
|
|
78
|
-
* @param args - Additional data.
|
|
79
|
-
*/
|
|
80
|
-
error(message: any, ...args: any[]): void;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Logging severity levels in increasing order.
|
|
84
|
-
*/
|
|
85
|
-
declare enum LogLevel {
|
|
86
|
-
/**
|
|
87
|
-
* Most detailed, diagnostic-level logging.
|
|
88
|
-
*/
|
|
89
|
-
trace = 0,
|
|
90
|
-
/**
|
|
91
|
-
* Development and debugging information.
|
|
92
|
-
*/
|
|
93
|
-
debug = 1,
|
|
94
|
-
/**
|
|
95
|
-
* Warning-level conditions.
|
|
96
|
-
*/
|
|
97
|
-
warn = 2,
|
|
98
|
-
/**
|
|
99
|
-
* Error-level conditions.
|
|
100
|
-
*/
|
|
101
|
-
error = 3
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Configuration options for logger instances.
|
|
105
|
-
*/
|
|
106
|
-
interface ILoggerOptions {
|
|
107
|
-
/**
|
|
108
|
-
* Enables/disables each log level.
|
|
109
|
-
* If a level is disabled, log calls at that level are ignored.
|
|
110
|
-
*/
|
|
111
|
-
enabled: Map<LogLevel, boolean>;
|
|
112
|
-
}
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/utils/performance-timer.d.ts
|
|
115
|
-
/**
|
|
116
|
-
* Unique identifier for a timer instance.
|
|
117
|
-
*/
|
|
118
|
-
type PerformanceTimerUid = number;
|
|
119
|
-
/**
|
|
120
|
-
* Options for identifying and categorizing performance metrics.
|
|
121
|
-
* Used by pipeline factories and performance decorators.
|
|
122
|
-
*/
|
|
123
|
-
type PerformanceMetricOptions = {
|
|
124
|
-
name?: string;
|
|
125
|
-
category?: string;
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* Record of a completed timer measurement.
|
|
129
|
-
* Captures timing information for performance analysis and profiling.
|
|
130
|
-
*/
|
|
131
|
-
interface PerformanceTimeEntry {
|
|
132
|
-
/**
|
|
133
|
-
* The name identifying this timer.
|
|
134
|
-
*/
|
|
135
|
-
name: string;
|
|
136
|
-
/**
|
|
137
|
-
* The category of this metric (e.g. 'module', 'runtime', 'system').
|
|
138
|
-
*/
|
|
139
|
-
category?: string;
|
|
140
|
-
/**
|
|
141
|
-
* Timestamp in milliseconds when the timer started.
|
|
142
|
-
*/
|
|
143
|
-
startedAt: number;
|
|
144
|
-
/**
|
|
145
|
-
* Timestamp in milliseconds when the timer ended.
|
|
146
|
-
*/
|
|
147
|
-
endedAt?: number;
|
|
148
|
-
/**
|
|
149
|
-
* Duration in milliseconds that elapsed.
|
|
150
|
-
*/
|
|
151
|
-
msPassed?: number;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Interface for measuring operation duration.
|
|
155
|
-
* Provides start/stop functionality for performance profiling.
|
|
156
|
-
* Used throughout the system to collect timing metrics.
|
|
157
|
-
*/
|
|
158
|
-
interface IPerformanceTimer {
|
|
159
|
-
/**
|
|
160
|
-
* Starts a new timer.
|
|
161
|
-
* @param name - Label for this timer (used in results).
|
|
162
|
-
* @param category - Optional category for grouping metrics.
|
|
163
|
-
* @returns A unique identifier for this timer instance.
|
|
164
|
-
*/
|
|
165
|
-
startTimer(name: string, category?: string): PerformanceTimerUid;
|
|
166
|
-
/**
|
|
167
|
-
* Stops a timer and returns the recorded metrics.
|
|
168
|
-
* @param timerUid - The timer identifier returned by startTimer.
|
|
169
|
-
* @returns Complete timing entry with start, end, and duration.
|
|
170
|
-
*/
|
|
171
|
-
endTimer(timerUid: PerformanceTimerUid): PerformanceTimeEntry;
|
|
172
|
-
}
|
|
173
|
-
//#endregion
|
|
174
|
-
export { ILogger as a, IJsonSerializer as c, PerformanceTimerUid as i, dispatchSequential as l, PerformanceMetricOptions as n, ILoggerOptions as o, PerformanceTimeEntry as r, LogLevel as s, IPerformanceTimer as t };
|
|
175
|
-
//# sourceMappingURL=index-hHkhvmkO.d.mts.map
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
//#region src/utils/types.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Maps all properties of a type to boolean flags.
|
|
4
|
-
* Useful for feature flags, capability indicators, or boolean option sets.
|
|
5
|
-
*
|
|
6
|
-
* @template T - The type whose properties are mapped to booleans.
|
|
7
|
-
* @example type Features = BooleanProps<{health: any; armor: any}>; // => {health: boolean, armor: boolean}
|
|
8
|
-
*/
|
|
9
|
-
type BooleanProps<T> = { [Property in keyof T]: boolean };
|
|
10
|
-
/**
|
|
11
|
-
* Removes readonly modifiers from all properties, making them mutable.
|
|
12
|
-
* One level of immutability removal (see MutableDeep for recursive removal).
|
|
13
|
-
*
|
|
14
|
-
* @template T - The type to make mutable.
|
|
15
|
-
* @example type Mut = Mutable<{readonly x: number}>; // => {x: number}
|
|
16
|
-
*/
|
|
17
|
-
type Mutable<T> = { -readonly [K in keyof T]: T[K] };
|
|
18
|
-
/**
|
|
19
|
-
* Recursively removes readonly modifiers from all properties at all nesting levels.
|
|
20
|
-
* Makes entire object graph mutable.
|
|
21
|
-
*
|
|
22
|
-
* @template T - The type to make mutable recursively.
|
|
23
|
-
*/
|
|
24
|
-
type MutableDeep<T> = { -readonly [K in keyof T]: Mutable<T[K]> };
|
|
25
|
-
type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
|
|
26
|
-
/**
|
|
27
|
-
* Makes a type fully immutable at the top level only.
|
|
28
|
-
* Primitives and functions remain unchanged.
|
|
29
|
-
* Collections (Array, Map, Set) become readonly.
|
|
30
|
-
* Objects have their properties made readonly.
|
|
31
|
-
*
|
|
32
|
-
* @template T - The type to make immutable.
|
|
33
|
-
* @example type Imm = Immutable<{x: number}>; // => {readonly x: number}
|
|
34
|
-
*/
|
|
35
|
-
type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
|
|
36
|
-
/**
|
|
37
|
-
* Readonly array variant for use in Immutable type transformation.
|
|
38
|
-
*
|
|
39
|
-
* @template T - Element type of the array.
|
|
40
|
-
*/
|
|
41
|
-
type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
|
|
42
|
-
/**
|
|
43
|
-
* Readonly map variant for use in Immutable type transformation.
|
|
44
|
-
*
|
|
45
|
-
* @template K - Key type of the map.
|
|
46
|
-
* @template V - Value type of the map.
|
|
47
|
-
*/
|
|
48
|
-
type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
|
|
49
|
-
/**
|
|
50
|
-
* Readonly set variant for use in Immutable type transformation.
|
|
51
|
-
*
|
|
52
|
-
* @template T - Element type of the set.
|
|
53
|
-
*/
|
|
54
|
-
type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
|
|
55
|
-
/**
|
|
56
|
-
* Makes all object properties readonly (one level only).
|
|
57
|
-
*
|
|
58
|
-
* @template T - The type to make immutable.
|
|
59
|
-
*/
|
|
60
|
-
type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
|
|
61
|
-
/**
|
|
62
|
-
* Recursively makes all properties readonly at all nesting levels.
|
|
63
|
-
* Provides complete immutability guarantee for the entire object graph.
|
|
64
|
-
*
|
|
65
|
-
* @template T - The type to make deeply immutable.
|
|
66
|
-
*/
|
|
67
|
-
type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
|
|
68
|
-
//#endregion
|
|
69
|
-
export { ImmutableObject as a, Mutable as c, ImmutableMap as i, MutableDeep as l, Immutable as n, ImmutableObjectDeep as o, ImmutableArray as r, ImmutableSet as s, BooleanProps as t };
|
|
70
|
-
//# sourceMappingURL=types-CnDtpKsY.d.mts.map
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
//#region src/utils/types.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Maps all properties of a type to boolean flags.
|
|
4
|
-
* Useful for feature flags, capability indicators, or boolean option sets.
|
|
5
|
-
*
|
|
6
|
-
* @template T - The type whose properties are mapped to booleans.
|
|
7
|
-
* @example type Features = BooleanProps<{health: any; armor: any}>; // => {health: boolean, armor: boolean}
|
|
8
|
-
*/
|
|
9
|
-
type BooleanProps<T> = { [Property in keyof T]: boolean };
|
|
10
|
-
/**
|
|
11
|
-
* Removes readonly modifiers from all properties, making them mutable.
|
|
12
|
-
* One level of immutability removal (see MutableDeep for recursive removal).
|
|
13
|
-
*
|
|
14
|
-
* @template T - The type to make mutable.
|
|
15
|
-
* @example type Mut = Mutable<{readonly x: number}>; // => {x: number}
|
|
16
|
-
*/
|
|
17
|
-
type Mutable<T> = { -readonly [K in keyof T]: T[K] };
|
|
18
|
-
/**
|
|
19
|
-
* Recursively removes readonly modifiers from all properties at all nesting levels.
|
|
20
|
-
* Makes entire object graph mutable.
|
|
21
|
-
*
|
|
22
|
-
* @template T - The type to make mutable recursively.
|
|
23
|
-
*/
|
|
24
|
-
type MutableDeep<T> = { -readonly [K in keyof T]: Mutable<T[K]> };
|
|
25
|
-
type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
|
|
26
|
-
/**
|
|
27
|
-
* Makes a type fully immutable at the top level only.
|
|
28
|
-
* Primitives and functions remain unchanged.
|
|
29
|
-
* Collections (Array, Map, Set) become readonly.
|
|
30
|
-
* Objects have their properties made readonly.
|
|
31
|
-
*
|
|
32
|
-
* @template T - The type to make immutable.
|
|
33
|
-
* @example type Imm = Immutable<{x: number}>; // => {readonly x: number}
|
|
34
|
-
*/
|
|
35
|
-
type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
|
|
36
|
-
/**
|
|
37
|
-
* Readonly array variant for use in Immutable type transformation.
|
|
38
|
-
*
|
|
39
|
-
* @template T - Element type of the array.
|
|
40
|
-
*/
|
|
41
|
-
type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
|
|
42
|
-
/**
|
|
43
|
-
* Readonly map variant for use in Immutable type transformation.
|
|
44
|
-
*
|
|
45
|
-
* @template K - Key type of the map.
|
|
46
|
-
* @template V - Value type of the map.
|
|
47
|
-
*/
|
|
48
|
-
type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
|
|
49
|
-
/**
|
|
50
|
-
* Readonly set variant for use in Immutable type transformation.
|
|
51
|
-
*
|
|
52
|
-
* @template T - Element type of the set.
|
|
53
|
-
*/
|
|
54
|
-
type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
|
|
55
|
-
/**
|
|
56
|
-
* Makes all object properties readonly (one level only).
|
|
57
|
-
*
|
|
58
|
-
* @template T - The type to make immutable.
|
|
59
|
-
*/
|
|
60
|
-
type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
|
|
61
|
-
/**
|
|
62
|
-
* Recursively makes all properties readonly at all nesting levels.
|
|
63
|
-
* Provides complete immutability guarantee for the entire object graph.
|
|
64
|
-
*
|
|
65
|
-
* @template T - The type to make deeply immutable.
|
|
66
|
-
*/
|
|
67
|
-
type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
|
|
68
|
-
//#endregion
|
|
69
|
-
export { ImmutableObject as a, Mutable as c, ImmutableMap as i, MutableDeep as l, Immutable as n, ImmutableObjectDeep as o, ImmutableArray as r, ImmutableSet as s, BooleanProps as t };
|
|
70
|
-
//# sourceMappingURL=types-DLOd2zXO.d.cts.map
|