@omnipad/core 0.1.1-alpha.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.
@@ -0,0 +1,1993 @@
1
+ /**
2
+ * Interface defining the structure of a keyboard key mapping.
3
+ * Ensures compatibility between modern web standards and legacy Flash requirements.
4
+ */
5
+ interface KeyMapping {
6
+ /**
7
+ * The key value, corresponding to `KeyboardEvent.key`.
8
+ * Represented as a string (e.g., " ", "Enter", "a").
9
+ */
10
+ key: string;
11
+ /**
12
+ * The physical key code, corresponding to `KeyboardEvent.code`.
13
+ * Describes the physical location of the key (e.g., "Space", "Enter", "KeyA").
14
+ */
15
+ code: string;
16
+ /**
17
+ * The legacy numerical key code, corresponding to `KeyboardEvent.keyCode`.
18
+ * Essential for Flash engines (AS2/AS3) running via Ruffle.
19
+ * e.g., 32 for Space, 13 for Enter.
20
+ */
21
+ keyCode: number;
22
+ }
23
+ /**
24
+ * Standard collection of key mappings.
25
+ * Allows developers to quickly retrieve mapping data using physical key codes as keys.
26
+ */
27
+ declare const KEYS: {
28
+ readonly Backspace: {
29
+ readonly key: "Backspace";
30
+ readonly code: "Backspace";
31
+ readonly keyCode: 8;
32
+ };
33
+ readonly Tab: {
34
+ readonly key: "Tab";
35
+ readonly code: "Tab";
36
+ readonly keyCode: 9;
37
+ };
38
+ readonly Enter: {
39
+ readonly key: "Enter";
40
+ readonly code: "Enter";
41
+ readonly keyCode: 13;
42
+ };
43
+ readonly ShiftLeft: {
44
+ readonly key: "Shift";
45
+ readonly code: "ShiftLeft";
46
+ readonly keyCode: 16;
47
+ };
48
+ readonly ControlLeft: {
49
+ readonly key: "Control";
50
+ readonly code: "ControlLeft";
51
+ readonly keyCode: 17;
52
+ };
53
+ readonly AltLeft: {
54
+ readonly key: "Alt";
55
+ readonly code: "AltLeft";
56
+ readonly keyCode: 18;
57
+ };
58
+ readonly Pause: {
59
+ readonly key: "Pause";
60
+ readonly code: "Pause";
61
+ readonly keyCode: 19;
62
+ };
63
+ readonly CapsLock: {
64
+ readonly key: "CapsLock";
65
+ readonly code: "CapsLock";
66
+ readonly keyCode: 20;
67
+ };
68
+ readonly Escape: {
69
+ readonly key: "Escape";
70
+ readonly code: "Escape";
71
+ readonly keyCode: 27;
72
+ };
73
+ readonly Space: {
74
+ readonly key: " ";
75
+ readonly code: "Space";
76
+ readonly keyCode: 32;
77
+ };
78
+ readonly PageUp: {
79
+ readonly key: "PageUp";
80
+ readonly code: "PageUp";
81
+ readonly keyCode: 33;
82
+ };
83
+ readonly PageDown: {
84
+ readonly key: "PageDown";
85
+ readonly code: "PageDown";
86
+ readonly keyCode: 34;
87
+ };
88
+ readonly End: {
89
+ readonly key: "End";
90
+ readonly code: "End";
91
+ readonly keyCode: 35;
92
+ };
93
+ readonly Home: {
94
+ readonly key: "Home";
95
+ readonly code: "Home";
96
+ readonly keyCode: 36;
97
+ };
98
+ readonly ArrowLeft: {
99
+ readonly key: "ArrowLeft";
100
+ readonly code: "ArrowLeft";
101
+ readonly keyCode: 37;
102
+ };
103
+ readonly ArrowUp: {
104
+ readonly key: "ArrowUp";
105
+ readonly code: "ArrowUp";
106
+ readonly keyCode: 38;
107
+ };
108
+ readonly ArrowRight: {
109
+ readonly key: "ArrowRight";
110
+ readonly code: "ArrowRight";
111
+ readonly keyCode: 39;
112
+ };
113
+ readonly ArrowDown: {
114
+ readonly key: "ArrowDown";
115
+ readonly code: "ArrowDown";
116
+ readonly keyCode: 40;
117
+ };
118
+ readonly PrintScreen: {
119
+ readonly key: "PrintScreen";
120
+ readonly code: "PrintScreen";
121
+ readonly keyCode: 44;
122
+ };
123
+ readonly Insert: {
124
+ readonly key: "Insert";
125
+ readonly code: "Insert";
126
+ readonly keyCode: 45;
127
+ };
128
+ readonly Delete: {
129
+ readonly key: "Delete";
130
+ readonly code: "Delete";
131
+ readonly keyCode: 46;
132
+ };
133
+ readonly Digit0: {
134
+ readonly key: "0";
135
+ readonly code: "Digit0";
136
+ readonly keyCode: 48;
137
+ };
138
+ readonly Digit1: {
139
+ readonly key: "1";
140
+ readonly code: "Digit1";
141
+ readonly keyCode: 49;
142
+ };
143
+ readonly Digit2: {
144
+ readonly key: "2";
145
+ readonly code: "Digit2";
146
+ readonly keyCode: 50;
147
+ };
148
+ readonly Digit3: {
149
+ readonly key: "3";
150
+ readonly code: "Digit3";
151
+ readonly keyCode: 51;
152
+ };
153
+ readonly Digit4: {
154
+ readonly key: "4";
155
+ readonly code: "Digit4";
156
+ readonly keyCode: 52;
157
+ };
158
+ readonly Digit5: {
159
+ readonly key: "5";
160
+ readonly code: "Digit5";
161
+ readonly keyCode: 53;
162
+ };
163
+ readonly Digit6: {
164
+ readonly key: "6";
165
+ readonly code: "Digit6";
166
+ readonly keyCode: 54;
167
+ };
168
+ readonly Digit7: {
169
+ readonly key: "7";
170
+ readonly code: "Digit7";
171
+ readonly keyCode: 55;
172
+ };
173
+ readonly Digit8: {
174
+ readonly key: "8";
175
+ readonly code: "Digit8";
176
+ readonly keyCode: 56;
177
+ };
178
+ readonly Digit9: {
179
+ readonly key: "9";
180
+ readonly code: "Digit9";
181
+ readonly keyCode: 57;
182
+ };
183
+ readonly KeyA: {
184
+ readonly key: "a";
185
+ readonly code: "KeyA";
186
+ readonly keyCode: 65;
187
+ };
188
+ readonly KeyB: {
189
+ readonly key: "b";
190
+ readonly code: "KeyB";
191
+ readonly keyCode: 66;
192
+ };
193
+ readonly KeyC: {
194
+ readonly key: "c";
195
+ readonly code: "KeyC";
196
+ readonly keyCode: 67;
197
+ };
198
+ readonly KeyD: {
199
+ readonly key: "d";
200
+ readonly code: "KeyD";
201
+ readonly keyCode: 68;
202
+ };
203
+ readonly KeyE: {
204
+ readonly key: "e";
205
+ readonly code: "KeyE";
206
+ readonly keyCode: 69;
207
+ };
208
+ readonly KeyF: {
209
+ readonly key: "f";
210
+ readonly code: "KeyF";
211
+ readonly keyCode: 70;
212
+ };
213
+ readonly KeyG: {
214
+ readonly key: "g";
215
+ readonly code: "KeyG";
216
+ readonly keyCode: 71;
217
+ };
218
+ readonly KeyH: {
219
+ readonly key: "h";
220
+ readonly code: "KeyH";
221
+ readonly keyCode: 72;
222
+ };
223
+ readonly KeyI: {
224
+ readonly key: "i";
225
+ readonly code: "KeyI";
226
+ readonly keyCode: 73;
227
+ };
228
+ readonly KeyJ: {
229
+ readonly key: "j";
230
+ readonly code: "KeyJ";
231
+ readonly keyCode: 74;
232
+ };
233
+ readonly KeyK: {
234
+ readonly key: "k";
235
+ readonly code: "KeyK";
236
+ readonly keyCode: 75;
237
+ };
238
+ readonly KeyL: {
239
+ readonly key: "l";
240
+ readonly code: "KeyL";
241
+ readonly keyCode: 76;
242
+ };
243
+ readonly KeyM: {
244
+ readonly key: "m";
245
+ readonly code: "KeyM";
246
+ readonly keyCode: 77;
247
+ };
248
+ readonly KeyN: {
249
+ readonly key: "n";
250
+ readonly code: "KeyN";
251
+ readonly keyCode: 78;
252
+ };
253
+ readonly KeyO: {
254
+ readonly key: "o";
255
+ readonly code: "KeyO";
256
+ readonly keyCode: 79;
257
+ };
258
+ readonly KeyP: {
259
+ readonly key: "p";
260
+ readonly code: "KeyP";
261
+ readonly keyCode: 80;
262
+ };
263
+ readonly KeyQ: {
264
+ readonly key: "q";
265
+ readonly code: "KeyQ";
266
+ readonly keyCode: 81;
267
+ };
268
+ readonly KeyR: {
269
+ readonly key: "r";
270
+ readonly code: "KeyR";
271
+ readonly keyCode: 82;
272
+ };
273
+ readonly KeyS: {
274
+ readonly key: "s";
275
+ readonly code: "KeyS";
276
+ readonly keyCode: 83;
277
+ };
278
+ readonly KeyT: {
279
+ readonly key: "t";
280
+ readonly code: "KeyT";
281
+ readonly keyCode: 84;
282
+ };
283
+ readonly KeyU: {
284
+ readonly key: "u";
285
+ readonly code: "KeyU";
286
+ readonly keyCode: 85;
287
+ };
288
+ readonly KeyV: {
289
+ readonly key: "v";
290
+ readonly code: "KeyV";
291
+ readonly keyCode: 86;
292
+ };
293
+ readonly KeyW: {
294
+ readonly key: "w";
295
+ readonly code: "KeyW";
296
+ readonly keyCode: 87;
297
+ };
298
+ readonly KeyX: {
299
+ readonly key: "x";
300
+ readonly code: "KeyX";
301
+ readonly keyCode: 88;
302
+ };
303
+ readonly KeyY: {
304
+ readonly key: "y";
305
+ readonly code: "KeyY";
306
+ readonly keyCode: 89;
307
+ };
308
+ readonly KeyZ: {
309
+ readonly key: "z";
310
+ readonly code: "KeyZ";
311
+ readonly keyCode: 90;
312
+ };
313
+ readonly MetaLeft: {
314
+ readonly key: "Meta";
315
+ readonly code: "MetaLeft";
316
+ readonly keyCode: 91;
317
+ };
318
+ readonly ContextMenu: {
319
+ readonly key: "ContextMenu";
320
+ readonly code: "ContextMenu";
321
+ readonly keyCode: 93;
322
+ };
323
+ readonly Numpad0: {
324
+ readonly key: "0";
325
+ readonly code: "Numpad0";
326
+ readonly keyCode: 96;
327
+ };
328
+ readonly Numpad1: {
329
+ readonly key: "1";
330
+ readonly code: "Numpad1";
331
+ readonly keyCode: 97;
332
+ };
333
+ readonly Numpad2: {
334
+ readonly key: "2";
335
+ readonly code: "Numpad2";
336
+ readonly keyCode: 98;
337
+ };
338
+ readonly Numpad3: {
339
+ readonly key: "3";
340
+ readonly code: "Numpad3";
341
+ readonly keyCode: 99;
342
+ };
343
+ readonly Numpad4: {
344
+ readonly key: "4";
345
+ readonly code: "Numpad4";
346
+ readonly keyCode: 100;
347
+ };
348
+ readonly Numpad5: {
349
+ readonly key: "5";
350
+ readonly code: "Numpad5";
351
+ readonly keyCode: 101;
352
+ };
353
+ readonly Numpad6: {
354
+ readonly key: "6";
355
+ readonly code: "Numpad6";
356
+ readonly keyCode: 102;
357
+ };
358
+ readonly Numpad7: {
359
+ readonly key: "7";
360
+ readonly code: "Numpad7";
361
+ readonly keyCode: 103;
362
+ };
363
+ readonly Numpad8: {
364
+ readonly key: "8";
365
+ readonly code: "Numpad8";
366
+ readonly keyCode: 104;
367
+ };
368
+ readonly Numpad9: {
369
+ readonly key: "9";
370
+ readonly code: "Numpad9";
371
+ readonly keyCode: 105;
372
+ };
373
+ readonly NumpadMultiply: {
374
+ readonly key: "*";
375
+ readonly code: "NumpadMultiply";
376
+ readonly keyCode: 106;
377
+ };
378
+ readonly NumpadAdd: {
379
+ readonly key: "+";
380
+ readonly code: "NumpadAdd";
381
+ readonly keyCode: 107;
382
+ };
383
+ readonly NumpadSubtract: {
384
+ readonly key: "-";
385
+ readonly code: "NumpadSubtract";
386
+ readonly keyCode: 109;
387
+ };
388
+ readonly NumpadDecimal: {
389
+ readonly key: ".";
390
+ readonly code: "NumpadDecimal";
391
+ readonly keyCode: 110;
392
+ };
393
+ readonly NumpadDivide: {
394
+ readonly key: "/";
395
+ readonly code: "NumpadDivide";
396
+ readonly keyCode: 111;
397
+ };
398
+ readonly F1: {
399
+ readonly key: "F1";
400
+ readonly code: "F1";
401
+ readonly keyCode: 112;
402
+ };
403
+ readonly F2: {
404
+ readonly key: "F2";
405
+ readonly code: "F2";
406
+ readonly keyCode: 113;
407
+ };
408
+ readonly F3: {
409
+ readonly key: "F3";
410
+ readonly code: "F3";
411
+ readonly keyCode: 114;
412
+ };
413
+ readonly F4: {
414
+ readonly key: "F4";
415
+ readonly code: "F4";
416
+ readonly keyCode: 115;
417
+ };
418
+ readonly F5: {
419
+ readonly key: "F5";
420
+ readonly code: "F5";
421
+ readonly keyCode: 116;
422
+ };
423
+ readonly F6: {
424
+ readonly key: "F6";
425
+ readonly code: "F6";
426
+ readonly keyCode: 117;
427
+ };
428
+ readonly F7: {
429
+ readonly key: "F7";
430
+ readonly code: "F7";
431
+ readonly keyCode: 118;
432
+ };
433
+ readonly F8: {
434
+ readonly key: "F8";
435
+ readonly code: "F8";
436
+ readonly keyCode: 119;
437
+ };
438
+ readonly F9: {
439
+ readonly key: "F9";
440
+ readonly code: "F9";
441
+ readonly keyCode: 120;
442
+ };
443
+ readonly F10: {
444
+ readonly key: "F10";
445
+ readonly code: "F10";
446
+ readonly keyCode: 121;
447
+ };
448
+ readonly F11: {
449
+ readonly key: "F11";
450
+ readonly code: "F11";
451
+ readonly keyCode: 122;
452
+ };
453
+ readonly F12: {
454
+ readonly key: "F12";
455
+ readonly code: "F12";
456
+ readonly keyCode: 123;
457
+ };
458
+ readonly NumLock: {
459
+ readonly key: "NumLock";
460
+ readonly code: "NumLock";
461
+ readonly keyCode: 144;
462
+ };
463
+ readonly ScrollLock: {
464
+ readonly key: "ScrollLock";
465
+ readonly code: "ScrollLock";
466
+ readonly keyCode: 145;
467
+ };
468
+ readonly Semicolon: {
469
+ readonly key: ";";
470
+ readonly code: "Semicolon";
471
+ readonly keyCode: 186;
472
+ };
473
+ readonly Equal: {
474
+ readonly key: "=";
475
+ readonly code: "Equal";
476
+ readonly keyCode: 187;
477
+ };
478
+ readonly Comma: {
479
+ readonly key: ",";
480
+ readonly code: "Comma";
481
+ readonly keyCode: 188;
482
+ };
483
+ readonly Minus: {
484
+ readonly key: "-";
485
+ readonly code: "Minus";
486
+ readonly keyCode: 189;
487
+ };
488
+ readonly Period: {
489
+ readonly key: ".";
490
+ readonly code: "Period";
491
+ readonly keyCode: 190;
492
+ };
493
+ readonly Slash: {
494
+ readonly key: "/";
495
+ readonly code: "Slash";
496
+ readonly keyCode: 191;
497
+ };
498
+ readonly Backquote: {
499
+ readonly key: "`";
500
+ readonly code: "Backquote";
501
+ readonly keyCode: 192;
502
+ };
503
+ readonly BracketLeft: {
504
+ readonly key: "[";
505
+ readonly code: "BracketLeft";
506
+ readonly keyCode: 219;
507
+ };
508
+ readonly Backslash: {
509
+ readonly key: "\\";
510
+ readonly code: "Backslash";
511
+ readonly keyCode: 220;
512
+ };
513
+ readonly BracketRight: {
514
+ readonly key: "]";
515
+ readonly code: "BracketRight";
516
+ readonly keyCode: 221;
517
+ };
518
+ readonly Quote: {
519
+ readonly key: "'";
520
+ readonly code: "Quote";
521
+ readonly keyCode: 222;
522
+ };
523
+ };
524
+
525
+ /**
526
+ * Defines the spatial properties of a component.
527
+ * Supports various CSS units (px, %, vh, vw) via FlexibleLength.
528
+ */
529
+ interface LayoutBox {
530
+ /** Offset from the left edge of the parent container. */
531
+ left?: FlexibleLength;
532
+ /** Offset from the top edge of the parent container. */
533
+ top?: FlexibleLength;
534
+ /** Offset from the right edge of the parent container. */
535
+ right?: FlexibleLength;
536
+ /** Offset from the bottom edge of the parent container. */
537
+ bottom?: FlexibleLength;
538
+ /** Width of the component. */
539
+ width?: FlexibleLength;
540
+ /** Height of the component. */
541
+ height?: FlexibleLength;
542
+ /**
543
+ * The alignment point of the component relative to its (left, top) coordinates.
544
+ * @example 'center' will center the component on its position.
545
+ */
546
+ anchor?: AnchorPoint;
547
+ /** Rotation angle in degrees. */
548
+ /** Z-index for layering control. */
549
+ zIndex?: number;
550
+ }
551
+ /**
552
+ * Base configuration interface for all components.
553
+ */
554
+ interface BaseConfig {
555
+ /**
556
+ * Config ID (CID) used in persistent storage.
557
+ * If omitted, a random UID will be generated during parsing.
558
+ * If starts with '$', it points to a global static entity. (UID = CID)
559
+ */
560
+ id?: string;
561
+ /** The unique type identifier for the component. */
562
+ type: string;
563
+ /** CID of the parent component. Root components have no parentId. */
564
+ parentId?: string;
565
+ /** Spatial layout settings. */
566
+ layout: LayoutBox;
567
+ }
568
+ /**
569
+ * Configuration for a virtual keyboard button.
570
+ */
571
+ interface KeyboardButtonConfig extends BaseConfig {
572
+ type: typeof TYPES.KEYBOARD_BUTTON;
573
+ /** Visual text displayed on the button. */
574
+ label: string;
575
+ /** Keyboard event metadata to be emitted when triggered. */
576
+ mapping: KeyMapping;
577
+ /**
578
+ * CID of the TargetZone where signals should be dispatched.
579
+ */
580
+ targetStageId?: string;
581
+ }
582
+ /**
583
+ * Configuration for an Input Zone.
584
+ * Input Zones act as containers and can handle dynamic (floating) widgets.
585
+ */
586
+ interface InputZoneConfig extends BaseConfig {
587
+ type: typeof TYPES.INPUT_ZONE;
588
+ /** If true, attempts to regain focus for the target stage when touched. */
589
+ preventFocusLoss?: boolean;
590
+ /**
591
+ * The CID of a child component intended to be used as a dynamic (floating) widget.
592
+ */
593
+ dynamicWidgetId?: string;
594
+ }
595
+ /**
596
+ * Configuration for a Target Focus Zone.
597
+ * Acts as the bridge between virtual signals and the actual game/app DOM.
598
+ */
599
+ interface TargetZoneConfig extends BaseConfig {
600
+ type: typeof TYPES.TARGET_ZONE;
601
+ /** Whether to render a visual virtual cursor. */
602
+ cursorEnabled?: boolean;
603
+ /** Time in milliseconds before the cursor auto-hides after inactivity. 0 to disable. */
604
+ cursorAutoDelay?: number;
605
+ }
606
+ /**
607
+ * Union type representing any valid component configuration.
608
+ */
609
+ type AnyConfig = KeyboardButtonConfig | InputZoneConfig | TargetZoneConfig | any;
610
+ /**
611
+ * Representation of a single item in a flattened configuration profile.
612
+ * Ideal for database storage and flat-list editing.
613
+ */
614
+ interface FlatConfigItem {
615
+ /** Unique identifier (CID) in the scope of the profile. */
616
+ id: string;
617
+ /** Component type string. */
618
+ type: string;
619
+ /** Parent CID. Empty if this is the root node. */
620
+ parentId?: string;
621
+ /** Flattened business logic and layout properties. */
622
+ config?: Record<string, any>;
623
+ }
624
+ /**
625
+ * The root structure of a Gamepad configuration file.
626
+ */
627
+ interface GamepadProfile {
628
+ /** Metadata about the profile creator and version. */
629
+ meta: {
630
+ name: string;
631
+ version: string;
632
+ author?: string;
633
+ };
634
+ /** The CID of the entry-point component (usually a root layer or zone, or widget for individual widget config). */
635
+ rootId: string;
636
+ /** List of all components in the profile. Hierarchies are defined via parentId. */
637
+ items: FlatConfigItem[];
638
+ }
639
+ /**
640
+ * A recursive tree structure representing the runtime hierarchy of components.
641
+ * Used by the adapter layer (e.g., Vue) to render components recursively.
642
+ */
643
+ interface ConfigTreeNode {
644
+ /** Runtime Unique Entity ID (UID), unique across the entire application. */
645
+ uid: string;
646
+ /** Component type string. */
647
+ type: string;
648
+ /** Component properties (layout, mapping, etc.), stripped of hierarchy data. */
649
+ config?: Record<string, any>;
650
+ /** Nested children tree nodes. */
651
+ children?: ConfigTreeNode[];
652
+ }
653
+
654
+ /**
655
+ * Metadata for basic pointer interaction.
656
+ * Shared by all interactable entities to track physical touch/mouse state.
657
+ */
658
+ interface InteractionState {
659
+ /** Indicates if the component is currently being touched or clicked. */
660
+ isActive: boolean;
661
+ /** The unique ID of the pointer being tracked, used for Pointer Capture. */
662
+ pointerId: number | null;
663
+ }
664
+ /**
665
+ * Logic-level state for button-type widgets.
666
+ * Handles the processed output after debouncing or toggle logic.
667
+ */
668
+ interface ButtonLogicState {
669
+ /** The final logical state of the button (true = pressed). */
670
+ isPressed: boolean;
671
+ /** Numerical value representing pressure or analog depth, ranging from 0.0 to 1.0. */
672
+ value: number;
673
+ }
674
+ /**
675
+ * Logic-level state for joystick-type widgets.
676
+ * Provides directional data calculated from the stick movement.
677
+ */
678
+ interface JoystickLogicState {
679
+ /** Normalized direction vector where x and y range from -1.0 to 1.0. */
680
+ vector: {
681
+ x: number;
682
+ y: number;
683
+ };
684
+ /** The current angle of the stick in radians. */
685
+ angle: number;
686
+ }
687
+ /**
688
+ * Runtime state for the Virtual Cursor within a TargetZone.
689
+ */
690
+ interface CursorState {
691
+ /** Current position of the cursor as a percentage (0-100) relative to the stage. */
692
+ position: Vec2;
693
+ /** Visibility toggle based on movement or configuration. */
694
+ isVisible: boolean;
695
+ /** Indicates if a logical "Mouse Down" is currently active. */
696
+ isPointerDown: boolean;
697
+ /** A temporary flag used to trigger focus-reclaim visual feedback. */
698
+ isFocusReturning: boolean;
699
+ }
700
+ /**
701
+ * State for managing dynamic/floating widgets within an InputZone.
702
+ */
703
+ interface InputZoneState {
704
+ /** Indicates if a dynamic widget (e.g., a floating stick) is currently spawned. */
705
+ isDynamicActive: boolean;
706
+ /** The ID (UID) of the pointer that triggered the dynamic widget. */
707
+ dynamicPointerId: number | null;
708
+ /** The initial spawn coordinates of the dynamic widget (percentage 0-100). */
709
+ dynamicPosition: Vec2;
710
+ }
711
+ /**
712
+ * Basic state for Managed Layers.
713
+ */
714
+ interface LayerState {
715
+ /** Visual hint for layout debugging or active selection. */
716
+ isHighlighted: boolean;
717
+ }
718
+ /**
719
+ * Combined state for Keyboard Button components.
720
+ */
721
+ interface KeyboardButtonState extends InteractionState, ButtonLogicState {
722
+ }
723
+ /**
724
+ * Combined state for Analog Stick components.
725
+ */
726
+ interface JoystickState extends InteractionState, JoystickLogicState {
727
+ }
728
+
729
+ /**
730
+ * Trait: Provides identity with a unique ID and specific entity type.
731
+ */
732
+ interface IIdentifiable {
733
+ readonly uid: string;
734
+ readonly type: EntityType;
735
+ }
736
+ /**
737
+ * Trait: Provides lifecycle management hooks.
738
+ */
739
+ interface ILifecycle {
740
+ /**
741
+ * Performs cleanup, unregisters the entity, and releases resources.
742
+ */
743
+ destroy(): void;
744
+ }
745
+ /**
746
+ * The core contract for any object that can be managed by the Registry.
747
+ * Only objects implementing this interface are eligible for registration.
748
+ */
749
+ interface ICoreEntity extends IIdentifiable, ILifecycle {
750
+ }
751
+ /**
752
+ * Trait: Enables spatial awareness for DOM/UI-related components.
753
+ */
754
+ interface ISpatial {
755
+ /**
756
+ * Updates the physical boundary rect, usually called by a ResizeObserver in the adapter layer.
757
+ * @param rect - The new DOMRect of the element.
758
+ */
759
+ updateRect(rect: DOMRect): void;
760
+ }
761
+ /**
762
+ * Trait: Provides configuration management.
763
+ */
764
+ interface IConfigurable<TConfig> {
765
+ /**
766
+ * Dynamically updates the current configuration.
767
+ * @param config - Partial configuration object to merge.
768
+ */
769
+ updateConfig(config: Partial<TConfig>): void;
770
+ /**
771
+ * Retrieves a snapshot of the current configuration.
772
+ */
773
+ getConfig(): TConfig;
774
+ }
775
+ /**
776
+ * Trait: Enables state subscription for the adapter layer (e.g., Vue/React).
777
+ */
778
+ interface IObservable<TState> {
779
+ /**
780
+ * Subscribes to state changes.
781
+ * @param cb - Callback function triggered on state updates.
782
+ * @returns An unsubscribe function.
783
+ */
784
+ subscribe(cb: (state: TState) => void): () => void;
785
+ /**
786
+ * Retrieves the current state snapshot.
787
+ */
788
+ getState(): TState;
789
+ }
790
+ /**
791
+ * Trait: Allows resetting the entity to its idle/safe state.
792
+ */
793
+ interface IResettable {
794
+ /**
795
+ * Forcefully clears active states and cuts off outgoing signals.
796
+ */
797
+ reset(): void;
798
+ }
799
+ /**
800
+ * Trait: Handles raw pointer input (Touch/Mouse).
801
+ */
802
+ interface IPointerHandler {
803
+ onPointerDown(e: PointerEvent): void;
804
+ onPointerMove(e: PointerEvent): void;
805
+ onPointerUp(e: PointerEvent): void;
806
+ onPointerCancel(e: PointerEvent): void;
807
+ }
808
+ /**
809
+ * Trait: Receives and processes input signals (e.g., TargetZone).
810
+ */
811
+ interface ISignalReceiver {
812
+ /**
813
+ * Handles incoming signals from widgets.
814
+ * @param signal - The signal data containing action type and payload.
815
+ */
816
+ handleSignal(signal: InputActionSignal): void;
817
+ }
818
+
819
+ /**
820
+ * =================================================================
821
+ * 1. Constants Definition
822
+ * Used for runtime logic and as a baseline for type definitions.
823
+ * =================================================================
824
+ */
825
+ /**
826
+ * Core entity types supported by the library.
827
+ */
828
+ declare const TYPES: {
829
+ /** Area responsible for capturing touches and spawning dynamic widgets */
830
+ readonly INPUT_ZONE: "input-zone";
831
+ /** Area responsible for receiving signals and simulating DOM events */
832
+ readonly TARGET_ZONE: "target-zone";
833
+ /** Simulates a physical keyboard key press */
834
+ readonly KEYBOARD_BUTTON: "keyboard-button";
835
+ /** Simulates a mouse button click/hold */
836
+ readonly MOUSE_BUTTON: "mouse-button";
837
+ /** A joystick that outputs 360-degree or locked direction vectors */
838
+ readonly ANALOG_STICK: "analog-stick";
839
+ /** Classic 4/8-way directional pad */
840
+ readonly D_PAD: "d-pad";
841
+ /** Trackpad-style relative movement area */
842
+ readonly TRACKPAD: "trackpad";
843
+ /** Logic for the on-screen visual cursor */
844
+ readonly VIRTUAL_CURSOR: "virtual-cursor";
845
+ /** The top-level managed container */
846
+ readonly ROOT_LAYER: "root-layer";
847
+ };
848
+ /**
849
+ * Standardized input action types for the signal protocol.
850
+ */
851
+ declare const ACTION_TYPES: {
852
+ readonly KEYDOWN: "keydown";
853
+ readonly KEYUP: "keyup";
854
+ readonly POINTER: "pointer";
855
+ readonly POINTERMOVE: "pointermove";
856
+ readonly POINTERDOWN: "pointerdown";
857
+ readonly POINTERUP: "pointerup";
858
+ readonly MOUSE: "mouse";
859
+ readonly MOUSEMOVE: "mousemove";
860
+ readonly MOUSEDOWN: "mousedown";
861
+ readonly MOUSEUP: "mouseup";
862
+ readonly CLICK: "click";
863
+ };
864
+ /**
865
+ * =================================================================
866
+ * 2. Type Definitions
867
+ * =================================================================
868
+ */
869
+ /**
870
+ * Represents a 2D coordinate or vector.
871
+ * Typically used for percentage-based positioning (0-100).
872
+ */
873
+ interface Vec2 {
874
+ x: number;
875
+ y: number;
876
+ }
877
+ /** Unique identifier for a Stage (TargetZone) */
878
+ type StageId = string;
879
+ /** Unique identifier for an Input Widget */
880
+ type WidgetId = string;
881
+ /** Unique identifier for a Zone container (InputZone) */
882
+ type ZoneId = string;
883
+ /** Union type of all built-in entity values */
884
+ type AnyEntityType = (typeof TYPES)[keyof typeof TYPES];
885
+ /** Supported Widget type strings, allowing for custom string extensions */
886
+ type WidgetType = typeof TYPES.KEYBOARD_BUTTON | typeof TYPES.MOUSE_BUTTON | typeof TYPES.ANALOG_STICK | typeof TYPES.D_PAD | typeof TYPES.TRACKPAD | (string & {});
887
+ /** Supported Zone type strings, allowing for custom string extensions */
888
+ type ZoneType = typeof TYPES.INPUT_ZONE | typeof TYPES.TARGET_ZONE | (string & {});
889
+ /** General node type identifier for ConfigTreeNode or Registry lookups */
890
+ type EntityType = AnyEntityType | (string & {});
891
+ /** Built-in input action identifiers */
892
+ type BuiltInActionType = (typeof ACTION_TYPES)[keyof typeof ACTION_TYPES];
893
+ /** Input action type strings, allowing for custom action extensions */
894
+ type InputActionType = BuiltInActionType | (string & {});
895
+ /** Supported CSS units for layout calculation */
896
+ type Unit = 'px' | '%' | 'vh' | 'vw' | 'rem';
897
+ /**
898
+ * Flexible length input.
899
+ * Supports numbers (interpreted as px) or strings (e.g., '50%', '10vh').
900
+ */
901
+ type FlexibleLength = string | number;
902
+ /**
903
+ * Anchor position used to determine the alignment of an element relative to its coordinates.
904
+ */
905
+ type AnchorPoint = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
906
+ /**
907
+ * =================================================================
908
+ * 3. Signal Protocol
909
+ * Data structure for communication between Widgets and Stages.
910
+ * =================================================================
911
+ */
912
+ /**
913
+ * Represents a signal emitted by an input widget to be processed by a target zone.
914
+ */
915
+ interface InputActionSignal {
916
+ /** The unique identifier of the destination TargetZone */
917
+ targetStageId: StageId;
918
+ /** The action type to perform (e.g., keydown, mousemove) */
919
+ type: InputActionType;
920
+ /** The payload containing specific input details */
921
+ payload: {
922
+ /** Character value of the key (e.g., ' ') */
923
+ key?: string;
924
+ /** Physical key code (e.g., 'Space') */
925
+ code?: string;
926
+ /** Legacy numeric key code (e.g., 32) */
927
+ keyCode?: number;
928
+ /** Coordinate point in percentage (0-100) */
929
+ point?: Vec2;
930
+ /** Mouse button index (0: Left, 1: Middle, 2: Right) */
931
+ button?: 0 | 1 | 2;
932
+ /** Input pressure or force (0.0 to 1.0) */
933
+ pressure?: number;
934
+ /** Allows for arbitrary custom data to support widget extensions */
935
+ [key: string]: any;
936
+ };
937
+ }
938
+ /**
939
+ * Cross-framework context keys for dependency injection (e.g., Provide/Inject).
940
+ */
941
+ declare const CONTEXT: {
942
+ /** The key used to propagate Parent IDs through the component tree */
943
+ readonly PARENT_ID_KEY: "omnipad-parent-id-link";
944
+ };
945
+
946
+ /**
947
+ * Subtracts vector v2 from v1.
948
+ * @param v1 - The source vector.
949
+ * @param v2 - The vector to subtract.
950
+ */
951
+ declare const subVec: (v1: Vec2, v2: Vec2) => Vec2;
952
+ /**
953
+ * Adds vector v2 to v1.
954
+ */
955
+ declare const addVec: (v1: Vec2, v2: Vec2) => Vec2;
956
+ /**
957
+ * Scales a vector by a scalar value.
958
+ * Useful for mapping normalized vectors back to specific pixel magnitudes.
959
+ */
960
+ declare const scaleVec: (v: Vec2, s: number) => Vec2;
961
+ /**
962
+ * Clamps a numeric value between a minimum and maximum range.
963
+ */
964
+ declare const clamp: (val: number, min: number, max: number) => number;
965
+ /**
966
+ * Linearly interpolates between two values.
967
+ */
968
+ declare const lerp: (start: number, end: number, t: number) => number;
969
+ /**
970
+ * Rounds a number to a specific decimal precision.
971
+ * Solves floating-point precision issues in pixel calculations.
972
+ */
973
+ declare const roundTo: (val: number, precision?: number) => number;
974
+ /**
975
+ * Calculates the Euclidean distance between two points.
976
+ */
977
+ declare const getDistance: (p1: Vec2, p2: Vec2) => number;
978
+ /**
979
+ * Calculates the angle in radians from point p1 to p2.
980
+ * Range: -PI to PI.
981
+ */
982
+ declare const getAngle: (p1: Vec2, p2: Vec2) => number;
983
+ /**
984
+ * Converts radians to degrees.
985
+ */
986
+ declare const radToDeg: (rad: number) => number;
987
+ /**
988
+ * Converts degrees to radians.
989
+ */
990
+ declare const degToRad: (deg: number) => number;
991
+ /**
992
+ * Constrains a target point within a circular radius relative to an origin.
993
+ * Commonly used for joystick physical displacement limits.
994
+ */
995
+ declare const clampVector: (origin: Vec2, target: Vec2, radius: number) => Vec2;
996
+ /**
997
+ * Snaps a radian angle to the nearest of 8 directions (45-degree steps).
998
+ */
999
+ declare const lockTo8Directions: (rad: number) => number;
1000
+ /**
1001
+ * Snaps a radian angle to the nearest of 4 directions (90-degree steps).
1002
+ */
1003
+ declare const lockTo4Directions: (rad: number) => number;
1004
+ /**
1005
+ * Converts percentage (0-100) to pixel values (px).
1006
+ */
1007
+ declare const percentToPx: (percent: number, totalPx: number) => number;
1008
+ /**
1009
+ * Converts pixel values (px) to percentage (0-100).
1010
+ */
1011
+ declare const pxToPercent: (px: number, totalPx: number) => number;
1012
+ /**
1013
+ * Normalizes a vector to a length of 1.
1014
+ * Returns {0, 0} if the vector magnitude is 0.
1015
+ */
1016
+ declare const normalizeVec: (v: Vec2) => Vec2;
1017
+ /**
1018
+ * Converts a radian angle to a unit vector.
1019
+ */
1020
+ declare const radToVec: (rad: number) => Vec2;
1021
+ /**
1022
+ * Linearly remaps a value from one range [inMin, inMax] to another [outMin, outMax].
1023
+ */
1024
+ declare const remap: (val: number, inMin: number, inMax: number, outMin: number, outMax: number) => number;
1025
+ /**
1026
+ * Performs a dirty check to see if two Vec2 points are different within an epsilon.
1027
+ */
1028
+ declare const isVec2Equal: (v1: Vec2, v2: Vec2, epsilon?: number) => boolean;
1029
+ /**
1030
+ * Core deadzone logic.
1031
+ * Maps a value from [threshold, max] to a normalized scale [0, 1].
1032
+ * @returns A scalar value between 0 and 1.
1033
+ */
1034
+ declare const getDeadzoneScalar: (magnitude: number, threshold: number, max: number) => number;
1035
+ /**
1036
+ * Applies a radial deadzone to a vector.
1037
+ * Suitable for analog sticks to ensure a smooth transition from center.
1038
+ * @param v - Input vector.
1039
+ * @param radius - The total radius of the joystick base.
1040
+ * @param deadzonePercent - Deadzone threshold (0.0 to 1.0).
1041
+ */
1042
+ declare const applyRadialDeadzone: (v: Vec2, radius: number, deadzonePercent: number) => Vec2;
1043
+ /**
1044
+ * Applies an axial deadzone to a vector.
1045
+ * Independently processes X and Y axes. Useful for D-Pads or precision directional inputs.
1046
+ * @param v - Input vector.
1047
+ * @param threshold - The deadzone threshold value.
1048
+ * @param max - Maximum value for the axis.
1049
+ */
1050
+ declare const applyAxialDeadzone: (v: Vec2, threshold: number, max: number) => Vec2;
1051
+
1052
+ /**
1053
+ * Recursively penetrates Shadow DOM boundaries to find the deepest element at the
1054
+ * specified viewport coordinates.
1055
+ *
1056
+ * @param x - Viewport X coordinate (px)
1057
+ * @param y - Viewport Y coordinate (px)
1058
+ * @returns The deepmost Element or null if none found at the position.
1059
+ */
1060
+ declare const getDeepElement: (x: number, y: number) => Element | null;
1061
+ /**
1062
+ * Recursively finds the truly focused element by traversing Shadow DOM boundaries.
1063
+ *
1064
+ * @returns The deepmost active Element in focus or null.
1065
+ */
1066
+ declare const getDeepActiveElement: () => Element | null;
1067
+ /**
1068
+ * Forcefully focuses an element.
1069
+ * Automatically handles the 'tabindex' attribute to ensure non-focusable elements (like Canvas)
1070
+ * can receive focus.
1071
+ *
1072
+ * @param el - The target HTMLElement to focus.
1073
+ */
1074
+ declare const focusElement: (el: HTMLElement) => void;
1075
+ /**
1076
+ * Dispatches a synthetic KeyboardEvent to the window object.
1077
+ *
1078
+ * @param type - The event type, e.g., 'keydown' or 'keyup'.
1079
+ * @param payload - Key mapping data including key, code, and legacy keyCode.
1080
+ */
1081
+ declare const dispatchKeyboardEvent: (type: string, payload: {
1082
+ key: string;
1083
+ code: string;
1084
+ keyCode: number;
1085
+ }) => void;
1086
+ /**
1087
+ * Dispatches a high-fidelity sequence of Pointer and Mouse events at specific pixel coordinates.
1088
+ * Finds the target element dynamically at the moment of dispatch.
1089
+ *
1090
+ * @param type - The event type (should start with 'pointer' for best compatibility).
1091
+ * @param x - Viewport X coordinate (px).
1092
+ * @param y - Viewport Y coordinate (px).
1093
+ * @param opts - Additional PointerEvent options (button, pressure, etc.).
1094
+ */
1095
+ declare const dispatchPointerEventAtPos: (type: string, x: number, y: number, opts?: PointerEventInit) => void;
1096
+ /**
1097
+ * Calculates the pixel coordinate of an anchor point within a given DOMRect.
1098
+ * Used to translate relative layout definitions into screen-space pixels.
1099
+ *
1100
+ * @param rect - The bounding box of the container.
1101
+ * @param anchor - The defined anchor point (e.g., 'center', 'top-left').
1102
+ * @returns The absolute viewport coordinates {x, y}.
1103
+ */
1104
+ declare const getAnchorPosition: (rect: DOMRect, anchor: AnchorPoint) => Vec2;
1105
+
1106
+ /**
1107
+ * Generates a globally unique identifier (UID) for runtime entity management and DOM keys.
1108
+ *
1109
+ * The generated ID follows the format: `[prefix]-[timestamp_base36]-[random_string]`.
1110
+ * This ensures that components generated at different times or across multiple sessions
1111
+ * remain unique within the current page instance.
1112
+ *
1113
+ * @param prefix - A string prefix for the ID, typically the component type (e.g., 'btn', 'joy'). Defaults to 'omnipad'.
1114
+ * @returns A unique string identifier.
1115
+ *
1116
+ * @example
1117
+ * generateUID('button') // returns "button-m7x8k1p2-f4k2"
1118
+ */
1119
+ declare const generateUID: (prefix?: string) => string;
1120
+ /**
1121
+ * Checks if the provided ID is a reserved global identifier.
1122
+ *
1123
+ * In OmniPad, IDs starting with the `$` symbol are considered "Global IDs".
1124
+ * These identifiers are treated as static references and are not transformed
1125
+ * into dynamic UIDs during configuration parsing.
1126
+ *
1127
+ * @param id - The identifier string to check.
1128
+ * @returns `true` if the ID starts with `$`, otherwise `false`.
1129
+ *
1130
+ * @example
1131
+ * isGlobalID('$root-layer') // returns true
1132
+ * isGlobalID('btn-up') // returns false
1133
+ */
1134
+ declare function isGlobalID(id: string): boolean;
1135
+
1136
+ /**
1137
+ * Converts a LayoutBox configuration into a CSS style object suitable for Vue/React.
1138
+ *
1139
+ * This utility handles:
1140
+ * 1. Unit normalization: Converts numeric values to 'px' strings while preserving unit strings (vh, %, etc.).
1141
+ * 2. Positioning: Sets 'absolute' positioning by default.
1142
+ * 3. Anchoring: Maps AnchorPoint values to CSS 'transform' translations to ensure
1143
+ * the component's origin matches its defined coordinates.
1144
+ *
1145
+ * @param layout - The LayoutBox configuration object.
1146
+ * @returns A CSS style record object.
1147
+ *
1148
+ * @example
1149
+ * // returns { position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)' }
1150
+ * resolveLayoutStyle({ left: '50%', top: '50%', anchor: 'center' });
1151
+ */
1152
+ declare const resolveLayoutStyle: (layout: LayoutBox) => Record<string, string | number>;
1153
+
1154
+ /**
1155
+ * Validates and normalizes raw JSON data into a standard GamepadProfile.
1156
+ * Performs structural checks and injects default metadata.
1157
+ *
1158
+ * @param raw - The raw JSON object from disk or network.
1159
+ * @returns A validated GamepadProfile object.
1160
+ * @throws Error if the core structure is invalid.
1161
+ */
1162
+ declare function parseProfileJson(raw: any): GamepadProfile;
1163
+ /**
1164
+ * Converts a flat GamepadProfile into a hierarchical ConfigTreeNode tree for runtime rendering.
1165
+ * Handles CID (Config ID) to UID (Entity ID) mapping and reference resolution.
1166
+ *
1167
+ * @param profile - The normalized profile data.
1168
+ * @returns The root node of the configuration tree.
1169
+ */
1170
+ declare function parseProfileTree(profile: GamepadProfile): ConfigTreeNode;
1171
+ /**
1172
+ * Serializes the current runtime entities from the Registry back into a flat GamepadProfile.
1173
+ * Generates fresh Config IDs (CIDs) for all nodes except global IDs.
1174
+ *
1175
+ * @param meta - Metadata for the exported profile.
1176
+ * @param rootUid - The Entity ID of the node to be treated as the root.
1177
+ * @returns A flat GamepadProfile ready for storage.
1178
+ */
1179
+ declare function exportProfile(meta: GamepadProfile['meta'], rootUid: string): GamepadProfile;
1180
+
1181
+ /**
1182
+ * Represents a callback function for the emitter.
1183
+ * @template T - The type of data being broadcasted.
1184
+ */
1185
+ type Listener<T> = (data: T) => void;
1186
+ /**
1187
+ * A lightweight implementation of the Observer pattern.
1188
+ * Used primarily within Core Entities to notify the Adapter layer of state changes.
1189
+ *
1190
+ * @template T - The state or data object type.
1191
+ */
1192
+ declare class SimpleEmitter<T> {
1193
+ private listeners;
1194
+ /**
1195
+ * Registers a callback function to be executed whenever data is emitted.
1196
+ *
1197
+ * @param fn - The callback function.
1198
+ * @returns A function that, when called, unsubscribes the listener.
1199
+ */
1200
+ subscribe(fn: Listener<T>): () => void;
1201
+ /**
1202
+ * Broadcasts the provided data to all registered listeners.
1203
+ * Each listener is executed within a try-catch block to ensure that
1204
+ * an error in one subscriber doesn't prevent others from receiving the signal.
1205
+ *
1206
+ * @param data - The payload to be sent to all subscribers.
1207
+ */
1208
+ emit(data: T): void;
1209
+ /**
1210
+ * Removes all listeners and clears the subscription set.
1211
+ * Essential for preventing memory leaks when an Entity is destroyed.
1212
+ */
1213
+ clear(): void;
1214
+ }
1215
+
1216
+ /**
1217
+ * Global Input Manager Singleton.
1218
+ *
1219
+ * Responsible for monitoring global browser events (resize, blur, visibility)
1220
+ * and coordinating system-wide resets to prevent stuck inputs.
1221
+ */
1222
+ declare class InputManager {
1223
+ /** Internal flag to prevent multiple event registrations */
1224
+ private _isListening;
1225
+ private constructor();
1226
+ /**
1227
+ * Retrieves the global instance of the InputManager.
1228
+ * Ensures uniqueness across multiple bundles or modules.
1229
+ */
1230
+ static getInstance(): InputManager;
1231
+ /**
1232
+ * Initializes global safety listeners.
1233
+ * Should be called once at the root component lifecycle (e.g., VirtualLayer).
1234
+ */
1235
+ init(): void;
1236
+ /**
1237
+ * Manually triggers a system-wide input reset via Registry.
1238
+ */
1239
+ private handleGlobalReset;
1240
+ /**
1241
+ * Toggle full-screen state of the page.
1242
+ * @param element Target HTMLElement
1243
+ */
1244
+ toggleFullscreen(element?: HTMLElement): Promise<void>;
1245
+ /**
1246
+ * Full-screen status query provided to the UI layer.
1247
+ */
1248
+ isFullscreen(): boolean;
1249
+ /**
1250
+ * Detaches all global listeners.
1251
+ */
1252
+ destroy(): void;
1253
+ }
1254
+
1255
+ /**
1256
+ * Interface for the global Registry singleton.
1257
+ */
1258
+ interface IRegistry {
1259
+ /**
1260
+ * Registers an entity into the system.
1261
+ * Usually called during a component's constructor or onMounted lifecycle.
1262
+ *
1263
+ * @param entity - The logic entity instance to register.
1264
+ */
1265
+ register(entity: ICoreEntity): void;
1266
+ /**
1267
+ * Unregisters an entity from the system.
1268
+ * Usually called during a component's destroy or onUnmounted lifecycle.
1269
+ *
1270
+ * @param uid - The unique identifier of the entity.
1271
+ */
1272
+ unregister(uid: string): void;
1273
+ /**
1274
+ * Queries an entity by its UID.
1275
+ * Supports generics for easy type casting to specific logic types (e.g., ISignalReceiver).
1276
+ *
1277
+ * @example
1278
+ * // usually global ID like "$main-stage"
1279
+ * const stage = Registry.getInstance().getEntity<TargetZoneCore>('$main-stage');
1280
+ *
1281
+ * @param uid - The unique identifier of the target entity.
1282
+ * @returns The entity instance, or undefined if not found.
1283
+ */
1284
+ getEntity<T extends ICoreEntity = ICoreEntity>(uid: string): T | undefined;
1285
+ /**
1286
+ * Returns a flat array of all currently registered entities.
1287
+ * Useful for global operations or full-profile backups.
1288
+ */
1289
+ getAllEntities(): ICoreEntity[];
1290
+ /**
1291
+ * Retrieves an entity and all its recursive descendants based on parentId relationships.
1292
+ *
1293
+ * @param rootUid - The UID of the entity to start the search from.
1294
+ * @returns An array of entities belonging to the specified subtree (including the root).
1295
+ */
1296
+ getEntitiesByRoot(rootUid: string): ICoreEntity[];
1297
+ /**
1298
+ * Recursively destroys an entity and all its descendants.
1299
+ * Ensures all signals are cut off and instances are removed from the registry.
1300
+ *
1301
+ * @param rootUid - The Entity ID of the root node to be destroyed.
1302
+ */
1303
+ destroyByRoot(rootUid: string): void;
1304
+ /**
1305
+ * Triggers the reset() method on all compatible entities.
1306
+ * Essential for cutting off active input signals (e.g., stuck keys) during profile reloads.
1307
+ */
1308
+ resetAll(): void;
1309
+ /**
1310
+ * Clears all registered entities.
1311
+ * Used for system resets or full application unmounts.
1312
+ */
1313
+ clear(): void;
1314
+ }
1315
+
1316
+ /**
1317
+ * Global Registry Singleton.
1318
+ *
1319
+ * Acts as the "Census Bureau" for the system, maintaining references to all active
1320
+ * logic entities (Stages, Widgets, Layers). It enables cross-component communication
1321
+ * and coordinate mapping by allowing entities to look each other up via UIDs.
1322
+ */
1323
+ declare class Registry implements IRegistry {
1324
+ /** Internal storage: Mapping of Entity UID to Entity Instance */
1325
+ private entities;
1326
+ /**
1327
+ * Private constructor to enforce singleton pattern.
1328
+ */
1329
+ private constructor();
1330
+ /**
1331
+ * Retrieves the global instance of the Registry.
1332
+ * Uses globalThis to ensure the instance is unique even if the library is loaded multiple times.
1333
+ */
1334
+ static getInstance(): Registry;
1335
+ register(entity: ICoreEntity): void;
1336
+ unregister(uid: string): void;
1337
+ getEntity<T extends ICoreEntity = ICoreEntity>(uid: string): T | undefined;
1338
+ getAllEntities(): ICoreEntity[];
1339
+ getEntitiesByRoot(rootUid: string): ICoreEntity[];
1340
+ destroyByRoot(rootUid: string): void;
1341
+ clear(): void;
1342
+ resetAll(): void;
1343
+ debugGetSnapshot(): Map<string, ICoreEntity>;
1344
+ }
1345
+
1346
+ /**
1347
+ * Base abstract class for all logic entities in the system.
1348
+ * Provides fundamental identity management, state subscription, and spatial awareness.
1349
+ */
1350
+ declare abstract class BaseEntity<TConfig, TState> implements ICoreEntity, ISpatial, IResettable, IConfigurable<TConfig>, IObservable<TState> {
1351
+ readonly uid: string;
1352
+ readonly type: EntityType;
1353
+ protected config: TConfig;
1354
+ protected state: TState;
1355
+ protected rect: DOMRect | null;
1356
+ protected stateEmitter: SimpleEmitter<TState>;
1357
+ constructor(uid: string, type: EntityType, initialConfig: TConfig, initialState: TState);
1358
+ subscribe(cb: (state: TState) => void): () => void;
1359
+ /**
1360
+ * Updates the internal state and notifies all subscribers.
1361
+ *
1362
+ * @param partialState - Partial object containing updated state values.
1363
+ */
1364
+ protected setState(partialState: Partial<TState>): void;
1365
+ destroy(): void;
1366
+ abstract reset(): void;
1367
+ updateRect(rect: DOMRect): void;
1368
+ updateConfig(newConfig: Partial<TConfig>): void;
1369
+ getState(): Readonly<TState>;
1370
+ getConfig(): Readonly<TConfig>;
1371
+ }
1372
+
1373
+ /**
1374
+ * Logic core for InputZone.
1375
+ *
1376
+ * Manages a container for input widgets and handles the lifecycle of
1377
+ * dynamic (floating) widgets when interacting with empty space.
1378
+ */
1379
+ declare class InputZoneCore extends BaseEntity<InputZoneConfig, InputZoneState> implements IPointerHandler {
1380
+ constructor(uid: string, config: InputZoneConfig);
1381
+ onPointerDown(e: PointerEvent): void;
1382
+ onPointerMove(e: PointerEvent): void;
1383
+ onPointerUp(e: PointerEvent): void;
1384
+ onPointerCancel(e: PointerEvent): void;
1385
+ /**
1386
+ * Internal helper to handle pointer release and cleanup.
1387
+ */
1388
+ private handleRelease;
1389
+ /**
1390
+ * Converts viewport pixels to percentage coordinates relative to the zone.
1391
+ */
1392
+ private calculateRelativePosition;
1393
+ /**
1394
+ * Whether the interceptor layer should be enabled.
1395
+ */
1396
+ get isInterceptorRequired(): boolean;
1397
+ reset(): void;
1398
+ }
1399
+
1400
+ /**
1401
+ * Core logic implementation for a keyboard button widget.
1402
+ * Handles pointer interactions and translates them into keyboard signals for a target stage.
1403
+ */
1404
+ declare class KeyboardButtonCore extends BaseEntity<KeyboardButtonConfig, KeyboardButtonState> implements IPointerHandler {
1405
+ /**
1406
+ * Creates an instance of KeyboardButtonCore.
1407
+ *
1408
+ * @param uid - The unique entity ID.
1409
+ * @param config - The flat configuration object for the button.
1410
+ */
1411
+ constructor(uid: string, config: KeyboardButtonConfig);
1412
+ onPointerDown(e: PointerEvent): void;
1413
+ onPointerUp(e: PointerEvent): void;
1414
+ onPointerCancel(e: PointerEvent): void;
1415
+ onPointerMove(e: PointerEvent): void;
1416
+ /**
1417
+ * Common logic for releasing the button state.
1418
+ *
1419
+ * @param e - The pointer event that triggered the release.
1420
+ */
1421
+ private handleRelease;
1422
+ /**
1423
+ * Dispatches input signals to the registered target stage.
1424
+ *
1425
+ * @param type - The action type (keydown or keyup).
1426
+ */
1427
+ private sendInputSignal;
1428
+ reset(): void;
1429
+ }
1430
+
1431
+ /**
1432
+ * Core logic for the Root/Managed Layer.
1433
+ *
1434
+ * Acts as the top-level container for a gamepad profile, providing the base
1435
+ * identity (UID) and coordinate reference for all descendant components.
1436
+ */
1437
+ declare class RootLayerCore extends BaseEntity<BaseConfig, LayerState> {
1438
+ constructor(uid: string, config: BaseConfig);
1439
+ reset(): void;
1440
+ }
1441
+
1442
+ /**
1443
+ * Core logic for the Target Focus Zone.
1444
+ *
1445
+ * It acts as a receiver that translates abstract input signals into native browser events,
1446
+ * while maintaining virtual cursor positioning and ensuring the game maintains focus.
1447
+ */
1448
+ declare class TargetZoneCore extends BaseEntity<TargetZoneConfig, CursorState> implements ISignalReceiver {
1449
+ private hideTimer;
1450
+ private focusFeedbackTimer;
1451
+ constructor(uid: string, config: TargetZoneConfig);
1452
+ handleSignal(signal: InputActionSignal): void;
1453
+ /**
1454
+ * Calculates pixel coordinates and dispatches simulated pointer events to the deepest element.
1455
+ *
1456
+ * @param pointerType - The specific pointer event type (e.g., pointermove, pointerdown).
1457
+ * @param payload - Data containing point coordinates or button info.
1458
+ */
1459
+ private executeMouseAction;
1460
+ /**
1461
+ * Checks if the target element under the virtual cursor has focus, and reclaims it if lost.
1462
+ */
1463
+ private ensureFocus;
1464
+ /**
1465
+ * Activates a temporary visual feedback state to indicate a focus-reclaim event.
1466
+ */
1467
+ private triggerFocusFeedback;
1468
+ /**
1469
+ * Updates the internal virtual cursor coordinates.
1470
+ */
1471
+ private updateCursorPosition;
1472
+ /**
1473
+ * Makes the virtual cursor visible and sets a timeout for auto-hiding.
1474
+ */
1475
+ private showCursor;
1476
+ reset(): void;
1477
+ }
1478
+
1479
+ declare const OmniPad: {
1480
+ Context: {
1481
+ readonly PARENT_ID_KEY: "omnipad-parent-id-link";
1482
+ };
1483
+ Keys: {
1484
+ readonly Backspace: {
1485
+ readonly key: "Backspace";
1486
+ readonly code: "Backspace";
1487
+ readonly keyCode: 8;
1488
+ };
1489
+ readonly Tab: {
1490
+ readonly key: "Tab";
1491
+ readonly code: "Tab";
1492
+ readonly keyCode: 9;
1493
+ };
1494
+ readonly Enter: {
1495
+ readonly key: "Enter";
1496
+ readonly code: "Enter";
1497
+ readonly keyCode: 13;
1498
+ };
1499
+ readonly ShiftLeft: {
1500
+ readonly key: "Shift";
1501
+ readonly code: "ShiftLeft";
1502
+ readonly keyCode: 16;
1503
+ };
1504
+ readonly ControlLeft: {
1505
+ readonly key: "Control";
1506
+ readonly code: "ControlLeft";
1507
+ readonly keyCode: 17;
1508
+ };
1509
+ readonly AltLeft: {
1510
+ readonly key: "Alt";
1511
+ readonly code: "AltLeft";
1512
+ readonly keyCode: 18;
1513
+ };
1514
+ readonly Pause: {
1515
+ readonly key: "Pause";
1516
+ readonly code: "Pause";
1517
+ readonly keyCode: 19;
1518
+ };
1519
+ readonly CapsLock: {
1520
+ readonly key: "CapsLock";
1521
+ readonly code: "CapsLock";
1522
+ readonly keyCode: 20;
1523
+ };
1524
+ readonly Escape: {
1525
+ readonly key: "Escape";
1526
+ readonly code: "Escape";
1527
+ readonly keyCode: 27;
1528
+ };
1529
+ readonly Space: {
1530
+ readonly key: " ";
1531
+ readonly code: "Space";
1532
+ readonly keyCode: 32;
1533
+ };
1534
+ readonly PageUp: {
1535
+ readonly key: "PageUp";
1536
+ readonly code: "PageUp";
1537
+ readonly keyCode: 33;
1538
+ };
1539
+ readonly PageDown: {
1540
+ readonly key: "PageDown";
1541
+ readonly code: "PageDown";
1542
+ readonly keyCode: 34;
1543
+ };
1544
+ readonly End: {
1545
+ readonly key: "End";
1546
+ readonly code: "End";
1547
+ readonly keyCode: 35;
1548
+ };
1549
+ readonly Home: {
1550
+ readonly key: "Home";
1551
+ readonly code: "Home";
1552
+ readonly keyCode: 36;
1553
+ };
1554
+ readonly ArrowLeft: {
1555
+ readonly key: "ArrowLeft";
1556
+ readonly code: "ArrowLeft";
1557
+ readonly keyCode: 37;
1558
+ };
1559
+ readonly ArrowUp: {
1560
+ readonly key: "ArrowUp";
1561
+ readonly code: "ArrowUp";
1562
+ readonly keyCode: 38;
1563
+ };
1564
+ readonly ArrowRight: {
1565
+ readonly key: "ArrowRight";
1566
+ readonly code: "ArrowRight";
1567
+ readonly keyCode: 39;
1568
+ };
1569
+ readonly ArrowDown: {
1570
+ readonly key: "ArrowDown";
1571
+ readonly code: "ArrowDown";
1572
+ readonly keyCode: 40;
1573
+ };
1574
+ readonly PrintScreen: {
1575
+ readonly key: "PrintScreen";
1576
+ readonly code: "PrintScreen";
1577
+ readonly keyCode: 44;
1578
+ };
1579
+ readonly Insert: {
1580
+ readonly key: "Insert";
1581
+ readonly code: "Insert";
1582
+ readonly keyCode: 45;
1583
+ };
1584
+ readonly Delete: {
1585
+ readonly key: "Delete";
1586
+ readonly code: "Delete";
1587
+ readonly keyCode: 46;
1588
+ };
1589
+ readonly Digit0: {
1590
+ readonly key: "0";
1591
+ readonly code: "Digit0";
1592
+ readonly keyCode: 48;
1593
+ };
1594
+ readonly Digit1: {
1595
+ readonly key: "1";
1596
+ readonly code: "Digit1";
1597
+ readonly keyCode: 49;
1598
+ };
1599
+ readonly Digit2: {
1600
+ readonly key: "2";
1601
+ readonly code: "Digit2";
1602
+ readonly keyCode: 50;
1603
+ };
1604
+ readonly Digit3: {
1605
+ readonly key: "3";
1606
+ readonly code: "Digit3";
1607
+ readonly keyCode: 51;
1608
+ };
1609
+ readonly Digit4: {
1610
+ readonly key: "4";
1611
+ readonly code: "Digit4";
1612
+ readonly keyCode: 52;
1613
+ };
1614
+ readonly Digit5: {
1615
+ readonly key: "5";
1616
+ readonly code: "Digit5";
1617
+ readonly keyCode: 53;
1618
+ };
1619
+ readonly Digit6: {
1620
+ readonly key: "6";
1621
+ readonly code: "Digit6";
1622
+ readonly keyCode: 54;
1623
+ };
1624
+ readonly Digit7: {
1625
+ readonly key: "7";
1626
+ readonly code: "Digit7";
1627
+ readonly keyCode: 55;
1628
+ };
1629
+ readonly Digit8: {
1630
+ readonly key: "8";
1631
+ readonly code: "Digit8";
1632
+ readonly keyCode: 56;
1633
+ };
1634
+ readonly Digit9: {
1635
+ readonly key: "9";
1636
+ readonly code: "Digit9";
1637
+ readonly keyCode: 57;
1638
+ };
1639
+ readonly KeyA: {
1640
+ readonly key: "a";
1641
+ readonly code: "KeyA";
1642
+ readonly keyCode: 65;
1643
+ };
1644
+ readonly KeyB: {
1645
+ readonly key: "b";
1646
+ readonly code: "KeyB";
1647
+ readonly keyCode: 66;
1648
+ };
1649
+ readonly KeyC: {
1650
+ readonly key: "c";
1651
+ readonly code: "KeyC";
1652
+ readonly keyCode: 67;
1653
+ };
1654
+ readonly KeyD: {
1655
+ readonly key: "d";
1656
+ readonly code: "KeyD";
1657
+ readonly keyCode: 68;
1658
+ };
1659
+ readonly KeyE: {
1660
+ readonly key: "e";
1661
+ readonly code: "KeyE";
1662
+ readonly keyCode: 69;
1663
+ };
1664
+ readonly KeyF: {
1665
+ readonly key: "f";
1666
+ readonly code: "KeyF";
1667
+ readonly keyCode: 70;
1668
+ };
1669
+ readonly KeyG: {
1670
+ readonly key: "g";
1671
+ readonly code: "KeyG";
1672
+ readonly keyCode: 71;
1673
+ };
1674
+ readonly KeyH: {
1675
+ readonly key: "h";
1676
+ readonly code: "KeyH";
1677
+ readonly keyCode: 72;
1678
+ };
1679
+ readonly KeyI: {
1680
+ readonly key: "i";
1681
+ readonly code: "KeyI";
1682
+ readonly keyCode: 73;
1683
+ };
1684
+ readonly KeyJ: {
1685
+ readonly key: "j";
1686
+ readonly code: "KeyJ";
1687
+ readonly keyCode: 74;
1688
+ };
1689
+ readonly KeyK: {
1690
+ readonly key: "k";
1691
+ readonly code: "KeyK";
1692
+ readonly keyCode: 75;
1693
+ };
1694
+ readonly KeyL: {
1695
+ readonly key: "l";
1696
+ readonly code: "KeyL";
1697
+ readonly keyCode: 76;
1698
+ };
1699
+ readonly KeyM: {
1700
+ readonly key: "m";
1701
+ readonly code: "KeyM";
1702
+ readonly keyCode: 77;
1703
+ };
1704
+ readonly KeyN: {
1705
+ readonly key: "n";
1706
+ readonly code: "KeyN";
1707
+ readonly keyCode: 78;
1708
+ };
1709
+ readonly KeyO: {
1710
+ readonly key: "o";
1711
+ readonly code: "KeyO";
1712
+ readonly keyCode: 79;
1713
+ };
1714
+ readonly KeyP: {
1715
+ readonly key: "p";
1716
+ readonly code: "KeyP";
1717
+ readonly keyCode: 80;
1718
+ };
1719
+ readonly KeyQ: {
1720
+ readonly key: "q";
1721
+ readonly code: "KeyQ";
1722
+ readonly keyCode: 81;
1723
+ };
1724
+ readonly KeyR: {
1725
+ readonly key: "r";
1726
+ readonly code: "KeyR";
1727
+ readonly keyCode: 82;
1728
+ };
1729
+ readonly KeyS: {
1730
+ readonly key: "s";
1731
+ readonly code: "KeyS";
1732
+ readonly keyCode: 83;
1733
+ };
1734
+ readonly KeyT: {
1735
+ readonly key: "t";
1736
+ readonly code: "KeyT";
1737
+ readonly keyCode: 84;
1738
+ };
1739
+ readonly KeyU: {
1740
+ readonly key: "u";
1741
+ readonly code: "KeyU";
1742
+ readonly keyCode: 85;
1743
+ };
1744
+ readonly KeyV: {
1745
+ readonly key: "v";
1746
+ readonly code: "KeyV";
1747
+ readonly keyCode: 86;
1748
+ };
1749
+ readonly KeyW: {
1750
+ readonly key: "w";
1751
+ readonly code: "KeyW";
1752
+ readonly keyCode: 87;
1753
+ };
1754
+ readonly KeyX: {
1755
+ readonly key: "x";
1756
+ readonly code: "KeyX";
1757
+ readonly keyCode: 88;
1758
+ };
1759
+ readonly KeyY: {
1760
+ readonly key: "y";
1761
+ readonly code: "KeyY";
1762
+ readonly keyCode: 89;
1763
+ };
1764
+ readonly KeyZ: {
1765
+ readonly key: "z";
1766
+ readonly code: "KeyZ";
1767
+ readonly keyCode: 90;
1768
+ };
1769
+ readonly MetaLeft: {
1770
+ readonly key: "Meta";
1771
+ readonly code: "MetaLeft";
1772
+ readonly keyCode: 91;
1773
+ };
1774
+ readonly ContextMenu: {
1775
+ readonly key: "ContextMenu";
1776
+ readonly code: "ContextMenu";
1777
+ readonly keyCode: 93;
1778
+ };
1779
+ readonly Numpad0: {
1780
+ readonly key: "0";
1781
+ readonly code: "Numpad0";
1782
+ readonly keyCode: 96;
1783
+ };
1784
+ readonly Numpad1: {
1785
+ readonly key: "1";
1786
+ readonly code: "Numpad1";
1787
+ readonly keyCode: 97;
1788
+ };
1789
+ readonly Numpad2: {
1790
+ readonly key: "2";
1791
+ readonly code: "Numpad2";
1792
+ readonly keyCode: 98;
1793
+ };
1794
+ readonly Numpad3: {
1795
+ readonly key: "3";
1796
+ readonly code: "Numpad3";
1797
+ readonly keyCode: 99;
1798
+ };
1799
+ readonly Numpad4: {
1800
+ readonly key: "4";
1801
+ readonly code: "Numpad4";
1802
+ readonly keyCode: 100;
1803
+ };
1804
+ readonly Numpad5: {
1805
+ readonly key: "5";
1806
+ readonly code: "Numpad5";
1807
+ readonly keyCode: 101;
1808
+ };
1809
+ readonly Numpad6: {
1810
+ readonly key: "6";
1811
+ readonly code: "Numpad6";
1812
+ readonly keyCode: 102;
1813
+ };
1814
+ readonly Numpad7: {
1815
+ readonly key: "7";
1816
+ readonly code: "Numpad7";
1817
+ readonly keyCode: 103;
1818
+ };
1819
+ readonly Numpad8: {
1820
+ readonly key: "8";
1821
+ readonly code: "Numpad8";
1822
+ readonly keyCode: 104;
1823
+ };
1824
+ readonly Numpad9: {
1825
+ readonly key: "9";
1826
+ readonly code: "Numpad9";
1827
+ readonly keyCode: 105;
1828
+ };
1829
+ readonly NumpadMultiply: {
1830
+ readonly key: "*";
1831
+ readonly code: "NumpadMultiply";
1832
+ readonly keyCode: 106;
1833
+ };
1834
+ readonly NumpadAdd: {
1835
+ readonly key: "+";
1836
+ readonly code: "NumpadAdd";
1837
+ readonly keyCode: 107;
1838
+ };
1839
+ readonly NumpadSubtract: {
1840
+ readonly key: "-";
1841
+ readonly code: "NumpadSubtract";
1842
+ readonly keyCode: 109;
1843
+ };
1844
+ readonly NumpadDecimal: {
1845
+ readonly key: ".";
1846
+ readonly code: "NumpadDecimal";
1847
+ readonly keyCode: 110;
1848
+ };
1849
+ readonly NumpadDivide: {
1850
+ readonly key: "/";
1851
+ readonly code: "NumpadDivide";
1852
+ readonly keyCode: 111;
1853
+ };
1854
+ readonly F1: {
1855
+ readonly key: "F1";
1856
+ readonly code: "F1";
1857
+ readonly keyCode: 112;
1858
+ };
1859
+ readonly F2: {
1860
+ readonly key: "F2";
1861
+ readonly code: "F2";
1862
+ readonly keyCode: 113;
1863
+ };
1864
+ readonly F3: {
1865
+ readonly key: "F3";
1866
+ readonly code: "F3";
1867
+ readonly keyCode: 114;
1868
+ };
1869
+ readonly F4: {
1870
+ readonly key: "F4";
1871
+ readonly code: "F4";
1872
+ readonly keyCode: 115;
1873
+ };
1874
+ readonly F5: {
1875
+ readonly key: "F5";
1876
+ readonly code: "F5";
1877
+ readonly keyCode: 116;
1878
+ };
1879
+ readonly F6: {
1880
+ readonly key: "F6";
1881
+ readonly code: "F6";
1882
+ readonly keyCode: 117;
1883
+ };
1884
+ readonly F7: {
1885
+ readonly key: "F7";
1886
+ readonly code: "F7";
1887
+ readonly keyCode: 118;
1888
+ };
1889
+ readonly F8: {
1890
+ readonly key: "F8";
1891
+ readonly code: "F8";
1892
+ readonly keyCode: 119;
1893
+ };
1894
+ readonly F9: {
1895
+ readonly key: "F9";
1896
+ readonly code: "F9";
1897
+ readonly keyCode: 120;
1898
+ };
1899
+ readonly F10: {
1900
+ readonly key: "F10";
1901
+ readonly code: "F10";
1902
+ readonly keyCode: 121;
1903
+ };
1904
+ readonly F11: {
1905
+ readonly key: "F11";
1906
+ readonly code: "F11";
1907
+ readonly keyCode: 122;
1908
+ };
1909
+ readonly F12: {
1910
+ readonly key: "F12";
1911
+ readonly code: "F12";
1912
+ readonly keyCode: 123;
1913
+ };
1914
+ readonly NumLock: {
1915
+ readonly key: "NumLock";
1916
+ readonly code: "NumLock";
1917
+ readonly keyCode: 144;
1918
+ };
1919
+ readonly ScrollLock: {
1920
+ readonly key: "ScrollLock";
1921
+ readonly code: "ScrollLock";
1922
+ readonly keyCode: 145;
1923
+ };
1924
+ readonly Semicolon: {
1925
+ readonly key: ";";
1926
+ readonly code: "Semicolon";
1927
+ readonly keyCode: 186;
1928
+ };
1929
+ readonly Equal: {
1930
+ readonly key: "=";
1931
+ readonly code: "Equal";
1932
+ readonly keyCode: 187;
1933
+ };
1934
+ readonly Comma: {
1935
+ readonly key: ",";
1936
+ readonly code: "Comma";
1937
+ readonly keyCode: 188;
1938
+ };
1939
+ readonly Minus: {
1940
+ readonly key: "-";
1941
+ readonly code: "Minus";
1942
+ readonly keyCode: 189;
1943
+ };
1944
+ readonly Period: {
1945
+ readonly key: ".";
1946
+ readonly code: "Period";
1947
+ readonly keyCode: 190;
1948
+ };
1949
+ readonly Slash: {
1950
+ readonly key: "/";
1951
+ readonly code: "Slash";
1952
+ readonly keyCode: 191;
1953
+ };
1954
+ readonly Backquote: {
1955
+ readonly key: "`";
1956
+ readonly code: "Backquote";
1957
+ readonly keyCode: 192;
1958
+ };
1959
+ readonly BracketLeft: {
1960
+ readonly key: "[";
1961
+ readonly code: "BracketLeft";
1962
+ readonly keyCode: 219;
1963
+ };
1964
+ readonly Backslash: {
1965
+ readonly key: "\\";
1966
+ readonly code: "Backslash";
1967
+ readonly keyCode: 220;
1968
+ };
1969
+ readonly BracketRight: {
1970
+ readonly key: "]";
1971
+ readonly code: "BracketRight";
1972
+ readonly keyCode: 221;
1973
+ };
1974
+ readonly Quote: {
1975
+ readonly key: "'";
1976
+ readonly code: "Quote";
1977
+ readonly keyCode: 222;
1978
+ };
1979
+ };
1980
+ Types: {
1981
+ readonly INPUT_ZONE: "input-zone";
1982
+ readonly TARGET_ZONE: "target-zone";
1983
+ readonly KEYBOARD_BUTTON: "keyboard-button";
1984
+ readonly MOUSE_BUTTON: "mouse-button";
1985
+ readonly ANALOG_STICK: "analog-stick";
1986
+ readonly D_PAD: "d-pad";
1987
+ readonly TRACKPAD: "trackpad";
1988
+ readonly VIRTUAL_CURSOR: "virtual-cursor";
1989
+ readonly ROOT_LAYER: "root-layer";
1990
+ };
1991
+ };
1992
+
1993
+ export { ACTION_TYPES, type AnchorPoint, type AnyConfig, type AnyEntityType, type BaseConfig, BaseEntity, type BuiltInActionType, type ButtonLogicState, CONTEXT, type ConfigTreeNode, type CursorState, type EntityType, type FlatConfigItem, type FlexibleLength, type GamepadProfile, type IConfigurable, type ICoreEntity, type IIdentifiable, type ILifecycle, type IObservable, type IPointerHandler, type IResettable, type ISignalReceiver, type ISpatial, type InputActionSignal, type InputActionType, InputManager, type InputZoneConfig, InputZoneCore, type InputZoneState, type InteractionState, type JoystickLogicState, type JoystickState, KEYS, type KeyMapping, type KeyboardButtonConfig, KeyboardButtonCore, type KeyboardButtonState, type LayerState, type LayoutBox, type Listener, OmniPad, Registry, RootLayerCore, SimpleEmitter, type StageId, TYPES, type TargetZoneConfig, TargetZoneCore, type Unit, type Vec2, type WidgetId, type WidgetType, type ZoneId, type ZoneType, addVec, applyAxialDeadzone, applyRadialDeadzone, clamp, clampVector, degToRad, dispatchKeyboardEvent, dispatchPointerEventAtPos, exportProfile, focusElement, generateUID, getAnchorPosition, getAngle, getDeadzoneScalar, getDeepActiveElement, getDeepElement, getDistance, isGlobalID, isVec2Equal, lerp, lockTo4Directions, lockTo8Directions, normalizeVec, parseProfileJson, parseProfileTree, percentToPx, pxToPercent, radToDeg, radToVec, remap, resolveLayoutStyle, roundTo, scaleVec, subVec };