@dcl/sdk 7.0.0-3000191624.commit-0ff97dc → 7.0.0-3015711272.commit-6716e5a

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.
@@ -1,3 +1,5 @@
1
+ /// <reference types="@dcl/posix" />
2
+
1
3
  declare const enum ActionButton {
2
4
  POINTER = 0,
3
5
  PRIMARY = 1,
@@ -245,8 +247,14 @@ export declare namespace Components {
245
247
  /** @public */
246
248
  const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
247
249
  /** @public */
250
+ const PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
251
+ /** @public */
252
+ const PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
253
+ /** @public */
248
254
  const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
249
255
  /** @public */
256
+ const RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
257
+ /** @public */
250
258
  const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
251
259
  /** @public */
252
260
  const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
@@ -478,7 +486,10 @@ declare function defineSdkComponents(engine: PreEngine): {
478
486
  OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
479
487
  OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>, PBOnPointerUpResult>;
480
488
  PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
489
+ PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
490
+ PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
481
491
  PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
492
+ RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
482
493
  SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
483
494
  TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
484
495
  UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
@@ -608,7 +619,7 @@ export declare type IEngine = {
608
619
  *
609
620
  * ```
610
621
  */
611
- defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: Partial<Result<T>>): ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
622
+ defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType): ComponentDefinition<ISchema<Result<T>>, Partial<Result<T>>>;
612
623
  /**
613
624
  * Define a component and add it to the engine.
614
625
  * @param spec An object with schema fields
@@ -644,6 +655,7 @@ export declare type IEngine = {
644
655
  * ```
645
656
  */
646
657
  getEntitiesWith<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...ReadonlyComponentSchema<T>]>;
658
+ RootEntity: Entity;
647
659
  baseComponents: SdkComponents;
648
660
  };
649
661
 
@@ -698,6 +710,17 @@ export declare interface ISize {
698
710
  height: number;
699
711
  }
700
712
 
713
+ /**
714
+ * Check if a pointer event has been emited in the last tick-update.
715
+ * @param entity the entity to query, for global clicks use `engine.RootEntity`
716
+ * @param actionButton
717
+ * @param pointerEventType
718
+ * @returns
719
+ */
720
+ export declare function isPointerEventActive(entity: Entity, actionButton: ActionButton, pointerEventType: PointerEventType): boolean;
721
+
722
+ export declare function isPointerEventActiveGenerator(engine: IEngine): (entity: Entity, actionButton: ActionButton, pointerEventType: PointerEventType) => boolean;
723
+
701
724
  export declare const log: (...a: any[]) => void;
702
725
 
703
726
  /** @public */
@@ -1434,6 +1457,248 @@ export declare const NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTSha
1434
1457
  /** @public */
1435
1458
  export declare type Nullable<T> = T | null;
1436
1459
 
1460
+ /**
1461
+ * The Observable class is a simple implementation of the Observable pattern.
1462
+ *
1463
+ * There's one slight particularity though: a given Observable can notify its observer using a particular mask value, only the Observers registered with this mask value will be notified.
1464
+ * This enable a more fine grained execution without having to rely on multiple different Observable objects.
1465
+ * For instance you may have a given Observable that have four different types of notifications: Move (mask = 0x01), Stop (mask = 0x02), Turn Right (mask = 0X04), Turn Left (mask = 0X08).
1466
+ * A given observer can register itself with only Move and Stop (mask = 0x03), then it will only be notified when one of these two occurs and will never be for Turn Left/Right.
1467
+ *
1468
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed
1469
+ */
1470
+ export declare class Observable<T> {
1471
+ private _observers;
1472
+ private _eventState;
1473
+ private _onObserverAdded;
1474
+ /**
1475
+ * Creates a new observable
1476
+ * @param onObserverAdded - defines a callback to call when a new observer is added
1477
+ */
1478
+ constructor(onObserverAdded?: (observer: Observer<T>) => void);
1479
+ /**
1480
+ * Create a new Observer with the specified callback
1481
+ * @param callback - the callback that will be executed for that Observer
1482
+ * @param mask - the mask used to filter observers
1483
+ * @param insertFirst - if true the callback will be inserted at the first position, hence executed before the others ones. If false (default behavior) the callback will be inserted at the last position, executed after all the others already present.
1484
+ * @param scope - optional scope for the callback to be called from
1485
+ * @param unregisterOnFirstCall - defines if the observer as to be unregistered after the next notification
1486
+ * @returns the new observer created for the callback
1487
+ */
1488
+ add(callback: (eventData: T, eventState: ObserverEventState) => void, mask?: number, insertFirst?: boolean, scope?: any, unregisterOnFirstCall?: boolean): null | Observer<T>;
1489
+ /**
1490
+ * Create a new Observer with the specified callback and unregisters after the next notification
1491
+ * @param callback - the callback that will be executed for that Observer
1492
+ * @returns the new observer created for the callback
1493
+ */
1494
+ addOnce(callback: (eventData: T, eventState: ObserverEventState) => void): null | Observer<T>;
1495
+ /**
1496
+ * Remove an Observer from the Observable object
1497
+ * @param observer - the instance of the Observer to remove
1498
+ * @returns false if it doesn't belong to this Observable
1499
+ */
1500
+ remove(observer: null | Observer<T>): boolean;
1501
+ /**
1502
+ * Remove a callback from the Observable object
1503
+ * @param callback - the callback to remove
1504
+ * @param scope - optional scope. If used only the callbacks with this scope will be removed
1505
+ * @returns false if it doesn't belong to this Observable
1506
+ */
1507
+ removeCallback(callback: (eventData: T, eventState: ObserverEventState) => void, scope?: any): boolean;
1508
+ /**
1509
+ * Notify all Observers by calling their respective callback with the given data
1510
+ * Will return true if all observers were executed, false if an observer set skipNextObservers to true, then prevent the subsequent ones to execute
1511
+ * @param eventData - defines the data to send to all observers
1512
+ * @param mask - defines the mask of the current notification (observers with incompatible mask (ie mask & observer.mask === 0) will not be notified)
1513
+ * @param target - defines the original target of the state
1514
+ * @param currentTarget - defines the current target of the state
1515
+ * @returns false if the complete observer chain was not processed (because one observer set the skipNextObservers to true)
1516
+ */
1517
+ notifyObservers(eventData: T, mask?: number, target?: any, currentTarget?: any): boolean;
1518
+ /**
1519
+ * Calling this will execute each callback, expecting it to be a promise or return a value.
1520
+ * If at any point in the chain one function fails, the promise will fail and the execution will not continue.
1521
+ * This is useful when a chain of events (sometimes async events) is needed to initialize a certain object
1522
+ * and it is crucial that all callbacks will be executed.
1523
+ * The order of the callbacks is kept, callbacks are not executed parallel.
1524
+ *
1525
+ * @param eventData - The data to be sent to each callback
1526
+ * @param mask - is used to filter observers defaults to -1
1527
+ * @param target - defines the callback target (see EventState)
1528
+ * @param currentTarget - defines he current object in the bubbling phase
1529
+ * @returns will return a Promise than resolves when all callbacks executed successfully.
1530
+ */
1531
+ notifyObserversWithPromise(eventData: T, mask?: number, target?: any, currentTarget?: any): Promise<T>;
1532
+ /**
1533
+ * Notify a specific observer
1534
+ * @param observer - defines the observer to notify
1535
+ * @param eventData - defines the data to be sent to each callback
1536
+ * @param mask - is used to filter observers defaults to -1
1537
+ */
1538
+ notifyObserver(observer: Observer<T>, eventData: T, mask?: number): void;
1539
+ /**
1540
+ * Gets a boolean indicating if the observable has at least one observer
1541
+ * @returns true is the Observable has at least one Observer registered
1542
+ */
1543
+ hasObservers(): boolean;
1544
+ /**
1545
+ * Clear the list of observers
1546
+ */
1547
+ clear(): void;
1548
+ /**
1549
+ * Clone the current observable
1550
+ * @returns a new observable
1551
+ */
1552
+ clone(): Observable<T>;
1553
+ /**
1554
+ * Does this observable handles observer registered with a given mask
1555
+ * @param mask - defines the mask to be tested
1556
+ * @returns whether or not one observer registered with the given mask is handeled
1557
+ */
1558
+ hasSpecificMask(mask?: number): boolean;
1559
+ private _deferUnregister;
1560
+ private _remove;
1561
+ }
1562
+
1563
+ /**
1564
+ * Represent an Observer registered to a given Observable object.
1565
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed
1566
+ */
1567
+ export declare class Observer<T> {
1568
+ /**
1569
+ * Defines the callback to call when the observer is notified
1570
+ */
1571
+ callback: (eventData: T, eventState: ObserverEventState) => void;
1572
+ /**
1573
+ * Defines the mask of the observer (used to filter notifications)
1574
+ */
1575
+ mask: number;
1576
+ /**
1577
+ * Defines the current scope used to restore the JS context
1578
+ */
1579
+ scope: any;
1580
+ /**
1581
+ * Gets or sets a property defining that the observer as to be unregistered after the next notification
1582
+ */
1583
+ unregisterOnNextCall: boolean;
1584
+ /** For internal usage */
1585
+ _willBeUnregistered: boolean;
1586
+ /**
1587
+ * Creates a new observer
1588
+ * @param callback - defines the callback to call when the observer is notified
1589
+ * @param mask - defines the mask of the observer (used to filter notifications)
1590
+ * @param scope - defines the current scope used to restore the JS context
1591
+ */
1592
+ constructor(
1593
+ /**
1594
+ * Defines the callback to call when the observer is notified
1595
+ */
1596
+ callback: (eventData: T, eventState: ObserverEventState) => void,
1597
+ /**
1598
+ * Defines the mask of the observer (used to filter notifications)
1599
+ */
1600
+ mask: number,
1601
+ /**
1602
+ * Defines the current scope used to restore the JS context
1603
+ */
1604
+ scope?: any);
1605
+ }
1606
+
1607
+ /**
1608
+ * A class serves as a medium between the observable and its observers
1609
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed
1610
+ */
1611
+ export declare class ObserverEventState {
1612
+ /**
1613
+ * An Observer can set this property to true to prevent subsequent observers of being notified
1614
+ */
1615
+ skipNextObservers: boolean;
1616
+ /**
1617
+ * Get the mask value that were used to trigger the event corresponding to this EventState object
1618
+ */
1619
+ mask: number;
1620
+ /**
1621
+ * The object that originally notified the event
1622
+ */
1623
+ target?: any;
1624
+ /**
1625
+ * The current object in the bubbling phase
1626
+ */
1627
+ currentTarget?: any;
1628
+ /**
1629
+ * This will be populated with the return value of the last function that was executed.
1630
+ * If it is the first function in the callback chain it will be the event data.
1631
+ */
1632
+ lastReturnValue?: any;
1633
+ /**
1634
+ * Create a new EventState
1635
+ * @param mask - defines the mask associated with this state
1636
+ * @param skipNextObservers - defines a flag which will instruct the observable to skip following observers when set to true
1637
+ * @param target - defines the original target of the state
1638
+ * @param currentTarget - defines the current target of the state
1639
+ */
1640
+ constructor(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any);
1641
+ /**
1642
+ * Initialize the current event state
1643
+ * @param mask - defines the mask associated with this state
1644
+ * @param skipNextObservers - defines a flag which will instruct the observable to skip following observers when set to true
1645
+ * @param target - defines the original target of the state
1646
+ * @param currentTarget - defines the current target of the state
1647
+ * @returns the current event state
1648
+ */
1649
+ initalize(mask: number, skipNextObservers?: boolean, target?: any, currentTarget?: any): ObserverEventState;
1650
+ }
1651
+
1652
+ /**
1653
+ * This event is triggered when you change your camera between 1st and 3rd person
1654
+ * @public
1655
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1656
+ */
1657
+ export declare const onCameraModeChangedObservable: Observable<{
1658
+ cameraMode: 0 | 1 | 2;
1659
+ }>;
1660
+
1661
+ /** @public
1662
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1663
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed. Use onEnterSceneObservable instead. */
1664
+ export declare const onEnterScene: Observable<{
1665
+ userId: string;
1666
+ }>;
1667
+
1668
+ /**
1669
+ * These events are triggered after your character enters the scene.
1670
+ * @public
1671
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1672
+ */
1673
+ export declare const onEnterSceneObservable: Observable<{
1674
+ userId: string;
1675
+ }>;
1676
+
1677
+ /**
1678
+ * This event is triggered when you change your camera between 1st and 3rd person
1679
+ * @public
1680
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1681
+ */
1682
+ export declare const onIdleStateChangedObservable: Observable<{
1683
+ isIdle: boolean;
1684
+ }>;
1685
+
1686
+ /** @public
1687
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1688
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed. Use onLeaveSceneObservable instead. */
1689
+ export declare const onLeaveScene: Observable<{
1690
+ userId: string;
1691
+ }>;
1692
+
1693
+ /**
1694
+ * These events are triggered after your character leaves the scene.
1695
+ * @public
1696
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1697
+ */
1698
+ export declare const onLeaveSceneObservable: Observable<{
1699
+ userId: string;
1700
+ }>;
1701
+
1437
1702
  declare type OnlyNonUndefinedTypes<T> = {
1438
1703
  [K in ExcludeUndefined<T>]: T[K];
1439
1704
  };
@@ -1442,18 +1707,102 @@ declare type OnlyOptionalUndefinedTypes<T> = {
1442
1707
  [K in IncludeUndefined<T>]?: T[K];
1443
1708
  };
1444
1709
 
1710
+ /**
1711
+ * @public
1712
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1713
+ */
1714
+ export declare const onPlayerClickedObservable: Observable<{
1715
+ userId: string;
1716
+ ray: {
1717
+ origin: ReadOnlyVector3;
1718
+ direction: ReadOnlyVector3;
1719
+ distance: number;
1720
+ };
1721
+ }>;
1722
+
1723
+ /**
1724
+ * @public
1725
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1726
+ */
1727
+ export declare const onPlayerConnectedObservable: Observable<{
1728
+ userId: string;
1729
+ }>;
1730
+
1731
+ /**
1732
+ * @public
1733
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1734
+ */
1735
+ export declare const onPlayerDisconnectedObservable: Observable<{
1736
+ userId: string;
1737
+ }>;
1738
+
1739
+ /**
1740
+ * @public
1741
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1742
+ */
1743
+ export declare const onPlayerExpressionObservable: Observable<{
1744
+ expressionId: string;
1745
+ }>;
1746
+
1445
1747
  /** @public */
1446
1748
  export declare const OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>, PBOnPointerDown>;
1447
1749
 
1448
1750
  /** @public */
1449
1751
  export declare const OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>, PBOnPointerDownResult>;
1450
1752
 
1753
+ /**
1754
+ * @public
1755
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1756
+ */
1757
+ export declare const onPointerLockedStateChange: Observable<{
1758
+ locked?: boolean | undefined;
1759
+ }>;
1760
+
1451
1761
  /** @public */
1452
1762
  export declare const OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
1453
1763
 
1454
1764
  /** @public */
1455
1765
  export declare const OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>, PBOnPointerUpResult>;
1456
1766
 
1767
+ /**
1768
+ * @public
1769
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1770
+ */
1771
+ export declare const onProfileChanged: Observable<{
1772
+ ethAddress: string;
1773
+ version: number;
1774
+ }>;
1775
+
1776
+ /**
1777
+ * @public
1778
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1779
+ */
1780
+ export declare const onRealmChangedObservable: Observable<{
1781
+ domain: string;
1782
+ room: string;
1783
+ serverName: string;
1784
+ displayName: string;
1785
+ }>;
1786
+
1787
+ /**
1788
+ * This event is triggered after all the resources of the scene were loaded (models, textures, etc...)
1789
+ * @public
1790
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1791
+ */
1792
+ export declare const onSceneReadyObservable: Observable<{}>;
1793
+
1794
+ /**
1795
+ * @public
1796
+ * @deprecated This function is an inheritance of ECS6, it's here temporary for the feature parity, please read the news and docs to know how handle when it's removed.
1797
+ */
1798
+ export declare const onVideoEvent: Observable<{
1799
+ componentId: string;
1800
+ videoClipId: string;
1801
+ videoStatus: number;
1802
+ currentOffset: number;
1803
+ totalVideoLength: number;
1804
+ }>;
1805
+
1457
1806
  /**
1458
1807
  * Defines potential orientation for back face culling
1459
1808
  * @public
@@ -1744,10 +2093,55 @@ declare interface PBPlaneShape {
1744
2093
  uvs: number[];
1745
2094
  }
1746
2095
 
2096
+ declare interface PBPointerEvents {
2097
+ pointerEvents: PBPointerEvents_Entry[];
2098
+ }
2099
+
2100
+ declare interface PBPointerEvents_Entry {
2101
+ eventType: PointerEventType;
2102
+ eventInfo: PBPointerEvents_Info | undefined;
2103
+ }
2104
+
2105
+ declare interface PBPointerEvents_Info {
2106
+ /** default=ActionButton.ANY */
2107
+ button?: ActionButton | undefined;
2108
+ /** default='Interact' */
2109
+ hoverText?: string | undefined;
2110
+ /** default=10 */
2111
+ maxDistance?: number | undefined;
2112
+ /** default=true */
2113
+ showFeedback?: boolean | undefined;
2114
+ }
2115
+
2116
+ /** the renderer will set this component to the root entity once per frame with all the events */
2117
+ declare interface PBPointerEventsResult {
2118
+ /** a list of the last N pointer commands (from the engine) */
2119
+ commands: PBPointerEventsResult_PointerCommand[];
2120
+ }
2121
+
2122
+ /** this message represents a pointer event, used both for UP and DOWN actions */
2123
+ declare interface PBPointerEventsResult_PointerCommand {
2124
+ /** identifier of the input */
2125
+ button: ActionButton;
2126
+ hit: RaycastHit | undefined;
2127
+ state: PointerEventType;
2128
+ /** could be a Lamport timestamp */
2129
+ timestamp: number;
2130
+ /** if the input is analog then we store it here */
2131
+ analog?: number | undefined;
2132
+ }
2133
+
1747
2134
  declare interface PBPointerLock {
1748
2135
  isPointerLocked: boolean;
1749
2136
  }
1750
2137
 
2138
+ declare interface PBRaycastResult {
2139
+ timestamp: number;
2140
+ origin: Vector3_2 | undefined;
2141
+ direction: Vector3_2 | undefined;
2142
+ hits: RaycastHit[];
2143
+ }
2144
+
1751
2145
  declare interface PBSphereShape {
1752
2146
  /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1753
2147
  withCollisions?: boolean | undefined;
@@ -1916,6 +2310,20 @@ declare namespace Plane {
1916
2310
  /** @public */
1917
2311
  export declare const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
1918
2312
 
2313
+ /** @public */
2314
+ export declare const PointerEvents: ComponentDefinition<ISchema<PBPointerEvents>, PBPointerEvents>;
2315
+
2316
+ /** @public */
2317
+ export declare const PointerEventsResult: ComponentDefinition<ISchema<PBPointerEventsResult>, PBPointerEventsResult>;
2318
+
2319
+ declare const enum PointerEventType {
2320
+ UP = 0,
2321
+ DOWN = 1,
2322
+ HOVER_ENTER = 2,
2323
+ HOVER_LEAVE = 3,
2324
+ UNRECOGNIZED = -1
2325
+ }
2326
+
1919
2327
  /** @public */
1920
2328
  export declare const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
1921
2329
 
@@ -2114,6 +2522,20 @@ export declare namespace Quaternion {
2114
2522
  */
2115
2523
  export declare const RAD2DEG: number;
2116
2524
 
2525
+ /** Position will be relative to the scene */
2526
+ declare interface RaycastHit {
2527
+ position: Vector3_2 | undefined;
2528
+ origin: Vector3_2 | undefined;
2529
+ direction: Vector3_2 | undefined;
2530
+ normalHit: Vector3_2 | undefined;
2531
+ length: number;
2532
+ meshName?: string | undefined;
2533
+ entityId?: number | undefined;
2534
+ }
2535
+
2536
+ /** @public */
2537
+ export declare const RaycastResult: ComponentDefinition<ISchema<PBRaycastResult>, PBRaycastResult>;
2538
+
2117
2539
  /**
2118
2540
  * @public
2119
2541
  */
@@ -2487,6 +2909,16 @@ declare interface Vector3_2 {
2487
2909
  /** @public */
2488
2910
  export declare const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
2489
2911
 
2912
+ /**
2913
+ * Check if an entity emitted a clicked event
2914
+ * @param entity the entity to query, for global clicks use `engine.RootEntity`
2915
+ * @param actionButton
2916
+ * @returns true if the entity was clicked in the last tick-update
2917
+ */
2918
+ export declare function wasEntityClicked(entity: Entity, actionButton: ActionButton): boolean;
2919
+
2920
+ export declare function wasEntityClickedGenerator(engine: IEngine): (entity: Entity, actionButton: ActionButton) => boolean;
2921
+
2490
2922
  declare namespace WireMessage {
2491
2923
  enum Enum {
2492
2924
  RESERVED = 0,