@dcl/playground-assets 7.0.5 → 7.0.6-3713220614.commit-d02ef9f

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/sdk",
3
- "version": "7.0.5",
3
+ "version": "7.0.6-3713220614.commit-d02ef9f",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
@@ -25,5 +25,5 @@
25
25
  "@dcl/unity-renderer": "1.0.66458-20221207172857.commit-1a83854"
26
26
  },
27
27
  "minCliVersion": "3.14.1",
28
- "commit": "ad4efbcb7b87a23d25c26ca96f80d3ff795fcd9d"
28
+ "commit": "d02ef9fa9c36da3f26f7b1313e57cb4ccce5c539"
29
29
  }
@@ -1042,6 +1042,7 @@ export declare type ComponentDefinition<T extends ISchema<ConstructorType>, Cons
1042
1042
  */
1043
1043
  createOrReplace(entity: Entity, val?: ConstructorType): ComponentType<T>;
1044
1044
  /**
1045
+ * @public
1045
1046
  * Delete the current component to an entity, return null if the entity doesn't have the current component.
1046
1047
  * - Internal comment: This method adds the &lt;entity,component&gt; to the list to be reviewed next frame
1047
1048
  * @param entity - Entity to delete the component from
@@ -1350,6 +1351,12 @@ export declare type IEngine = {
1350
1351
  * @returns if it was found and removed
1351
1352
  */
1352
1353
  removeSystem(selector: string | SystemFn): boolean;
1354
+ /**
1355
+ * Registers a custom component definition.
1356
+ * @param component - The component definition
1357
+ * @param componentId - unique id to identify the component, if the component id already exist, it will fail.
1358
+ */
1359
+ registerCustomComponent<T extends ISchema, V>(component: ComponentDefinition<T, V>, componentId: number): ComponentDefinition<T, V>;
1353
1360
  /**
1354
1361
  * Define a component and add it to the engine.
1355
1362
  * @param spec - An object with schema fields
@@ -1415,7 +1422,7 @@ export declare type IEngine = {
1415
1422
  /**
1416
1423
  * @param deltaTime - deltaTime in seconds
1417
1424
  */
1418
- update(deltaTime: number): void;
1425
+ update(deltaTime: number): Promise<void>;
1419
1426
  /**
1420
1427
  * @public
1421
1428
  * Refer to the root of the scene, all Transforms without a parent are parenting with RootEntity.
@@ -4031,7 +4038,7 @@ export declare type ReceiveMessage = {
4031
4038
  entity: Entity;
4032
4039
  componentId: number;
4033
4040
  timestamp: number;
4034
- transportType?: string;
4041
+ transportId?: number;
4035
4042
  data?: Uint8Array;
4036
4043
  messageBuffer: Uint8Array;
4037
4044
  };
@@ -4406,8 +4413,7 @@ export declare type TransformType = {
4406
4413
  };
4407
4414
 
4408
4415
  export declare type Transport = {
4409
- type: string;
4410
- send(message: Uint8Array): void;
4416
+ send(message: Uint8Array): Promise<void>;
4411
4417
  onmessage?(message: Uint8Array): void;
4412
4418
  filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
4413
4419
  };
@@ -5120,6 +5126,7 @@ export declare namespace WireMessage {
5120
5126
  */
5121
5127
  export function validate(buf: ByteBuffer): boolean;
5122
5128
  export function readHeader(buf: ByteBuffer): Header | null;
5129
+ export function getType(component: ComponentDefinition<ISchema<unknown>, unknown>, entity: Entity): Enum;
5123
5130
  }
5124
5131
 
5125
5132
  export declare const enum YGAlign {
@@ -7430,7 +7430,7 @@
7430
7430
  },
7431
7431
  {
7432
7432
  "kind": "Reference",
7433
- "text": "CompDef",
7433
+ "text": "ComponentDefinition",
7434
7434
  "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
7435
7435
  },
7436
7436
  {
@@ -7439,7 +7439,7 @@
7439
7439
  },
7440
7440
  {
7441
7441
  "kind": "Reference",
7442
- "text": "CompDef",
7442
+ "text": "ComponentDefinition",
7443
7443
  "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
7444
7444
  },
