@adaas/a-utils 0.1.29 → 0.1.30

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.ts CHANGED
@@ -1045,6 +1045,13 @@ declare const A_LoggerEnvVariables: {
1045
1045
  declare const A_LoggerEnvVariablesArray: readonly ["A_LOGGER_LEVEL", "A_LOGGER_DEFAULT_SCOPE_LENGTH", "A_LOGGER_DEFAULT_SCOPE_COLOR", "A_LOGGER_DEFAULT_LOG_COLOR"];
1046
1046
  type A_LoggerEnvVariablesType = (typeof A_LoggerEnvVariables)[keyof typeof A_LoggerEnvVariables][];
1047
1047
 
1048
+ type A_LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'all';
1049
+ /**
1050
+ * Available color names for the logger
1051
+ * Can be used as first parameter in logging methods to specify message color
1052
+ */
1053
+ type A_LoggerColorName = 'red' | 'yellow' | 'green' | 'blue' | 'cyan' | 'magenta' | 'gray' | 'brightBlue' | 'brightCyan' | 'brightMagenta' | 'darkGray' | 'lightGray' | 'indigo' | 'violet' | 'purple' | 'lavender' | 'skyBlue' | 'steelBlue' | 'slateBlue' | 'deepBlue' | 'lightBlue' | 'periwinkle' | 'cornflower' | 'powder' | 'charcoal' | 'silver' | 'smoke' | 'slate';
1054
+
1048
1055
  /**
1049
1056
  * A_Logger - Advanced Logging Component with Scope-based Output Formatting
1050
1057
  *
@@ -1073,7 +1080,15 @@ type A_LoggerEnvVariablesType = (typeof A_LoggerEnvVariables)[keyof typeof A_Log
1073
1080
  * doSomething() {
1074
1081
  * this.logger.info('Processing started'); // Uses scope-name-based colors, always shows
1075
1082
  * this.logger.debug('Debug information'); // Only shows when debug level enabled
1076
- * this.logger.info('green', 'Custom message color'); // Green message, scope stays default
1083
+ *
1084
+ * // Color overload methods with enum support
1085
+ * this.logger.info('green', 'Success message'); // Green message, scope stays default
1086
+ * this.logger.debug('gray', 'Verbose debug info'); // Gray message for less important info
1087
+ * this.logger.info('brightBlue', 'Important notification');
1088
+ *
1089
+ * // Terminal width aware formatting - automatically wraps long lines
1090
+ * this.logger.info('This is a very long message that will be automatically wrapped to fit within the terminal width while maintaining proper indentation and formatting');
1091
+ *
1077
1092
  * this.logger.warning('Something might be wrong');
1078
1093
  * this.logger.error(new Error('Something failed'));
1079
1094
  * }
@@ -1083,6 +1098,13 @@ type A_LoggerEnvVariablesType = (typeof A_LoggerEnvVariables)[keyof typeof A_Log
1083
1098
  * const logger1 = new A_Logger(new A_Scope({name: 'UserService'})); // Gets consistent colors
1084
1099
  * const logger2 = new A_Logger(new A_Scope({name: 'UserService'})); // Gets same colors as logger1
1085
1100
  *
1101
+ * // Available color names (A_LoggerColorName enum):
1102
+ * // 'red', 'yellow', 'green', 'blue', 'cyan', 'magenta', 'gray',
1103
+ * // 'brightBlue', 'brightCyan', 'brightMagenta', 'darkGray', 'lightGray',
1104
+ * // 'indigo', 'violet', 'purple', 'lavender', 'skyBlue', 'steelBlue',
1105
+ * // 'slateBlue', 'deepBlue', 'lightBlue', 'periwinkle', 'cornflower',
1106
+ * // 'powder', 'charcoal', 'silver', 'smoke', 'slate'
1107
+ *
1086
1108
  * // Configuration via environment variables or A_Config (overrides automatic selection)
1087
1109
  * process.env.A_LOGGER_DEFAULT_SCOPE_COLOR = 'magenta';
1088
1110
  * process.env.A_LOGGER_DEFAULT_LOG_COLOR = 'green';
@@ -1119,6 +1141,16 @@ declare class A_Logger extends A_Component {
1119
1141
  * This color is used for the message body when logging without specifying a color
1120
1142
  */
1121
1143
  private readonly DEFAULT_LOG_COLOR;
1144
+ /**
1145
+ * Current terminal width for responsive formatting
1146
+ * Automatically detected or falls back to default values
1147
+ */
1148
+ private readonly TERMINAL_WIDTH;
1149
+ /**
1150
+ * Maximum content width based on terminal size
1151
+ * Used for word wrapping and line length calculations
1152
+ */
1153
+ private readonly MAX_CONTENT_WIDTH;
1122
1154
  /**
1123
1155
  * Initialize A_Logger with dependency injection
1124
1156
  * Colors are configured through A_Config or generated randomly if not provided
@@ -1151,6 +1183,34 @@ declare class A_Logger extends A_Component {
1151
1183
  * @returns Object with scopeColor and logColor that work well together
1152
1184
  */
1153
1185
  private generateComplementaryColorsFromScope;
1186
+ /**
1187
+ * Detect current terminal width based on environment
1188
+ *
1189
+ * Returns appropriate width for different environments:
1190
+ * - Node.js: Uses process.stdout.columns if available
1191
+ * - Browser: Returns browser default width
1192
+ * - Fallback: Returns default terminal width
1193
+ *
1194
+ * @returns Terminal width in characters
1195
+ */
1196
+ private detectTerminalWidth;
1197
+ /**
1198
+ * Wrap text to fit within terminal width while preserving formatting
1199
+ *
1200
+ * @param text - Text to wrap
1201
+ * @param scopePadding - The scope padding string for alignment
1202
+ * @param isFirstLine - Whether this is the first line (affects available width calculation)
1203
+ * @returns Array of wrapped lines with proper indentation
1204
+ */
1205
+ private wrapText;
1206
+ /**
1207
+ * Split a long word that doesn't fit on a single line
1208
+ *
1209
+ * @param word - Word to split
1210
+ * @param maxLength - Maximum length per chunk
1211
+ * @returns Array of word chunks
1212
+ */
1213
+ private splitLongWord;
1154
1214
  /**
1155
1215
  * Get the formatted scope length for consistent message alignment
1156
1216
  * Uses a standard length to ensure all messages align properly regardless of scope name
@@ -1176,20 +1236,28 @@ declare class A_Logger extends A_Component {
1176
1236
  *
1177
1237
  * @param messageColor - The color key to apply to the message content
1178
1238
  * @param args - Variable arguments to format and display
1179
- * @returns Array of formatted strings ready for console output
1239
+ * @returns Array of formatted strings and/or objects ready for console output
1180
1240
  */
1181
- compile(messageColor: keyof typeof this.COLORS, ...args: any[]): Array<string>;
1241
+ compile(messageColor: keyof typeof this.COLORS, ...args: any[]): Array<any>;
1182
1242
  /**
1183
- * Format an object for display with proper JSON indentation
1243
+ * Format an object for display with proper JSON indentation and terminal width awareness
1184
1244
  *
1185
1245
  * @param obj - The object to format
1186
1246
  * @param shouldAddNewline - Whether to add a newline prefix
1187
1247
  * @param scopePadding - The padding string for consistent alignment
1188
- * @returns Formatted object string
1248
+ * @returns Formatted object string or the object itself for browser environments
1189
1249
  */
1190
1250
  private formatObject;
1191
1251
  /**
1192
- * Format a string for display with proper indentation
1252
+ * Wrap a long JSON string value while preserving readability
1253
+ *
1254
+ * @param value - The string value to wrap
1255
+ * @param maxWidth - Maximum width for the value
1256
+ * @returns Wrapped string value
1257
+ */
1258
+ private wrapJsonStringValue;
1259
+ /**
1260
+ * Format a string for display with proper indentation and terminal width wrapping
1193
1261
  *
1194
1262
  * @param str - The string to format
1195
1263
  * @param shouldAddNewline - Whether to add a newline prefix
@@ -1222,7 +1290,7 @@ declare class A_Logger extends A_Component {
1222
1290
  * Note: The scope color always remains the instance's default scope color,
1223
1291
  * only the message content color changes when explicitly specified.
1224
1292
  *
1225
- * @param color - Optional color key or the first message argument
1293
+ * @param color - Optional color name from A_LoggerColorName enum or the first message argument
1226
1294
  * @param args - Additional arguments to log
1227
1295
  *
1228
1296
  * @example
@@ -1232,7 +1300,7 @@ declare class A_Logger extends A_Component {
1232
1300
  * logger.debug('Processing user:', { id: 1, name: 'John' });
1233
1301
  * ```
1234
1302
  */
1235
- debug(color: keyof typeof this.COLORS, ...args: any[]): void;
1303
+ debug(color: A_LoggerColorName, ...args: any[]): void;
1236
1304
  debug(...args: any[]): void;
1237
1305
  /**
1238
1306
  * Info logging method with optional color specification
@@ -1245,7 +1313,7 @@ declare class A_Logger extends A_Component {
1245
1313
  * Note: The scope color always remains the instance's default scope color,
1246
1314
  * only the message content color changes when explicitly specified.
1247
1315
  *
1248
- * @param color - Optional color key or the first message argument
1316
+ * @param color - Optional color name from A_LoggerColorName enum or the first message argument
1249
1317
  * @param args - Additional arguments to log
1250
1318
  *
1251
1319
  * @example
@@ -1255,16 +1323,16 @@ declare class A_Logger extends A_Component {
1255
1323
  * logger.info('Processing user:', { id: 1, name: 'John' });
1256
1324
  * ```
1257
1325
  */
1258
- info(color: keyof typeof this.COLORS, ...args: any[]): void;
1326
+ info(color: A_LoggerColorName, ...args: any[]): void;
1259
1327
  info(...args: any[]): void;
1260
1328
  /**
1261
1329
  * Legacy log method (kept for backward compatibility)
1262
1330
  * @deprecated Use info() method instead
1263
1331
  *
1264
- * @param color - Optional color key or the first message argument
1332
+ * @param color - Optional color name from A_LoggerColorName enum or the first message argument
1265
1333
  * @param args - Additional arguments to log
1266
1334
  */
1267
- log(color: keyof typeof this.COLORS, ...args: any[]): void;
1335
+ log(color: A_LoggerColorName, ...args: any[]): void;
1268
1336
  log(...args: any[]): void;
1269
1337
  /**
1270
1338
  * Log warning messages with yellow color coding
@@ -1307,21 +1375,32 @@ declare class A_Logger extends A_Component {
1307
1375
  /**
1308
1376
  * Format A_Error instances for inline display within compiled messages
1309
1377
  *
1310
- * Provides detailed formatting for A_Error objects including:
1311
- * - Error code and message
1312
- * - Description and stack trace
1313
- * - Original error information (if wrapped)
1378
+ * Provides detailed formatting for A_Error objects with:
1379
+ * - Error code, message, and description
1380
+ * - Original error information FIRST (better UX for debugging)
1381
+ * - Stack traces with terminal width awareness
1314
1382
  * - Documentation links (if available)
1383
+ * - Consistent formatting with rest of logger
1315
1384
  *
1316
1385
  * @param error - The A_Error instance to format
1317
1386
  * @returns Formatted string ready for display
1318
1387
  */
1319
1388
  protected compile_A_Error(error: A_Error): string;
1389
+ /**
1390
+ * Format stack trace with proper terminal width wrapping and indentation
1391
+ *
1392
+ * @param stack - The stack trace string
1393
+ * @param baseIndent - Base indentation for continuation lines
1394
+ * @returns Array of formatted stack trace lines
1395
+ */
1396
+ private formatStackTrace;
1320
1397
  /**
1321
1398
  * Format standard Error instances for inline display within compiled messages
1322
1399
  *
1323
- * Converts standard JavaScript Error objects into a readable JSON format
1324
- * with proper indentation and stack trace formatting
1400
+ * Provides clean, readable formatting for standard JavaScript errors with:
1401
+ * - Terminal width aware message wrapping
1402
+ * - Properly formatted stack traces
1403
+ * - Consistent indentation with rest of logger
1325
1404
  *
1326
1405
  * @param error - The Error instance to format
1327
1406
  * @returns Formatted string ready for display
@@ -1954,8 +2033,6 @@ declare class FileConfigReader extends ConfigReader {
1954
2033
  read<T extends string>(variables?: Array<T>): Promise<Record<T, any>>;
1955
2034
  }
1956
2035
 
1957
- type A_LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'all';
1958
-
1959
2036
  /**
1960
2037
  * A-Logger Constants
1961
2038
  *
@@ -2036,6 +2113,18 @@ declare const A_LOGGER_FORMAT: {
2036
2113
  readonly INDENT_BASE: 3;
2037
2114
  readonly PIPE: "| ";
2038
2115
  };
2116
+ /**
2117
+ * Environment variable keys
2118
+ */
2119
+ /**
2120
+ * Terminal width configuration
2121
+ */
2122
+ declare const A_LOGGER_TERMINAL: {
2123
+ readonly DEFAULT_WIDTH: 80;
2124
+ readonly MIN_WIDTH: 40;
2125
+ readonly MAX_LINE_LENGTH_RATIO: 0.8;
2126
+ readonly BROWSER_DEFAULT_WIDTH: 120;
2127
+ };
2039
2128
  /**
2040
2129
  * Environment variable keys
2041
2130
  */
@@ -2343,6 +2432,298 @@ declare class A_Service extends A_Container {
2343
2432
  protected [A_ServiceFeatures.onError](error: A_Error, logger?: A_Logger, ...args: any[]): Promise<void>;
2344
2433
  }
2345
2434
 
2435
+ declare class A_Route<_TParams extends Record<string, any> = Record<string, any>, _TQuery extends Record<string, any> = Record<string, any>> extends A_Fragment {
2436
+ url: string;
2437
+ constructor(url: string | RegExp);
2438
+ /**
2439
+ * Returns path only without query and hash
2440
+ */
2441
+ get path(): string;
2442
+ /**
2443
+ * Returns array of parameter names in the route path
2444
+ */
2445
+ get params(): string[];
2446
+ /**
2447
+ * Returns protocol based on URL scheme
2448
+ */
2449
+ get protocol(): string;
2450
+ extractParams(url: string): _TParams;
2451
+ extractQuery(url: string): _TQuery;
2452
+ toString(): string;
2453
+ toRegExp(): RegExp;
2454
+ toAFeatureExtension(extensionScope?: Array<string>): RegExp;
2455
+ }
2456
+
2457
+ type A_SignalConfig_Init = {
2458
+ /**
2459
+ * An array defining the structure of the signal vector.
2460
+ *
2461
+ * Each entry corresponds to a signal component constructor.
2462
+ */
2463
+ structure?: Array<A_TYPES__Entity_Constructor<A_Signal>>;
2464
+ /**
2465
+ * A string representation of the structure for easier DI resolution.
2466
+ * Each signal's constructor name is used to form this string.
2467
+ * e.g. "['A_RouterWatcher', 'A_ScopeWatcher', 'A_LoggerWatcher']"
2468
+ * OR "A_RouterWatcher,A_ScopeWatcher,A_LoggerWatcher"
2469
+ */
2470
+ stringStructure?: string;
2471
+ };
2472
+ type A_SignalVector_Init<TSignalData extends Record<string, any> = Record<string, any>> = {
2473
+ structure: Array<A_TYPES__Entity_Constructor<A_Signal>>;
2474
+ values: TSignalData[];
2475
+ };
2476
+ type A_SignalVector_Serialized = A_TYPES__Entity_Serialized & {
2477
+ structure: string[];
2478
+ values: Array<Record<string, any>>;
2479
+ } & A_TYPES__Entity_Serialized;
2480
+ type A_Signal_Init<T extends Record<string, any> = Record<string, any>> = {
2481
+ /**
2482
+ * The signal name
2483
+ */
2484
+ name?: string;
2485
+ /**
2486
+ * The signal data
2487
+ */
2488
+ data: T;
2489
+ };
2490
+
2491
+ /**
2492
+ * A Signal Entity is an individual signal instance that carries data.
2493
+ * Signals is a event types that uses for vectors of signals to be used for further processing.
2494
+ *
2495
+ * Comparing to standard events, signals should be used in case when the event impacts some "state"
2496
+ * and the state should be used instead of the event itself.
2497
+ *
2498
+ * For example, a signal can represent the current status of a user (online/offline/away),
2499
+ * while an event would represent a single action (user logged in/logged out).
2500
+ *
2501
+ * Signals are typically used in scenarios where the current state is more important than individual events,
2502
+ * such as monitoring systems, real-time dashboards, or stateful applications.
2503
+ */
2504
+ declare class A_Signal extends A_Entity<A_Signal_Init> {
2505
+ data: Record<string, any>;
2506
+ fromNew(newEntity: A_Signal_Init): void;
2507
+ /**
2508
+ * Emits this signal within the provided scope.
2509
+ *
2510
+ * Scope is mandatory since signal itself should not be registered in the scope,
2511
+ * but should use particular scope context to use proper set of components
2512
+ *
2513
+ * @param scope
2514
+ */
2515
+ emit(scope: A_Scope): Promise<void>;
2516
+ }
2517
+
2518
+ /**
2519
+ * A Signal Vector Entity is a collection of signals structured in a specific way.
2520
+ * It allows grouping multiple signals together for batch processing or transmission.
2521
+ *
2522
+ * Signal Vectors are useful in scenarios where multiple related signals need to be handled together,
2523
+ * as a state of the system or a snapshot of various parameters at a given time.
2524
+ */
2525
+ declare class A_SignalVector extends A_Entity<A_SignalVector_Init, A_SignalVector_Serialized> {
2526
+ /**
2527
+ * The structure of the signal vector, defining the types of signals it contains.
2528
+ *
2529
+ * For example:
2530
+ * [UserSignInSignal, UserStatusSignal, UserActivitySignal]
2531
+ */
2532
+ structure: Array<A_TYPES__Entity_Constructor<A_Signal>>;
2533
+ /**
2534
+ * The values of the signals in the vector.
2535
+ * Each entry corresponds to the data of a signal in the structure.
2536
+ *
2537
+ * For example:
2538
+ * [
2539
+ * { userId: '123', timestamp: '2023-10-01T12:00:00Z' }, // UserSignInSignal data
2540
+ * { userId: '123', status: 'online' }, // UserStatusSignal data
2541
+ * { userId: '123', activity: 'browsing' } // UserActivitySignal data
2542
+ * ]
2543
+ *
2544
+ *
2545
+ * [!] For further processing it's recommended to convert any objects to plain text
2546
+ */
2547
+ values: Array<Record<string, any>>;
2548
+ fromNew(newEntity: A_SignalVector_Init): void;
2549
+ /**
2550
+ * Converts to Array of values of signals in the vector
2551
+ *
2552
+ * @returns
2553
+ */
2554
+ toVector(): Array<Record<string, any>>;
2555
+ /**
2556
+ * Converts to Object with signal names as keys and their corresponding values
2557
+ *
2558
+ * @returns
2559
+ */
2560
+ toObject(): Record<string, any>;
2561
+ /**
2562
+ * Serializes the Signal Vector to a JSON-compatible format.
2563
+ *
2564
+ *
2565
+ * @returns
2566
+ */
2567
+ toJSON(): A_SignalVector_Serialized;
2568
+ }
2569
+
2570
+ declare enum A_SignalFeatures {
2571
+ Emit = "_A_SignalFeatures_Emit"
2572
+ }
2573
+ declare enum A_SignalBusFeatures {
2574
+ Emit = "_A_SignalBusFeatures_Emit"
2575
+ }
2576
+
2577
+ /**
2578
+ * A_SignalState manages the latest state of all signals within a given scope.
2579
+ *
2580
+ * This class maintains a mapping between signal constructors and their most recently emitted values,
2581
+ * providing a centralized state store for signal management within an application context.
2582
+ *
2583
+ * @template TSignalData - Union type of all possible signal data types that can be stored (must extend Record<string, any>)
2584
+ *
2585
+ * The generic ensures type safety by maintaining correspondence between:
2586
+ * - Signal constructor types and their data types
2587
+ * - Signal instances and their emitted value types
2588
+ * - Vector structure and the data it contains
2589
+ */
2590
+ declare class A_SignalState<TSignalData extends Record<string, any> = Record<string, any>> extends A_Fragment {
2591
+ /**
2592
+ * Internal map storing the relationship between signal constructors and their latest values
2593
+ * Key: Signal constructor function
2594
+ * Value: Latest emitted data from that signal type
2595
+ */
2596
+ protected _state: Map<A_TYPES__Component_Constructor<A_Signal>, TSignalData | undefined>;
2597
+ /**
2598
+ * Optional structure defining the ordered list of signal constructors
2599
+ * Used for vector operations and initialization
2600
+ */
2601
+ protected _structure: Array<A_TYPES__Component_Constructor<A_Signal>>;
2602
+ /**
2603
+ * Gets the ordered structure of signal constructors
2604
+ * @returns Array of signal constructors in their defined order
2605
+ */
2606
+ get structure(): Array<A_TYPES__Component_Constructor<A_Signal>>;
2607
+ /**
2608
+ * Creates a new A_SignalState instance
2609
+ *
2610
+ * @param structure - Optional array defining the ordered structure of signal constructors
2611
+ * This structure is used for vector operations and determines the order
2612
+ * in which signals are processed and serialized
2613
+ */
2614
+ constructor(structure: A_TYPES__Component_Constructor<A_Signal>[]);
2615
+ /**
2616
+ * Sets the latest value for a specific signal type
2617
+ *
2618
+ * @param signal - The signal constructor to associate the value with
2619
+ * @param value - The data value emitted by the signal
2620
+ */
2621
+ set(signal: A_Signal, value: TSignalData): void;
2622
+ set(signal: A_TYPES__Component_Constructor<A_Signal>, value: TSignalData): void;
2623
+ /**
2624
+ * Retrieves the latest value for a specific signal type
2625
+ *
2626
+ * @param signal - The signal constructor to get the value for
2627
+ * @returns The latest data value or undefined if no value has been set
2628
+ */
2629
+ get(signal: A_Signal): TSignalData | undefined;
2630
+ get(signal: A_TYPES__Component_Constructor<A_Signal>): TSignalData | undefined;
2631
+ /**
2632
+ * Checks if a signal type has been registered in the state
2633
+ *
2634
+ * @param signal - The signal constructor to check for
2635
+ * @returns True if the signal type exists in the state map
2636
+ */
2637
+ has(signal: A_Signal): boolean;
2638
+ has(signal: A_TYPES__Component_Constructor<A_Signal>): boolean;
2639
+ /**
2640
+ * Removes a signal type and its associated value from the state
2641
+ *
2642
+ * @param signal - The signal constructor to remove
2643
+ * @returns True if the signal was successfully deleted, false if it didn't exist
2644
+ */
2645
+ delete(signal: A_Signal): boolean;
2646
+ delete(signal: A_TYPES__Component_Constructor<A_Signal>): boolean;
2647
+ /**
2648
+ * Converts the current state to a vector (ordered array) format
2649
+ *
2650
+ * The order is determined by the structure array provided during construction.
2651
+ * Each position in the vector corresponds to a specific signal type's latest value.
2652
+ *
2653
+ * @returns Array of signal values in the order defined by the structure
2654
+ * @throws Error if structure is not defined or if any signal value is undefined
2655
+ */
2656
+ toVector(): A_SignalVector;
2657
+ /**
2658
+ * Converts the current state to an object with signal constructor names as keys
2659
+ *
2660
+ * This provides a more readable representation of the state where each signal
2661
+ * type is identified by its constructor name.
2662
+ *
2663
+ * @returns Object mapping signal constructor names to their latest values
2664
+ * @throws Error if any signal value is undefined
2665
+ */
2666
+ toObject(): Record<string, TSignalData>;
2667
+ }
2668
+
2669
+ /**
2670
+ * This component should dictate a structure of the vector for all signals within a given scope.
2671
+ * so if there're multiple signals it should say what type at what position should be expected.
2672
+ *
2673
+ * e.g. [A_RouterWatcher, A_ScopeWatcher, A_LoggerWatcher]
2674
+ * This structure then should be used for any further processing of signals within the scope.
2675
+ */
2676
+ declare class A_SignalConfig extends A_Fragment {
2677
+ protected _structure?: Array<A_TYPES__Entity_Constructor<A_Signal>>;
2678
+ protected _config: A_SignalConfig_Init;
2679
+ protected _ready?: Promise<void>;
2680
+ get structure(): Array<A_TYPES__Entity_Constructor<A_Signal>>;
2681
+ /**
2682
+ * Uses for synchronization to ensure the config is initialized.
2683
+ *
2684
+ * @returns True if the configuration has been initialized.
2685
+ */
2686
+ get ready(): Promise<void> | undefined;
2687
+ constructor(params: A_SignalConfig_Init);
2688
+ /**
2689
+ * Initializes the signal configuration if not already initialized.
2690
+ *
2691
+ * @returns
2692
+ */
2693
+ initialize(): Promise<void>;
2694
+ /**
2695
+ * Initializes the signal configuration by processing the provided structure or string representation.
2696
+ * This method sets up the internal structure of signal constructors based on the configuration.
2697
+ */
2698
+ protected _initialize(): Promise<void>;
2699
+ }
2700
+
2701
+ /**
2702
+ * This component should listen for all available signal watchers components in this and all parent scopes.
2703
+ * When a signal is emitted, it should forward the signal to all registered watchers.
2704
+ *
2705
+ * A_SignalBus should always return the same vector structure of the signals, and that's why it should store the state of the latest behavior.
2706
+ * For example if there are 3 watchers registered, the bus should always return a vector of 3 elements, based on the A_SignalConfig structure.
2707
+ *
2708
+ *
2709
+ * The component itself is stateless and all methods uses only parameters (context) is provided with.
2710
+ */
2711
+ declare class A_SignalBus extends A_Component {
2712
+ /**
2713
+ * This methods extends A-Signal Emit feature to handle signal emission within the bus.
2714
+ *
2715
+ * It updates the signal state and emits the updated signal vector.
2716
+ *
2717
+ * @param signal
2718
+ * @param globalConfig
2719
+ * @param logger
2720
+ * @param state
2721
+ * @param config
2722
+ * @returns
2723
+ */ u: any;
2724
+ [A_SignalFeatures.Emit](signal: A_Signal, globalConfig?: A_Config<['A_SIGNAL_VECTOR_STRUCTURE']>, logger?: A_Logger, state?: A_SignalState, config?: A_SignalConfig): Promise<void>;
2725
+ }
2726
+
2346
2727
  type A_UTILS_TYPES__ScheduleObjectConfig = {
2347
2728
  /**
2348
2729
  * If the timeout is cleared, should the promise resolve or reject?
@@ -2456,4 +2837,4 @@ declare class A_StateMachineError extends A_Error {
2456
2837
  static readonly TransitionError = "A-StateMachine Transition Error";
2457
2838
  }
2458
2839
 
2459
- export { A_CONSTANTS__CONFIG_ENV_VARIABLES, A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY, A_Channel, A_ChannelError, A_ChannelFeatures, A_ChannelRequest, A_ChannelRequestStatuses, A_Command, A_CommandError, A_CommandEvent, type A_CommandEvents, A_CommandFeatures, A_CommandTransitions, type A_Command_ExecutionContext, A_Command_Status, A_Config, A_ConfigError, A_ConfigLoader, A_Deferred, A_ExecutionContext, A_LOGGER_ANSI, A_LOGGER_COLORS, A_LOGGER_DEFAULT_LEVEL, A_LOGGER_DEFAULT_SCOPE_LENGTH, A_LOGGER_ENV_KEYS, A_LOGGER_FORMAT, A_LOGGER_SAFE_RANDOM_COLORS, A_LOGGER_TIME_FORMAT, A_Logger, A_LoggerEnvVariables, A_LoggerEnvVariablesArray, type A_LoggerEnvVariablesType, type A_LoggerLevel, A_Manifest, A_ManifestChecker, A_ManifestError, A_Memory, A_MemoryContext, type A_MemoryContextMeta, A_MemoryError, A_MemoryFeatures, type A_MemoryOperationContext, type A_MemoryOperationContextMeta, type A_MemoryOperations, type A_Memory_Storage, A_OperationContext, type A_Operation_Serialized, type A_Operation_Storage, A_Polyfill, A_Schedule, A_ScheduleObject, A_Service, A_ServiceFeatures, A_StateMachine, A_StateMachineError, A_StateMachineFeatures, A_StateMachineTransition, type A_StateMachineTransitionParams, type A_StateMachineTransitionStorage, type A_TYPES__Command_Constructor, type A_TYPES__Command_Init, type A_TYPES__Command_Listener, type A_TYPES__Command_Serialized, type A_TYPES__ConfigContainerConstructor, type A_TYPES__ConfigENVVariables, A_TYPES__ConfigFeature, type A_UTILS_TYPES__ManifestQuery, type A_UTILS_TYPES__ManifestRule, type A_UTILS_TYPES__Manifest_AllowedComponents, type A_UTILS_TYPES__Manifest_ComponentLevelConfig, type A_UTILS_TYPES__Manifest_Init, type A_UTILS_TYPES__Manifest_MethodLevelConfig, type A_UTILS_TYPES__Manifest_Rules, type A_UTILS_TYPES__ScheduleObjectCallback, type A_UTILS_TYPES__ScheduleObjectConfig, ConfigReader, ENVConfigReader, FileConfigReader, type IbufferInterface, type IcryptoInterface, type Ifspolyfill, type IhttpInterface, type IhttpsInterface, type IpathInterface, type IprocessInterface, type IurlInterface };
2840
+ export { A_CONSTANTS__CONFIG_ENV_VARIABLES, A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY, A_Channel, A_ChannelError, A_ChannelFeatures, A_ChannelRequest, A_ChannelRequestStatuses, A_Command, A_CommandError, A_CommandEvent, type A_CommandEvents, A_CommandFeatures, A_CommandTransitions, type A_Command_ExecutionContext, A_Command_Status, A_Config, A_ConfigError, A_ConfigLoader, A_Deferred, A_ExecutionContext, A_LOGGER_ANSI, A_LOGGER_COLORS, A_LOGGER_DEFAULT_LEVEL, A_LOGGER_DEFAULT_SCOPE_LENGTH, A_LOGGER_ENV_KEYS, A_LOGGER_FORMAT, A_LOGGER_SAFE_RANDOM_COLORS, A_LOGGER_TERMINAL, A_LOGGER_TIME_FORMAT, A_Logger, type A_LoggerColorName, A_LoggerEnvVariables, A_LoggerEnvVariablesArray, type A_LoggerEnvVariablesType, type A_LoggerLevel, A_Manifest, A_ManifestChecker, A_ManifestError, A_Memory, A_MemoryContext, type A_MemoryContextMeta, A_MemoryError, A_MemoryFeatures, type A_MemoryOperationContext, type A_MemoryOperationContextMeta, type A_MemoryOperations, type A_Memory_Storage, A_OperationContext, type A_Operation_Serialized, type A_Operation_Storage, A_Polyfill, A_Route, A_Schedule, A_ScheduleObject, A_Service, A_ServiceFeatures, A_Signal, A_SignalBus, A_SignalBusFeatures, A_SignalConfig, type A_SignalConfig_Init, A_SignalFeatures, A_SignalState, A_SignalVector, type A_SignalVector_Init, type A_SignalVector_Serialized, type A_Signal_Init, A_StateMachine, A_StateMachineError, A_StateMachineFeatures, A_StateMachineTransition, type A_StateMachineTransitionParams, type A_StateMachineTransitionStorage, type A_TYPES__Command_Constructor, type A_TYPES__Command_Init, type A_TYPES__Command_Listener, type A_TYPES__Command_Serialized, type A_TYPES__ConfigContainerConstructor, type A_TYPES__ConfigENVVariables, A_TYPES__ConfigFeature, type A_UTILS_TYPES__ManifestQuery, type A_UTILS_TYPES__ManifestRule, type A_UTILS_TYPES__Manifest_AllowedComponents, type A_UTILS_TYPES__Manifest_ComponentLevelConfig, type A_UTILS_TYPES__Manifest_Init, type A_UTILS_TYPES__Manifest_MethodLevelConfig, type A_UTILS_TYPES__Manifest_Rules, type A_UTILS_TYPES__ScheduleObjectCallback, type A_UTILS_TYPES__ScheduleObjectConfig, ConfigReader, ENVConfigReader, FileConfigReader, type IbufferInterface, type IcryptoInterface, type Ifspolyfill, type IhttpInterface, type IhttpsInterface, type IpathInterface, type IprocessInterface, type IurlInterface };