@dcl/sdk 7.0.0-2590698369.commit-b86034f → 7.0.0-2598216837.commit-b035f0c

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.
@@ -192,6 +192,10 @@ declare function defineSdkComponents(engine: Pick<IEngine, 'defineComponent'>):
192
192
  CylinderShape: ComponentDefinition<EcsType<PBCylinderShape>>;
193
193
  GLTFShape: ComponentDefinition<EcsType<PBGLTFShape>>;
194
194
  NFTShape: ComponentDefinition<EcsType<PBNFTShape>>;
195
+ OnPointerDown: ComponentDefinition<EcsType<PBOnPointerDown>>;
196
+ OnPointerDownResult: ComponentDefinition<EcsType<PBOnPointerDownResult>>;
197
+ OnPointerUp: ComponentDefinition<EcsType<PBOnPointerUp>>;
198
+ OnPointerUpResult: ComponentDefinition<EcsType<PBOnPointerUpResult>>;
195
199
  PlaneShape: ComponentDefinition<EcsType<PBPlaneShape>>;
196
200
  SphereShape: ComponentDefinition<EcsType<PBSphereShape>>;
197
201
  TextShape: ComponentDefinition<EcsType<PBTextShape>>;
@@ -1169,6 +1173,42 @@ declare interface PBNFTShape {
1169
1173
  color: Color3 | undefined;
1170
1174
  }
1171
1175
 
1176
+ declare interface PBOnPointerDown {
1177
+ button: number;
1178
+ hoverText: string;
1179
+ distance: number;
1180
+ showFeedback: boolean;
1181
+ }
1182
+
1183
+ declare interface PBOnPointerDownResult {
1184
+ button: number;
1185
+ meshName: string;
1186
+ origin: Vector3_2 | undefined;
1187
+ direction: Vector3_2 | undefined;
1188
+ point: Vector3_2 | undefined;
1189
+ normal: Vector3_2 | undefined;
1190
+ distance: number;
1191
+ timestamp: number;
1192
+ }
1193
+
1194
+ declare interface PBOnPointerUp {
1195
+ button: number;
1196
+ hoverText: string;
1197
+ distance: number;
1198
+ showFeedback: boolean;
1199
+ }
1200
+
1201
+ declare interface PBOnPointerUpResult {
1202
+ button: number;
1203
+ meshName: string;
1204
+ origin: Vector3_2 | undefined;
1205
+ direction: Vector3_2 | undefined;
1206
+ point: Vector3_2 | undefined;
1207
+ normal: Vector3_2 | undefined;
1208
+ distance: number;
1209
+ timestamp: number;
1210
+ }
1211
+
1172
1212
  declare interface PBPlaneShape {
1173
1213
  withCollisions: boolean;
1174
1214
  isPointerBlocker: boolean;
@@ -1551,11 +1591,12 @@ export declare namespace Quaternion {
1551
1591
  export declare const RAD2DEG: number;
1552
1592
 
1553
1593
  declare type ReceiveMessage = {
1594
+ type: WireMessage.Enum;
1554
1595
  entity: Entity;
1555
1596
  componentId: number;
1556
1597
  timestamp: number;
1557
1598
  transportType?: string;
1558
- data: Uint8Array;
1599
+ data?: Uint8Array;
1559
1600
  messageBuffer: Uint8Array;
1560
1601
  };
1561
1602
 
@@ -1621,11 +1662,13 @@ declare type Transport = {
1621
1662
  type: string;
1622
1663
  send(message: Uint8Array): void;
1623
1664
  onmessage?(message: Uint8Array): void;
1624
- filter(message: TransportMessage): boolean;
1665
+ filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
1625
1666
  };
1626
1667
 
1627
1668
  declare type TransportMessage = Omit<ReceiveMessage, 'data'>;
1628
1669
 
1670
+ declare type Uint32 = number;
1671
+
1629
1672
  /**
1630
1673
  * @public
1631
1674
  */
@@ -1839,6 +1882,36 @@ export declare namespace Vector3 {
1839
1882
  export function Left(): MutableVector3;
1840
1883
  }
1841
1884
 
1885
+ declare interface Vector3_2 {
1886
+ x: number;
1887
+ y: number;
1888
+ z: number;
1889
+ }
1890
+
1891
+ declare namespace WireMessage {
1892
+ enum Enum {
1893
+ RESERVED = 0,
1894
+ PUT_COMPONENT = 1,
1895
+ DELETE_COMPONENT = 2,
1896
+ MAX_MESSAGE_TYPE = 3
1897
+ }
1898
+ /**
1899
+ * @param length - Uint32 the length of all message (including the header)
1900
+ * @param type - define the function which handles the data
1901
+ */
1902
+ type Header = {
1903
+ length: Uint32;
1904
+ type: Uint32;
1905
+ };
1906
+ const HEADER_LENGTH = 8;
1907
+ /**
1908
+ * Validate if the message incoming is completed
1909
+ * @param buf
1910
+ */
1911
+ function validate(buf: ByteBuffer): boolean;
1912
+ function readHeader(buf: ByteBuffer): Header | null;
1913
+ }
1914
+
1842
1915
  declare enum YGAlign {
1843
1916
  YGAlignAuto = 0,
1844
1917
  YGAlignFlexStart = 1,