7445
7445
  {
@@ -7456,7 +7456,7 @@
7456
7456
  },
7457
7457
  {
7458
7458
  "kind": "Reference",
7459
- "text": "CompDef",
7459
+ "text": "ComponentDefinition",
7460
7460
  "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
7461
7461
  },
7462
7462
  {
@@ -9564,7 +9564,34 @@
9564
9564
  },
9565
9565
  {
9566
9566
  "kind": "Content",
9567
- "text": "): boolean;\n defineComponent<T extends "
9567
+ "text": "): boolean;\n registerCustomComponent<T extends "
9568
+ },
9569
+ {
9570
+ "kind": "Reference",
9571
+ "text": "ISchema",
9572
+ "canonicalReference": "@dcl/playground-assets!ISchema:type"
9573
+ },
9574
+ {
9575
+ "kind": "Content",
9576
+ "text": ", V>(component: "
9577
+ },
9578
+ {
9579
+ "kind": "Reference",
9580
+ "text": "ComponentDefinition",
9581
+ "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
9582
+ },
9583
+ {
9584
+ "kind": "Content",
9585
+ "text": "<T, V>, componentId: number): "
9586
+ },
9587
+ {
9588
+ "kind": "Reference",
9589
+ "text": "ComponentDefinition",
9590
+ "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
9591
+ },
9592
+ {
9593
+ "kind": "Content",
9594
+ "text": "<T, V>;\n defineComponent<T extends "
9568
9595
  },
9569
9596
  {
9570
9597
  "kind": "Reference",
@@ -9595,7 +9622,7 @@
9595
9622
  },
9596
9623
  {
9597
9624
  "kind": "Reference",
9598
- "text": "CompDef",
9625
+ "text": "ComponentDefinition",
9599
9626
  "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
9600
9627
  },
9601
9628
  {
@@ -9649,7 +9676,7 @@
9649
9676
  },
9650
9677
  {
9651
9678
  "kind": "Reference",
9652
- "text": "CompDef",
9679
+ "text": "ComponentDefinition",
9653
9680
  "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
9654
9681
  },
9655
9682
  {
@@ -9667,7 +9694,7 @@
9667
9694
  },
9668
9695
  {
9669
9696
  "kind": "Reference",
9670
- "text": "CompDef",
9697
+ "text": "ComponentDefinition",
9671
9698
  "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
9672
9699
  },
9673
9700
  {
@@ -9685,7 +9712,7 @@
9685
9712
  },
9686
9713
  {
9687
9714
  "kind": "Reference",
9688
- "text": "CompDef",
9715
+ "text": "ComponentDefinition",
9689
9716
  "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
9690
9717
  },
9691
9718
  {
@@ -9694,7 +9721,7 @@
9694
9721
  },
9695
9722
  {
9696
9723
  "kind": "Reference",
9697
- "text": "CompDef",
9724
+ "text": "ComponentDefinition",
9698
9725
  "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
9699
9726
  },
9700
9727
  {
@@ -9703,7 +9730,7 @@
9703
9730
  },
9704
9731
  {
9705
9732
  "kind": "Reference",
9706
- "text": "CompDef",
9733
+ "text": "ComponentDefinition",
9707
9734
  "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
9708
9735
  },
9709
9736
  {
@@ -9735,7 +9762,16 @@
9735
9762
  },
9736
9763
  {
9737
9764
  "kind": "Content",
9738
- "text": "<T>]>;\n update(deltaTime: number): void;\n readonly RootEntity: "
9765
+ "text": "<T>]>;\n update(deltaTime: number): "
9766
+ },
9767
+ {
9768
+ "kind": "Reference",
9769
+ "text": "Promise",
9770
+ "canonicalReference": "!Promise:interface"
9771
+ },
9772
+ {
9773
+ "kind": "Content",
9774
+ "text": "<void>;\n readonly RootEntity: "
9739
9775
  },
9740
9776
  {
9741
9777
  "kind": "Reference",
@@ -9783,7 +9819,7 @@
9783
9819
  "name": "IEngine",
9784
9820
  "typeTokenRange": {
9785
9821
  "startIndex": 1,
9786
- "endIndex": 60
9822
+ "endIndex": 68
9787
9823
  }
9788
9824
  },
