@dcl/sdk 7.0.0-2549756722.commit-32d0daa → 7.0.0-2597145987.commit-a1336ed

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.
@@ -185,6 +185,7 @@ export declare type DeepReadonly<T> = {
185
185
  };
186
186
 
187
187
  declare function defineSdkComponents(engine: Pick<IEngine, 'defineComponent'>): {
188
+ Animator: ComponentDefinition<EcsType<PBAnimator>>;
188
189
  AudioSource: ComponentDefinition<EcsType<PBAudioSource>>;
189
190
  AudioStream: ComponentDefinition<EcsType<PBAudioStream>>;
190
191
  BoxShape: ComponentDefinition<EcsType<PBBoxShape>>;
@@ -234,9 +235,7 @@ export declare type EcsType<T = any> = {
234
235
  /**
235
236
  * @public
236
237
  */
237
- export declare function Engine({ transports }?: {
238
- transports?: Transport[];
239
- }): IEngine;
238
+ export declare function Engine({ transports }?: IEngineParams): IEngine;
240
239
 
241
240
  /**
242
241
  * @alpha * This file initialization is an alpha one. This is based on the old-ecs
@@ -306,6 +305,13 @@ export declare type IEngine = {
306
305
  baseComponents: SdkComponetns;
307
306
  };
308
307
 
308
+ /**
309
+ * @public
310
+ */
311
+ export declare type IEngineParams = {
312
+ transports?: Transport[];
313
+ };
314
+
309
315
  /** Include property keys from T where the property is assignable to U */
310
316
  declare type IncludeUndefined<T> = {
311
317
  [P in keyof T]: undefined extends T[P] ? P : never;
@@ -1099,6 +1105,20 @@ export declare enum Orientation {
1099
1105
  CCW = 1
1100
1106
  }
1101
1107
 
1108
+ declare interface PBAnimationState {
1109
+ name: string;
1110
+ clip: string;
1111
+ playing: boolean;
1112
+ weight: number;
1113
+ speed: number;
1114
+ loop: boolean;
1115
+ shouldReset: boolean;
1116
+ }
1117
+
1118
+ declare interface PBAnimator {
1119
+ states: PBAnimationState[];
1120
+ }
1121
+
1102
1122
  declare interface PBAudioSource {
1103
1123
  playing: boolean;
1104
1124
  volume: number;
@@ -1531,11 +1551,12 @@ export declare namespace Quaternion {
1531
1551
  export declare const RAD2DEG: number;
1532
1552
 
1533
1553
  declare type ReceiveMessage = {
1554
+ type: WireMessage.Enum;
1534
1555
  entity: Entity;
1535
1556
  componentId: number;
1536
1557
  timestamp: number;
1537
1558
  transportType?: string;
1538
- data: Uint8Array;
1559
+ data?: Uint8Array;
1539
1560
  messageBuffer: Uint8Array;
1540
1561
  };
1541
1562
 
@@ -1601,11 +1622,13 @@ declare type Transport = {
1601
1622
  type: string;
1602
1623
  send(message: Uint8Array): void;
1603
1624
  onmessage?(message: Uint8Array): void;
1604
- filter(message: TransportMessage): boolean;
1625
+ filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
1605
1626
  };
1606
1627
 
1607
1628
  declare type TransportMessage = Omit<ReceiveMessage, 'data'>;
1608
1629
 
1630
+ declare type Uint32 = number;
1631
+
1609
1632
  /**
1610
1633
  * @public
1611
1634
  */
@@ -1819,6 +1842,30 @@ export declare namespace Vector3 {
1819
1842
  export function Left(): MutableVector3;
1820
1843
  }
1821
1844
 
1845
+ declare namespace WireMessage {
1846
+ enum Enum {
1847
+ RESERVED = 0,
1848
+ PUT_COMPONENT = 1,
1849
+ DELETE_COMPONENT = 2,
1850
+ MAX_MESSAGE_TYPE = 3
1851
+ }
1852
+ /**
1853
+ * @param length - Uint32 the length of all message (including the header)
1854
+ * @param type - define the function which handles the data
1855
+ */
1856
+ type Header = {
1857
+ length: Uint32;
1858
+ type: Uint32;
1859
+ };
1860
+ const HEADER_LENGTH = 8;
1861
+ /**
1862
+ * Validate if the message incoming is completed
1863
+ * @param buf
1864
+ */
1865
+ function validate(buf: ByteBuffer): boolean;
1866
+ function readHeader(buf: ByteBuffer): Header | null;
1867
+ }
1868
+
1822
1869
  declare enum YGAlign {
1823
1870
  YGAlignAuto = 0,
1824
1871
  YGAlignFlexStart = 1,