@omnipad/core 0.1.1-alpha.0 → 0.2.0-alpha.2

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.mts CHANGED
@@ -569,7 +569,7 @@ interface BaseConfig {
569
569
  * Configuration for a virtual keyboard button.
570
570
  */
571
571
  interface KeyboardButtonConfig extends BaseConfig {
572
- type: typeof TYPES.KEYBOARD_BUTTON;
572
+ type: typeof CMP_TYPES.KEYBOARD_BUTTON;
573
573
  /** Visual text displayed on the button. */
574
574
  label: string;
575
575
  /** Keyboard event metadata to be emitted when triggered. */
@@ -579,12 +579,41 @@ interface KeyboardButtonConfig extends BaseConfig {
579
579
  */
580
580
  targetStageId?: string;
581
581
  }
582
+ /**
583
+ * Mouse Button Configuration
584
+ */
585
+ interface MouseButtonConfig extends BaseConfig {
586
+ type: typeof CMP_TYPES.MOUSE_BUTTON;
587
+ /** Label displayed on the button */
588
+ label: string;
589
+ /**
590
+ * 0: Left (Main), 1: Middle, 2: Right (Context)
591
+ * @default 0
592
+ */
593
+ button: 0 | 1 | 2;
594
+ /** CID of the target Stage to receive clicks */
595
+ targetStageId?: string;
596
+ /**
597
+ * Fixed coordinate to click on (0-100 percentage).
598
+ * If provided, the click always hits this spot regardless of cursor position.
599
+ */
600
+ fixedPoint?: Vec2;
601
+ }
602
+ interface TrackpadConfig extends BaseConfig {
603
+ type: typeof CMP_TYPES.TRACKPAD;
604
+ /** Label displayed on the trackpad */
605
+ label: string;
606
+ /** Simulation sensitivity, e.g. 0.5 - 2.0 */
607
+ sensitivity: number;
608
+ /** CID of the target Stage to receive clicks */
609
+ targetStageId?: string;
610
+ }
582
611
  /**
583
612
  * Configuration for an Input Zone.
584
613
  * Input Zones act as containers and can handle dynamic (floating) widgets.
585
614
  */
586
615
  interface InputZoneConfig extends BaseConfig {
587
- type: typeof TYPES.INPUT_ZONE;
616
+ type: typeof CMP_TYPES.INPUT_ZONE;
588
617
  /** If true, attempts to regain focus for the target stage when touched. */
589
618
  preventFocusLoss?: boolean;
590
619
  /**
@@ -597,7 +626,7 @@ interface InputZoneConfig extends BaseConfig {
597
626
  * Acts as the bridge between virtual signals and the actual game/app DOM.
598
627
  */
599
628
  interface TargetZoneConfig extends BaseConfig {
600
- type: typeof TYPES.TARGET_ZONE;
629
+ type: typeof CMP_TYPES.TARGET_ZONE;
601
630
  /** Whether to render a visual virtual cursor. */
602
631
  cursorEnabled?: boolean;
603
632
  /** Time in milliseconds before the cursor auto-hides after inactivity. 0 to disable. */
@@ -651,81 +680,6 @@ interface ConfigTreeNode {
651
680
  children?: ConfigTreeNode[];
652
681
  }
653
682
 
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
683
  /**
730
684
  * Trait: Provides identity with a unique ID and specific entity type.
731
685
  */
@@ -753,10 +707,9 @@ interface ICoreEntity extends IIdentifiable, ILifecycle {
753
707
  */
754
708
  interface ISpatial {
755
709
  /**
756
- * Updates the physical boundary rect, usually called by a ResizeObserver in the adapter layer.
757
- * @param rect - The new DOMRect of the element.
710
+ * Dynamically obtain dimensions and position to ensure the most precise real-time screen coordinates are obtained during each interaction.
758
711
  */
759
- updateRect(rect: DOMRect): void;
712
+ bindRectProvider(provider: () => DOMRect): void;
760
713
  }
761
714
  /**
762
715
  * Trait: Provides configuration management.
@@ -816,6 +769,152 @@ interface ISignalReceiver {
816
769
  handleSignal(signal: InputActionSignal): void;
817
770
  }
818
771
 
772
+ /**
773
+ * Interface for the global Registry singleton.
774
+ */
775
+ interface IRegistry {
776
+ /**
777
+ * Registers an entity into the system.
778
+ * Usually called during a component's constructor or onMounted lifecycle.
779
+ *
780
+ * @param entity - The logic entity instance to register.
781
+ */
782
+ register(entity: ICoreEntity): void;
783
+ /**
784
+ * Unregisters an entity from the system.
785
+ * Usually called during a component's destroy or onUnmounted lifecycle.
786
+ *
787
+ * @param uid - The unique identifier of the entity.
788
+ */
789
+ unregister(uid: string): void;
790
+ /**
791
+ * Queries an entity by its UID.
792
+ * Supports generics for easy type casting to specific logic types (e.g., ISignalReceiver).
793
+ *
794
+ * @example
795
+ * // usually global ID like "$main-stage"
796
+ * const stage = Registry.getInstance().getEntity<TargetZoneCore>('$main-stage');
797
+ *
798
+ * @param uid - The unique identifier of the target entity.
799
+ * @returns The entity instance, or undefined if not found.
800
+ */
801
+ getEntity<T extends ICoreEntity = ICoreEntity>(uid: string): T | undefined;
802
+ /**
803
+ * Returns a flat array of all currently registered entities.
804
+ * Useful for global operations or full-profile backups.
805
+ */
806
+ getAllEntities(): ICoreEntity[];
807
+ /**
808
+ * Retrieves an entity and all its recursive descendants based on parentId relationships.
809
+ *
810
+ * @param rootUid - The UID of the entity to start the search from.
811
+ * @returns An array of entities belonging to the specified subtree (including the root).
812
+ */
813
+ getEntitiesByRoot(rootUid: string): ICoreEntity[];
814
+ /**
815
+ * Recursively destroys an entity and all its descendants.
816
+ * Ensures all signals are cut off and instances are removed from the registry.
817
+ *
818
+ * @param rootUid - The Entity ID of the root node to be destroyed.
819
+ */
820
+ destroyByRoot(rootUid: string): void;
821
+ /**
822
+ * Triggers the reset() method on all compatible entities.
823
+ * Essential for cutting off active input signals (e.g., stuck keys) during profile reloads.
824
+ */
825
+ resetAll(): void;
826
+ /**
827
+ * Clears all registered entities.
828
+ * Used for system resets or full application unmounts.
829
+ */
830
+ clear(): void;
831
+ }
832
+
833
+ /**
834
+ * Metadata for basic pointer interaction.
835
+ * Shared by all interactable entities to track physical touch/mouse state.
836
+ */
837
+ interface InteractionState {
838
+ /** Indicates if the component is currently being touched or clicked. */
839
+ isActive: boolean;
840
+ /** The unique ID of the pointer being tracked, used for Pointer Capture. */
841
+ pointerId: number | null;
842
+ }
843
+ /**
844
+ * Logic-level state for button-type widgets.
845
+ * Handles the processed output after debouncing or toggle logic.
846
+ */
847
+ interface ButtonLogicState {
848
+ /** The final logical state of the button (true = pressed). */
849
+ isPressed: boolean;
850
+ /** Numerical value representing pressure or analog depth, ranging from 0.0 to 1.0. */
851
+ value: number;
852
+ }
853
+ /**
854
+ * Logic-level state for joystick-type widgets.
855
+ * Provides directional data calculated from the stick movement.
856
+ */
857
+ interface JoystickLogicState {
858
+ /** Normalized direction vector where x and y range from -1.0 to 1.0. */
859
+ vector: {
860
+ x: number;
861
+ y: number;
862
+ };
863
+ /** The current angle of the stick in radians. */
864
+ angle: number;
865
+ }
866
+ /**
867
+ * Runtime state for the Virtual Cursor within a TargetZone.
868
+ */
869
+ interface CursorState {
870
+ /** Current position of the cursor as a percentage (0-100) relative to the stage. */
871
+ position: Vec2;
872
+ /** Visibility toggle based on movement or configuration. */
873
+ isVisible: boolean;
874
+ /** Indicates if a logical "Mouse Down" is currently active. */
875
+ isPointerDown: boolean;
876
+ /** A temporary flag used to trigger focus-reclaim visual feedback. */
877
+ isFocusReturning: boolean;
878
+ }
879
+ /**
880
+ * State for managing dynamic/floating widgets within an InputZone.
881
+ */
882
+ interface InputZoneState {
883
+ /** Indicates if a dynamic widget (e.g., a floating stick) is currently spawned. */
884
+ isDynamicActive: boolean;
885
+ /** The ID (UID) of the pointer that triggered the dynamic widget. */
886
+ dynamicPointerId: number | null;
887
+ /** The initial spawn coordinates of the dynamic widget (percentage 0-100). */
888
+ dynamicPosition: Vec2;
889
+ }
890
+ /**
891
+ * Basic state for Managed Layers.
892
+ */
893
+ interface LayerState {
894
+ /** Visual hint for layout debugging or active selection. */
895
+ isHighlighted: boolean;
896
+ }
897
+ /**
898
+ * Combined state for Keyboard Button components.
899
+ */
900
+ interface KeyboardButtonState extends InteractionState, ButtonLogicState {
901
+ }
902
+ /**
903
+ * Combined state for Mouse Button components.
904
+ */
905
+ interface MouseButtonState extends InteractionState, ButtonLogicState {
906
+ }
907
+ /**
908
+ * Combined state for Trackpad components.
909
+ */
910
+ interface TrackpadState extends InteractionState, ButtonLogicState {
911
+ }
912
+ /**
913
+ * Combined state for Analog Stick components.
914
+ */
915
+ interface JoystickState extends InteractionState, JoystickLogicState {
916
+ }
917
+
819
918
  /**
820
919
  * =================================================================
821
920
  * 1. Constants Definition
@@ -825,7 +924,7 @@ interface ISignalReceiver {
825
924
  /**
826
925
  * Core entity types supported by the library.
827
926
  */
828
- declare const TYPES: {
927
+ declare const CMP_TYPES: {
829
928
  /** Area responsible for capturing touches and spawning dynamic widgets */
830
929
  readonly INPUT_ZONE: "input-zone";
831
930
  /** Area responsible for receiving signals and simulating DOM events */
@@ -881,11 +980,11 @@ type WidgetId = string;
881
980
  /** Unique identifier for a Zone container (InputZone) */
882
981
  type ZoneId = string;
883
982
  /** Union type of all built-in entity values */
884
- type AnyEntityType = (typeof TYPES)[keyof typeof TYPES];
983
+ type AnyEntityType = (typeof CMP_TYPES)[keyof typeof CMP_TYPES];
885
984
  /** 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 & {});
985
+ type WidgetType = typeof CMP_TYPES.KEYBOARD_BUTTON | typeof CMP_TYPES.MOUSE_BUTTON | typeof CMP_TYPES.ANALOG_STICK | typeof CMP_TYPES.D_PAD | typeof CMP_TYPES.TRACKPAD | (string & {});
887
986
  /** Supported Zone type strings, allowing for custom string extensions */
888
- type ZoneType = typeof TYPES.INPUT_ZONE | typeof TYPES.TARGET_ZONE | (string & {});
987
+ type ZoneType = typeof CMP_TYPES.INPUT_ZONE | typeof CMP_TYPES.TARGET_ZONE | (string & {});
889
988
  /** General node type identifier for ConfigTreeNode or Registry lookups */
890
989
  type EntityType = AnyEntityType | (string & {});
891
990
  /** Built-in input action identifiers */
@@ -927,6 +1026,8 @@ interface InputActionSignal {
927
1026
  keyCode?: number;
928
1027
  /** Coordinate point in percentage (0-100) */
929
1028
  point?: Vec2;
1029
+ /** Relative displacement in percentage (0-100) */
1030
+ delta?: Vec2;
930
1031
  /** Mouse button index (0: Left, 1: Middle, 2: Right) */
931
1032
  button?: 0 | 1 | 2;
932
1033
  /** Input pressure or force (0.0 to 1.0) */
@@ -1055,9 +1156,10 @@ declare const applyAxialDeadzone: (v: Vec2, threshold: number, max: number) => V
1055
1156
  *
1056
1157
  * @param x - Viewport X coordinate (px)
1057
1158
  * @param y - Viewport Y coordinate (px)
1159
+ * @param ignoreClass - Style class of DOM elements to be ignored
1058
1160
  * @returns The deepmost Element or null if none found at the position.
1059
1161
  */
1060
- declare const getDeepElement: (x: number, y: number) => Element | null;
1162
+ declare const getDeepElement: (x: number, y: number, ignoreClass?: string) => Element | null;
1061
1163
  /**
1062
1164
  * Recursively finds the truly focused element by traversing Shadow DOM boundaries.
1063
1165
  *
@@ -1222,21 +1324,26 @@ declare class SimpleEmitter<T> {
1222
1324
  declare class InputManager {
1223
1325
  /** Internal flag to prevent multiple event registrations */
1224
1326
  private _isListening;
1327
+ /** A throttled version of the reset logic */
1328
+ private throttledReset;
1225
1329
  private constructor();
1226
1330
  /**
1227
1331
  * Retrieves the global instance of the InputManager.
1228
1332
  * Ensures uniqueness across multiple bundles or modules.
1229
1333
  */
1230
1334
  static getInstance(): InputManager;
1335
+ /**
1336
+ * Manually triggers a system-wide input reset via Registry.
1337
+ */
1338
+ private handleGlobalReset;
1339
+ private handleResizeReset;
1340
+ private handleBlurReset;
1341
+ private handleVisibilityChangeReset;
1231
1342
  /**
1232
1343
  * Initializes global safety listeners.
1233
1344
  * Should be called once at the root component lifecycle (e.g., VirtualLayer).
1234
1345
  */
1235
1346
  init(): void;
1236
- /**
1237
- * Manually triggers a system-wide input reset via Registry.
1238
- */
1239
- private handleGlobalReset;
1240
1347
  /**
1241
1348
  * Toggle full-screen state of the page.
1242
1349
  * @param element Target HTMLElement
@@ -1252,67 +1359,6 @@ declare class InputManager {
1252
1359
  destroy(): void;
1253
1360
  }
1254
1361
 
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
1362
  /**
1317
1363
  * Global Registry Singleton.
1318
1364
  *
@@ -1352,7 +1398,7 @@ declare abstract class BaseEntity<TConfig, TState> implements ICoreEntity, ISpat
1352
1398
  readonly type: EntityType;
1353
1399
  protected config: TConfig;
1354
1400
  protected state: TState;
1355
- protected rect: DOMRect | null;
1401
+ protected rectProvider: (() => DOMRect) | null;
1356
1402
  protected stateEmitter: SimpleEmitter<TState>;
1357
1403
  constructor(uid: string, type: EntityType, initialConfig: TConfig, initialState: TState);
1358
1404
  subscribe(cb: (state: TState) => void): () => void;
@@ -1364,7 +1410,11 @@ declare abstract class BaseEntity<TConfig, TState> implements ICoreEntity, ISpat
1364
1410
  protected setState(partialState: Partial<TState>): void;
1365
1411
  destroy(): void;
1366
1412
  abstract reset(): void;
1367
- updateRect(rect: DOMRect): void;
1413
+ bindRectProvider(provider: () => DOMRect): void;
1414
+ /**
1415
+ * Called when triggering interactions, this subclass fetches the latest boundaries in real time.
1416
+ */
1417
+ protected getRect(): DOMRect | null;
1368
1418
  updateConfig(newConfig: Partial<TConfig>): void;
1369
1419
  getState(): Readonly<TState>;
1370
1420
  getConfig(): Readonly<TConfig>;
@@ -1428,6 +1478,32 @@ declare class KeyboardButtonCore extends BaseEntity<KeyboardButtonConfig, Keyboa
1428
1478
  reset(): void;
1429
1479
  }
1430
1480
 
1481
+ /**
1482
+ * Core logic implementation for a mouse button widget.
1483
+ * Handles pointer interactions and translates them into mouse signals (down, up, click) for a target stage.
1484
+ */
1485
+ declare class MouseButtonCore extends BaseEntity<MouseButtonConfig, MouseButtonState> implements IPointerHandler {
1486
+ constructor(uid: string, config: MouseButtonConfig);
1487
+ onPointerDown(e: PointerEvent): void;
1488
+ onPointerUp(e: PointerEvent): void;
1489
+ onPointerCancel(e: PointerEvent): void;
1490
+ onPointerMove(e: PointerEvent): void;
1491
+ /**
1492
+ * Handles the release of the button.
1493
+ *
1494
+ * @param e - The pointer event.
1495
+ * @param isNormalRelease - If true, a 'click' event will also be dispatched.
1496
+ */
1497
+ private handleRelease;
1498
+ /**
1499
+ * Dispatches input signals to the registered target stage.
1500
+ *
1501
+ * @param type - The action type (mousedown, mouseup, or click).
1502
+ */
1503
+ private sendInputSignal;
1504
+ reset(): void;
1505
+ }
1506
+
1431
1507
  /**
1432
1508
  * Core logic for the Root/Managed Layer.
1433
1509
  *
@@ -1445,10 +1521,19 @@ declare class RootLayerCore extends BaseEntity<BaseConfig, LayerState> {
1445
1521
  * It acts as a receiver that translates abstract input signals into native browser events,
1446
1522
  * while maintaining virtual cursor positioning and ensuring the game maintains focus.
1447
1523
  */
1448
- declare class TargetZoneCore extends BaseEntity<TargetZoneConfig, CursorState> implements ISignalReceiver {
1524
+ declare class TargetZoneCore extends BaseEntity<TargetZoneConfig, CursorState> implements IPointerHandler, ISignalReceiver {
1449
1525
  private hideTimer;
1450
1526
  private focusFeedbackTimer;
1527
+ private throttledPointerMove;
1451
1528
  constructor(uid: string, config: TargetZoneConfig);
1529
+ onPointerDown(e: PointerEvent): void;
1530
+ onPointerMove(e: PointerEvent): void;
1531
+ onPointerUp(e: PointerEvent): void;
1532
+ onPointerCancel(e: PointerEvent): void;
1533
+ /**
1534
+ * Convert physical DOM events into internal signals
1535
+ */
1536
+ private processPhysicalEvent;
1452
1537
  handleSignal(signal: InputActionSignal): void;
1453
1538
  /**
1454
1539
  * Calculates pixel coordinates and dispatches simulated pointer events to the deepest element.
@@ -1469,6 +1554,10 @@ declare class TargetZoneCore extends BaseEntity<TargetZoneConfig, CursorState> i
1469
1554
  * Updates the internal virtual cursor coordinates.
1470
1555
  */
1471
1556
  private updateCursorPosition;
1557
+ /**
1558
+ * Updates the internal virtual cursor coordinates by delta.
1559
+ */
1560
+ private updateCursorPositionByDelta;
1472
1561
  /**
1473
1562
  * Makes the virtual cursor visible and sets a timeout for auto-hiding.
1474
1563
  */
@@ -1476,7 +1565,64 @@ declare class TargetZoneCore extends BaseEntity<TargetZoneConfig, CursorState> i
1476
1565
  reset(): void;
1477
1566
  }
1478
1567
 
1568
+ /**
1569
+ * Core logic implementation for a trackpad widget.
1570
+ * Translates pointer gestures into relative mouse movements and click actions.
1571
+ * Supports tap-to-click and double-tap-to-drag scenarios.
1572
+ */
1573
+ declare class TrackpadCore extends BaseEntity<TrackpadConfig, TrackpadState> implements IPointerHandler {
1574
+ private lastPointerPos;
1575
+ private startTime;
1576
+ private startPos;
1577
+ private lastClickTime;
1578
+ private isDragMode;
1579
+ private throttledPointerMove;
1580
+ /**
1581
+ * Creates an instance of TrackpadCore.
1582
+ *
1583
+ * @param uid - Unique entity ID.
1584
+ * @param config - Configuration for the trackpad.
1585
+ */
1586
+ constructor(uid: string, config: TrackpadConfig);
1587
+ onPointerDown(e: PointerEvent): void;
1588
+ onPointerMove(e: PointerEvent): void;
1589
+ /**
1590
+ * Internal logic for processing pointer movement.
1591
+ * Calculates displacement and emits relative move signals.
1592
+ *
1593
+ * @param e - The pointer event.
1594
+ */
1595
+ private processPointerMove;
1596
+ onPointerUp(e: PointerEvent): void;
1597
+ onPointerCancel(e: PointerEvent): void;
1598
+ reset(): void;
1599
+ /**
1600
+ * Clean up pointer capture and reset interaction state.
1601
+ */
1602
+ private handleRelease;
1603
+ /**
1604
+ * Helper to send signals to the target stage via Registry.
1605
+ *
1606
+ * @param type - Signal action type.
1607
+ * @param extraPayload - Additional data like delta or point.
1608
+ */
1609
+ private sendSignal;
1610
+ }
1611
+
1479
1612
  declare const OmniPad: {
1613
+ ActionTypes: {
1614
+ readonly KEYDOWN: "keydown";
1615
+ readonly KEYUP: "keyup";
1616
+ readonly POINTER: "pointer";
1617
+ readonly POINTERMOVE: "pointermove";
1618
+ readonly POINTERDOWN: "pointerdown";
1619
+ readonly POINTERUP: "pointerup";
1620
+ readonly MOUSE: "mouse";
1621
+ readonly MOUSEMOVE: "mousemove";
1622
+ readonly MOUSEDOWN: "mousedown";
1623
+ readonly MOUSEUP: "mouseup";
1624
+ readonly CLICK: "click";
1625
+ };
1480
1626
  Context: {
1481
1627
  readonly PARENT_ID_KEY: "omnipad-parent-id-link";
1482
1628
  };
@@ -1990,4 +2136,4 @@ declare const OmniPad: {
1990
2136
  };
1991
2137
  };
1992
2138
 
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 };
2139
+ export { ACTION_TYPES, type AnchorPoint, type AnyConfig, type AnyEntityType, type BaseConfig, BaseEntity, type BuiltInActionType, type ButtonLogicState, CMP_TYPES, 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 IRegistry, 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, type MouseButtonConfig, MouseButtonCore, type MouseButtonState, OmniPad, Registry, RootLayerCore, SimpleEmitter, type StageId, type TargetZoneConfig, TargetZoneCore, type TrackpadConfig, TrackpadCore, type TrackpadState, 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 };