9789
9825
  {
@@ -36902,7 +36938,7 @@
36902
36938
  },
36903
36939
  {
36904
36940
  "kind": "Content",
36905
- "text": ";\n componentId: number;\n timestamp: number;\n transportType?: string;\n data?: "
36941
+ "text": ";\n componentId: number;\n timestamp: number;\n transportId?: number;\n data?: "
36906
36942
  },
36907
36943
  {
36908
36944
  "kind": "Reference",
@@ -40337,7 +40373,7 @@
40337
40373
  },
40338
40374
  {
40339
40375
  "kind": "Content",
40340
- "text": "{\n type: string;\n send(message: "
40376
+ "text": "{\n send(message: "
40341
40377
  },
40342
40378
  {
40343
40379
  "kind": "Reference",
@@ -40346,7 +40382,16 @@
40346
40382
  },
40347
40383
  {
40348
40384
  "kind": "Content",
40349
- "text": "): void;\n onmessage?(message: "
40385
+ "text": "): "
40386
+ },
40387
+ {
40388
+ "kind": "Reference",
40389
+ "text": "Promise",
40390
+ "canonicalReference": "!Promise:interface"
40391
+ },
40392
+ {
40393
+ "kind": "Content",
40394
+ "text": "<void>;\n onmessage?(message: "
40350
40395
  },
40351
40396
  {
40352
40397
  "kind": "Reference",
@@ -40385,7 +40430,7 @@
40385
40430
  "name": "Transport",
40386
40431
  "typeTokenRange": {
40387
40432
  "startIndex": 1,
40388
- "endIndex": 10
40433
+ "endIndex": 12
40389
40434
  }
40390
40435
  },
40391
40436
  {
@@ -46919,6 +46964,82 @@
46919
46964
  }
46920
46965
  ]
46921
46966
  },
