@dcl/playground-assets 7.0.6-3808797047.commit-ee7ea04 → 7.0.6-3808988484.commit-63d3e2c

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.6-3808797047.commit-ee7ea04",
3
+ "version": "7.0.6-3808988484.commit-63d3e2c",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
@@ -31,5 +31,5 @@
31
31
  "displayName": "SDK",
32
32
  "tsconfig": "./tsconfig.json"
33
33
  },
34
- "commit": "ee7ea0434ecbd9e92db737237a67cd02af989b73"
34
+ "commit": "63d3e2c15a5a2d09285eca1b08d3832a12f75f13"
35
35
  }
@@ -1,5 +1,7 @@
1
1
  import _m0 from 'protobufjs/minimal';
2
2
 
3
+ export declare const AMOUNT_VERSION_AVAILABLE: number;
4
+
3
5
  export declare const Animator: AnimatorComponentDefinitionExtended;
4
6
 
5
7
  /**
@@ -981,8 +983,8 @@ export declare type Color4Type = {
981
983
  };
982
984
 
983
985
  export declare type CommonProps = {
984
- key: Key;
985
- children: Children;
986
+ key?: Key;
987
+ children?: Children;
986
988
  };
987
989
 
988
990
  /**
@@ -1182,9 +1184,20 @@ export declare type EngineEvent<T extends IEventNames = IEventNames, V = IEvents
1182
1184
  };
1183
1185
 
1184
1186
  /**
1185
- * @public
1187
+ * @public The Entity is a number type, the cast is only for typescript, the final javascript code treat as a number
1188
+ * version number
1189
+ * [31...16][15...0]
1190
+ *
1191
+ * Convertion from entity to its compound numbers:
1192
+ * To get the version => ((entity & MASK_UPPER_16_ON_32) >> 16) & MAX_U16
1193
+ * To get the number => entity & MAX_U16
1194
+ *
1195
+ * Convertion from its compound numbers to entity:
1196
+ * entity = (entityNumber & MAX_U16) | ((entityVersion & MAX_U16) << 16)
1186
1197
  */
1187
- export declare type Entity = unknown;
1198
+ export declare type Entity = uint32 & {
1199
+ __entity_type: '';
1200
+ };
1188
1201
 
1189
1202
  export declare type EntityComponents = {
1190
1203
  uiTransform: PBUiTransform;
@@ -1197,10 +1210,13 @@ export declare type EntityComponents = {
1197
1210
  };
1198
1211
 
1199
1212
  export declare function EntityContainer(): {
1200
- generateEntity(dynamic?: boolean): Entity;
1213
+ generateEntity(): Entity;
1201
1214
  removeEntity(entity: Entity): boolean;
1202
1215
  entityExists(entity: Entity): boolean;
1203
1216
  getExistingEntities(): Set<Entity>;
1217
+ entityVersion: (entity: Entity) => number;
1218
+ entityNumber: (entity: Entity) => number;
1219
+ entityId: (entityNumber: number, entityVersion: number) => Entity;
1204
1220
  };
1205
1221
 
1206
1222
  /**
@@ -1209,7 +1225,7 @@ export declare function EntityContainer(): {
1209
1225
  export declare type EntityPropTypes = {
1210
1226
  uiTransform?: UiTransformProps;
1211
1227
  uiBackground?: UiBackgroundProps;
1212
- } & Listeners;
1228
+ } & Listeners & Pick<CommonProps, 'key'>;
1213
1229
 
1214
1230
  /**
1215
1231
  * Constant used to define the minimal number value in Babylon.js
@@ -1695,6 +1711,8 @@ export declare type MapResult<T extends Spec> = ToOptional<{
1695
1711
  [K in keyof T]: T[K] extends ISchema ? ReturnType<T[K]['deserialize']> : T[K] extends Spec ? MapResult<T[K]> : never;
1696
1712
  }>;
1697
1713
 
1714
+ export declare const MASK_UPPER_16_ON_32 = 4294901760;
1715
+
1698
1716
  export declare const Material: MaterialComponentDefinitionExtended;
1699
1717
 
1700
1718
  /**
@@ -2463,6 +2481,13 @@ export declare namespace Matrix {
2463
2481
  export function toggleProjectionMatrixHandInPlace(self: MutableMatrix): void;
2464
2482
  }
2465
2483
 
2484
+ /**
2485
+ * @public
2486
+ */
2487
+ export declare const MAX_ENTITY_NUMBER = 65535;
2488
+
2489
+ export declare const MAX_U16 = 65535;
2490
+
2466
2491
  export declare const MeshCollider: MeshColliderComponentDefinitionExtended;
2467
2492
 
2468
2493
  /**
@@ -3699,12 +3724,12 @@ export declare const PointerEventsResult: ComponentDefinition<PBPointerEventsRes
3699
3724
  export declare type PointerEventsSystem = ReturnType<typeof createPointerEventSystem>;
3700
3725
 
3701
3726
  export declare const pointerEventsSystem: {
3702
- removeOnClick(entity: unknown): void;
3703
- removeOnPointerDown(entity: unknown): void;
3704
- removeOnPointerUp(entity: unknown): void;
3705
- onClick(entity: unknown, cb: EventSystemCallback, opts?: Partial<EventSystemOptions> | undefined): void;
3706
- onPointerDown(entity: unknown, cb: EventSystemCallback, opts?: Partial<EventSystemOptions> | undefined): void;
3707
- onPointerUp(entity: unknown, cb: EventSystemCallback, opts?: Partial<EventSystemOptions> | undefined): void;
3727
+ removeOnClick(entity: Entity): void;
3728
+ removeOnPointerDown(entity: Entity): void;
3729
+ removeOnPointerUp(entity: Entity): void;
3730
+ onClick(entity: Entity, cb: EventSystemCallback, opts?: Partial<EventSystemOptions> | undefined): void;
3731
+ onPointerDown(entity: Entity, cb: EventSystemCallback, opts?: Partial<EventSystemOptions> | undefined): void;
3732
+ onPointerUp(entity: Entity, cb: EventSystemCallback, opts?: Partial<EventSystemOptions> | undefined): void;
3708
3733
  };
3709
3734
 
3710
3735
  export declare const enum PointerEventType {
@@ -4067,6 +4092,11 @@ export declare type ReceiveMessage = {
4067
4092
  messageBuffer: Uint8Array;
4068
4093
  };
4069
4094
 
4095
+ /**
4096
+ * @public This first 512 entities are reserved by the renderer
4097
+ */
4098
+ export declare const RESERVED_STATIC_ENTITIES = 512;
4099
+
4070
4100
  export declare type RPCSendableMessage = {
4071
4101
  jsonrpc: '2.0';
4072
4102
  id: number;
@@ -4507,6 +4537,11 @@ export declare type UiInputProps = PBUiInput & {
4507
4537
  /** @public */
4508
4538
  export declare const UiInputResult: ComponentDefinition<PBUiInputResult>;
4509
4539
 
4540
+ /**
4541
+ * @public It only defines the type explicitly, no effects.
4542
+ */
4543
+ export declare type uint32 = number;
4544
+
4510
4545
  /** @public */
4511
4546
  export declare const UiText: ComponentDefinition<PBUiText>;
4512
4547
 
@@ -172,6 +172,29 @@
172
172
  "name": "",
173
173
  "preserveMemberOrder": false,
174
174
  "members": [
175
+ {
176
+ "kind": "Variable",
177
+ "canonicalReference": "@dcl/playground-assets!AMOUNT_VERSION_AVAILABLE:var",
178
+ "docComment": "",
179
+ "excerptTokens": [
180
+ {
181
+ "kind": "Content",
182
+ "text": "AMOUNT_VERSION_AVAILABLE: "
183
+ },
184
+ {
185
+ "kind": "Content",
186
+ "text": "number"
187
+ }
188
+ ],
189
+ "fileUrlPath": "../ecs/dist/engine/entity.d.ts",
190
+ "isReadonly": true,
191
+ "releaseTag": "Public",
192
+ "name": "AMOUNT_VERSION_AVAILABLE",
193
+ "variableTypeTokenRange": {
194
+ "startIndex": 1,
195
+ "endIndex": 2
196
+ }
197
+ },
175
198
  {
176
199
  "kind": "Variable",
177
200
  "canonicalReference": "@dcl/playground-assets!Animator:var",
@@ -7066,7 +7089,7 @@
7066
7089
  },
7067
7090
  {
7068
7091
  "kind": "Content",
7069
- "text": "{\n key: "
7092
+ "text": "{\n key?: "
7070
7093
  },
7071
7094
  {
7072
7095
  "kind": "Reference",
@@ -7075,7 +7098,7 @@
7075
7098
  },
7076
7099
  {
7077
7100
  "kind": "Content",
7078
- "text": ";\n children: "
7101
+ "text": ";\n children?: "
7079
7102
  },
7080
7103
  {
7081
7104
  "kind": "Reference",
@@ -8511,15 +8534,20 @@
8511
8534
  {
8512
8535
  "kind": "TypeAlias",
8513
8536
  "canonicalReference": "@dcl/playground-assets!Entity:type",
8514
- "docComment": "/**\n * @public\n */\n",
8537
+ "docComment": "/**\n * The Entity is a number type, the cast is only for typescript, the final javascript code treat as a number version number [31...16][15...0]\n *\n * Convertion from entity to its compound numbers: To get the version => ((entity & MASK_UPPER_16_ON_32) >> 16) & MAX_U16 To get the number => entity & MAX_U16\n *\n * Convertion from its compound numbers to entity: entity = (entityNumber & MAX_U16) | ((entityVersion & MAX_U16) << 16)\n *\n * @public\n */\n",
8515
8538
  "excerptTokens": [
8516
8539
  {
8517
8540
  "kind": "Content",
8518
8541
  "text": "export declare type Entity = "
8519
8542
  },
8543
+ {
8544
+ "kind": "Reference",
8545
+ "text": "uint32",
8546
+ "canonicalReference": "@dcl/playground-assets!uint32:type"
8547
+ },
8520
8548
  {
8521
8549
  "kind": "Content",
8522
- "text": "unknown"
8550
+ "text": " & {\n __entity_type: '';\n}"
8523
8551
  },
8524
8552
  {
8525
8553
  "kind": "Content",
@@ -8531,7 +8559,7 @@
8531
8559
  "name": "Entity",
8532
8560
  "typeTokenRange": {
8533
8561
  "startIndex": 1,
8534
- "endIndex": 2
8562
+ "endIndex": 3
8535
8563
  }
8536
8564
  },
8537
8565
  {
@@ -8634,7 +8662,7 @@
8634
8662
  },
8635
8663
  {
8636
8664
  "kind": "Content",
8637
- "text": "{\n generateEntity(dynamic?: boolean): "
8665
+ "text": "{\n generateEntity(): "
8638
8666
  },
8639
8667
  {
8640
8668
  "kind": "Reference",
@@ -8679,7 +8707,34 @@
8679
8707
  },
8680
8708
  {
8681
8709
  "kind": "Content",
8682
- "text": ">;\n}"
8710
+ "text": ">;\n entityVersion: (entity: "
8711
+ },
8712
+ {
8713
+ "kind": "Reference",
8714
+ "text": "Entity",
8715
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
8716
+ },
8717
+ {
8718
+ "kind": "Content",
8719
+ "text": ") => number;\n entityNumber: (entity: "
8720
+ },
8721
+ {
8722
+ "kind": "Reference",
8723
+ "text": "Entity",
8724
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
8725
+ },
8726
+ {
8727
+ "kind": "Content",
8728
+ "text": ") => number;\n entityId: (entityNumber: number, entityVersion: number) => "
8729
+ },
8730
+ {
8731
+ "kind": "Reference",
8732
+ "text": "Entity",
8733
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
8734
+ },
8735
+ {
8736
+ "kind": "Content",
8737
+ "text": ";\n}"
8683
8738
  },
8684
8739
  {
8685
8740
  "kind": "Content",
@@ -8689,7 +8744,7 @@
8689
8744
  "fileUrlPath": "../ecs/dist/engine/entity.d.ts",
8690
8745
  "returnTypeTokenRange": {
8691
8746
  "startIndex": 1,
8692
- "endIndex": 12
8747
+ "endIndex": 18
8693
8748
  },
8694
8749
  "releaseTag": "Public",
8695
8750
  "overloadIndex": 1,
@@ -8732,6 +8787,28 @@
8732
8787
  "text": "Listeners",
8733
8788
  "canonicalReference": "@dcl/playground-assets!Listeners:type"
8734
8789
  },
8790
+ {
8791
+ "kind": "Content",
8792
+ "text": " & "
8793
+ },
8794
+ {
8795
+ "kind": "Reference",
8796
+ "text": "Pick",
8797
+ "canonicalReference": "!Pick:type"
8798
+ },
8799
+ {
8800
+ "kind": "Content",
8801
+ "text": "<"
8802
+ },
8803
+ {
8804
+ "kind": "Reference",
8805
+ "text": "CommonProps",
8806
+ "canonicalReference": "@dcl/playground-assets!CommonProps:type"
8807
+ },
8808
+ {
8809
+ "kind": "Content",
8810
+ "text": ", 'key'>"
8811
+ },
8735
8812
  {
8736
8813
  "kind": "Content",
8737
8814
  "text": ";"
@@ -8742,7 +8819,7 @@
8742
8819
  "name": "EntityPropTypes",
8743
8820
  "typeTokenRange": {
8744
8821
  "startIndex": 1,
8745
- "endIndex": 7
8822
+ "endIndex": 12
8746
8823
  }
8747
8824
  },
8748
8825
  {
@@ -12260,6 +12337,33 @@
12260
12337
  "endIndex": 13
12261
12338
  }
12262
12339
  },
12340
+ {
12341
+ "kind": "Variable",
12342
+ "canonicalReference": "@dcl/playground-assets!MASK_UPPER_16_ON_32:var",
12343
+ "docComment": "",
12344
+ "excerptTokens": [
12345
+ {
12346
+ "kind": "Content",
12347
+ "text": "MASK_UPPER_16_ON_32 = "
12348
+ },
12349
+ {
12350
+ "kind": "Content",
12351
+ "text": "4294901760"
12352
+ }
12353
+ ],
12354
+ "fileUrlPath": "../ecs/dist/engine/entity.d.ts",
12355
+ "initializerTokenRange": {
12356
+ "startIndex": 1,
12357
+ "endIndex": 2
12358
+ },
12359
+ "isReadonly": true,
12360
+ "releaseTag": "Public",
12361
+ "name": "MASK_UPPER_16_ON_32",
12362
+ "variableTypeTokenRange": {
12363
+ "startIndex": 0,
12364
+ "endIndex": 0
12365
+ }
12366
+ },
12263
12367
  {
12264
12368
  "kind": "Variable",
12265
12369
  "canonicalReference": "@dcl/playground-assets!Material:var",
@@ -19692,6 +19796,60 @@
19692
19796
  }
19693
19797
  ]
19694
19798
  },
19799
+ {
19800
+ "kind": "Variable",
19801
+ "canonicalReference": "@dcl/playground-assets!MAX_ENTITY_NUMBER:var",
19802
+ "docComment": "/**\n * @public\n */\n",
19803
+ "excerptTokens": [
19804
+ {
19805
+ "kind": "Content",
19806
+ "text": "MAX_ENTITY_NUMBER = "
19807
+ },
19808
+ {
19809
+ "kind": "Content",
19810
+ "text": "65535"
19811
+ }
19812
+ ],
19813
+ "fileUrlPath": "../ecs/dist/engine/entity.d.ts",
19814
+ "initializerTokenRange": {
19815
+ "startIndex": 1,
19816
+ "endIndex": 2
19817
+ },
19818
+ "isReadonly": true,
19819
+ "releaseTag": "Public",
19820
+ "name": "MAX_ENTITY_NUMBER",
19821
+ "variableTypeTokenRange": {
19822
+ "startIndex": 0,
19823
+ "endIndex": 0
19824
+ }
19825
+ },
19826
+ {
19827
+ "kind": "Variable",
19828
+ "canonicalReference": "@dcl/playground-assets!MAX_U16:var",
19829
+ "docComment": "",
19830
+ "excerptTokens": [
19831
+ {
19832
+ "kind": "Content",
19833
+ "text": "MAX_U16 = "
19834
+ },
19835
+ {
19836
+ "kind": "Content",
19837
+ "text": "65535"
19838
+ }
19839
+ ],
19840
+ "fileUrlPath": "../ecs/dist/engine/entity.d.ts",
19841
+ "initializerTokenRange": {
19842
+ "startIndex": 1,
19843
+ "endIndex": 2
19844
+ },
19845
+ "isReadonly": true,
19846
+ "releaseTag": "Public",
19847
+ "name": "MAX_U16",
19848
+ "variableTypeTokenRange": {
19849
+ "startIndex": 0,
19850
+ "endIndex": 0
19851
+ }
19852
+ },
19695
19853
  {
19696
19854
  "kind": "Variable",
19697
19855
  "canonicalReference": "@dcl/playground-assets!MeshCollider:var",
@@ -34686,7 +34844,43 @@
34686
34844
  },
34687
34845
  {
34688
34846
  "kind": "Content",
34689
- "text": "{\n removeOnClick(entity: unknown): void;\n removeOnPointerDown(entity: unknown): void;\n removeOnPointerUp(entity: unknown): void;\n onClick(entity: unknown, cb: import(\"../../systems/events\")."
34847
+ "text": "{\n removeOnClick(entity: import(\"../../engine\")."
34848
+ },
34849
+ {
34850
+ "kind": "Reference",
34851
+ "text": "Entity",
34852
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
34853
+ },
34854
+ {
34855
+ "kind": "Content",
34856
+ "text": "): void;\n removeOnPointerDown(entity: import(\"../../engine\")."
34857
+ },
34858
+ {
34859
+ "kind": "Reference",
34860
+ "text": "Entity",
34861
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
34862
+ },
34863
+ {
34864
+ "kind": "Content",
34865
+ "text": "): void;\n removeOnPointerUp(entity: import(\"../../engine\")."
34866
+ },
34867
+ {
34868
+ "kind": "Reference",
34869
+ "text": "Entity",
34870
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
34871
+ },
34872
+ {
34873
+ "kind": "Content",
34874
+ "text": "): void;\n onClick(entity: import(\"../../engine\")."
34875
+ },
34876
+ {
34877
+ "kind": "Reference",
34878
+ "text": "Entity",
34879
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
34880
+ },
34881
+ {
34882
+ "kind": "Content",
34883
+ "text": ", cb: import(\"../../systems/events\")."
34690
34884
  },
34691
34885
  {
34692
34886
  "kind": "Reference",
@@ -34713,7 +34907,16 @@
34713
34907
  },
34714
34908
  {
34715
34909
  "kind": "Content",
34716
- "text": "> | undefined): void;\n onPointerDown(entity: unknown, cb: import(\"../../systems/events\")."
34910
+ "text": "> | undefined): void;\n onPointerDown(entity: import(\"../../engine\")."
34911
+ },
34912
+ {
34913
+ "kind": "Reference",
34914
+ "text": "Entity",
34915
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
34916
+ },
34917
+ {
34918
+ "kind": "Content",
34919
+ "text": ", cb: import(\"../../systems/events\")."
34717
34920
  },
34718
34921
  {
34719
34922
  "kind": "Reference",
@@ -34740,7 +34943,16 @@
34740
34943
  },
34741
34944
  {
34742
34945
  "kind": "Content",
34743
- "text": "> | undefined): void;\n onPointerUp(entity: unknown, cb: import(\"../../systems/events\")."
34946
+ "text": "> | undefined): void;\n onPointerUp(entity: import(\"../../engine\")."
34947
+ },
34948
+ {
34949
+ "kind": "Reference",
34950
+ "text": "Entity",
34951
+ "canonicalReference": "@dcl/playground-assets!Entity:type"
34952
+ },
34953
+ {
34954
+ "kind": "Content",
34955
+ "text": ", cb: import(\"../../systems/events\")."
34744
34956
  },
34745
34957
  {
34746
34958
  "kind": "Reference",
@@ -34776,7 +34988,7 @@
34776
34988
  "name": "pointerEventsSystem",
34777
34989
  "variableTypeTokenRange": {
34778
34990
  "startIndex": 1,
34779
- "endIndex": 20
34991
+ "endIndex": 32
34780
34992
  }
34781
34993
  },
34782
34994
  {
@@ -37789,6 +38001,33 @@
37789
38001
  "endIndex": 10
37790
38002
  }
37791
38003
  },
38004
+ {
38005
+ "kind": "Variable",
38006
+ "canonicalReference": "@dcl/playground-assets!RESERVED_STATIC_ENTITIES:var",
38007
+ "docComment": "/**\n * This first 512 entities are reserved by the renderer\n *\n * @public\n */\n",
38008
+ "excerptTokens": [
38009
+ {
38010
+ "kind": "Content",
38011
+ "text": "RESERVED_STATIC_ENTITIES = "
38012
+ },
38013
+ {
38014
+ "kind": "Content",
38015
+ "text": "512"
38016
+ }
38017
+ ],
38018
+ "fileUrlPath": "../ecs/dist/engine/entity.d.ts",
38019
+ "initializerTokenRange": {
38020
+ "startIndex": 1,
38021
+ "endIndex": 2
38022
+ },
38023
+ "isReadonly": true,
38024
+ "releaseTag": "Public",
38025
+ "name": "RESERVED_STATIC_ENTITIES",
38026
+ "variableTypeTokenRange": {
38027
+ "startIndex": 0,
38028
+ "endIndex": 0
38029
+ }
38030
+ },
37792
38031
  {
37793
38032
  "kind": "TypeAlias",
37794
38033
  "canonicalReference": "@dcl/playground-assets!RPCSendableMessage:type",
@@ -41849,6 +42088,32 @@
41849
42088
  "endIndex": 5
41850
42089
  }
41851
42090
  },
42091
+ {
42092
+ "kind": "TypeAlias",
42093
+ "canonicalReference": "@dcl/playground-assets!uint32:type",
42094
+ "docComment": "/**\n * It only defines the type explicitly, no effects.\n *\n * @public\n */\n",
42095
+ "excerptTokens": [
42096
+ {
42097
+ "kind": "Content",
42098
+ "text": "export declare type uint32 = "
42099
+ },
42100
+ {
42101
+ "kind": "Content",
42102
+ "text": "number"
42103
+ },
42104
+ {
42105
+ "kind": "Content",
42106
+ "text": ";"
42107
+ }
42108
+ ],
42109
+ "fileUrlPath": "../ecs/dist/engine/entity.d.ts",
42110
+ "releaseTag": "Public",
42111
+ "name": "uint32",
42112
+ "typeTokenRange": {
42113
+ "startIndex": 1,
42114
+ "endIndex": 2
42115
+ }
42116
+ },
41852
42117
  {
41853
42118
  "kind": "Variable",
41854
42119
  "canonicalReference": "@dcl/playground-assets!UiText:var",