46967
+ {
46968
+ "kind": "Function",
46969
+ "canonicalReference": "@dcl/playground-assets!WireMessage.getType:function(1)",
46970
+ "docComment": "",
46971
+ "excerptTokens": [
46972
+ {
46973
+ "kind": "Content",
46974
+ "text": "function getType(component: "
46975
+ },
46976
+ {
46977
+ "kind": "Reference",
46978
+ "text": "ComponentDefinition",
46979
+ "canonicalReference": "@dcl/playground-assets!ComponentDefinition:type"
46980
+ },
46981
+ {
46982
+ "kind": "Content",
46983
+ "text": "<"
46984
+ },
46985
+ {
46986
+ "kind": "Reference",
46987
+ "text": "ISchema",
46988
+ "canonicalReference": "@dcl/playground-assets!ISchema:type"
46989
+ },
46990
+ {
46991
+ "kind": "Content",
46992
+ "text": "<unknown>, unknown>"
46993
+ },
46994
+ {
46995
+ "kind": "Content",
46996
+ "text": ", entity: "
46997
+ },
46998
+ {
46999
+ "kind": "Reference",
47000
+ "text": "Entity",
47001
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
47002
+ },
47003
+ {
47004
+ "kind": "Content",
47005
+ "text": "): "
47006
+ },
47007
+ {
47008
+ "kind": "Reference",
47009
+ "text": "Enum",
47010
+ "canonicalReference": "@dcl/playground-assets!WireMessage.Enum:enum"
47011
+ },
47012
+ {
47013
+ "kind": "Content",
47014
+ "text": ";"
47015
+ }
47016
+ ],
47017
+ "returnTypeTokenRange": {
47018
+ "startIndex": 8,
47019
+ "endIndex": 9
47020
+ },
47021
+ "releaseTag": "Public",
47022
+ "overloadIndex": 1,
47023
+ "parameters": [
47024
+ {
47025
+ "parameterName": "component",
47026
+ "parameterTypeTokenRange": {
47027
+ "startIndex": 1,
47028
+ "endIndex": 5
47029
+ },
47030
+ "isOptional": false
47031
+ },
47032
+ {
47033
+ "parameterName": "entity",
47034
+ "parameterTypeTokenRange": {
47035
+ "startIndex": 6,
47036
+ "endIndex": 7
47037
+ },
47038
+ "isOptional": false
47039
+ }
47040
+ ],
47041
+ "name": "getType"
47042
+ },
46922
47043
  {
46923
47044
  "kind": "Variable",
46924
47045
  "canonicalReference": "@dcl/playground-assets!WireMessage.HEADER_LENGTH:var",
@@ -654,12 +654,13 @@ export type IEngine = {
654
654
  entityExists(entity: Entity): boolean;
655
655
  addSystem(system: SystemFn, priority?: number, name?: string): void;
656
656
  removeSystem(selector: string | SystemFn): boolean;
657
+ registerCustomComponent<T extends ISchema, V>(component: ComponentDefinition<T, V>, componentId: number): ComponentDefinition<T, V>;
657
658
  defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType): ComponentDefinition<ISchema<Result<T>>, Partial<Result<T>>>;
658
659
  defineComponentFromSchema<T extends ISchema<ConstructorType>, ConstructorType>(spec: T, componentId: number, constructorDefault?: ConstructorType): ComponentDefinition<T, ConstructorType>;
659
660
  getComponent<T extends ISchema>(componentId: number): ComponentDefinition<T>;
660
661
  getComponentOrNull<T extends ISchema>(componentId: number): ComponentDefinition<T> | null;
661
662
  getEntitiesWith<T extends [ComponentDefinition<any>, ...ComponentDefinition<any>[]]>(...components: T): Iterable<[Entity, ...ReadonlyComponentSchema<T>]>;
662
- update(deltaTime: number): void;
663
+ update(deltaTime: number): Promise<void>;
663
664
  readonly RootEntity: Entity;
664
665
  readonly PlayerEntity: Entity;
665
666
  readonly CameraEntity: Entity;
@@ -2598,7 +2599,7 @@ export type ReceiveMessage = {
2598
2599
  entity: Entity;
2599
2600
  componentId: number;
2600
2601
  timestamp: number;
2601
- transportType?: string;
2602
+ transportId?: number;
2602
2603
  data?: Uint8Array;
2603
2604
  messageBuffer: Uint8Array;
2604
2605
  };
@@ -2850,8 +2851,7 @@ export type TransformType = {
2850
2851
  //
2851
2852
  // @public (undocumented)
2852
2853
  export type Transport = {
2853
- type: string;
2854
- send(message: Uint8Array): void;
2854
+ send(message: Uint8Array): Promise<void>;
2855
2855
  onmessage?(message: Uint8Array): void;
2856
2856
  filter(message: Omit<TransportMessage, 'messageBuffer'>): boolean;
2857
2857
  };
@@ -3079,15 +3079,17 @@ export namespace WireMessage {
3079
3079
  RESERVED = 0
3080
3080
  }
3081
3081
  // (undocumented)
3082
+ export function getType(component: ComponentDefinition<ISchema<unknown>, unknown>, entity: Entity): Enum;
3083
+ // (undocumented)
3082
3084
  export type Header = {
3083
3085
  length: Uint32;
3084
3086
  type: Uint32;
3085
3087
  };
3086
- // (undocumented)
3087
- export function readHeader(buf: ByteBuffer): Header | null;
3088
3088
  const // (undocumented)
3089
3089
  HEADER_LENGTH = 8;
3090
3090
  // (undocumented)
3091
+ export function readHeader(buf: ByteBuffer): Header | null;
3092
+ // (undocumented)
3091
3093
  export type Uint32 = number;
3092
3094
  export function validate(buf: ByteBuffer): boolean;
3093
3095
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/playground-assets",
3
- "version": "7.0.5",
3
+ "version": "7.0.6-3713220614.commit-d02ef9f",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "typings": "./dist/index.d.ts",
@@ -17,12 +17,12 @@
17
17
  "author": "Decentraland",
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@dcl/sdk": "7.0.5"
20
+ "@dcl/sdk": "7.0.6-3713220614.commit-d02ef9f"
21
21
  },
22
22
  "minCliVersion": "3.12.3",
23
23
  "files": [
24
24
  "dist",
25
25
  "etc"
26
26
  ],
27
- "commit": "ad4efbcb7b87a23d25c26ca96f80d3ff795fcd9d"
27
+ "commit": "d02ef9fa9c36da3f26f7b1313e57cb4ccce5c539"
28
28
  }