@dcl/sdk 7.0.0-2798614483.commit-4feae69 → 7.0.0-2875155444.commit-bb5e498

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.
@@ -16,10 +16,11 @@ declare const enum ActionButton {
16
16
  UNRECOGNIZED = -1
17
17
  }
18
18
 
19
- /**
20
- * @public
21
- */
22
- declare function ArrayType<T>(type: EcsType<T>): EcsType<Array<T>>;
19
+ /** @public */
20
+ declare const Animator: ComponentDefinition<ISchema<PBAnimator>>;
21
+
22
+ /** @public */
23
+ declare const AudioSource: ComponentDefinition<ISchema<PBAudioSource>>;
23
24
 
24
25
  declare const enum AvatarAnchorPoint {
25
26
  POSITION = 0,
@@ -29,11 +30,29 @@ declare const enum AvatarAnchorPoint {
29
30
  UNRECOGNIZED = -1
30
31
  }
31
32
 
33
+ /** @public */
34
+ declare const AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>>;
35
+
36
+ /** @public */
37
+ declare const AvatarShape: ComponentDefinition<ISchema<PBAvatarShape>>;
38
+
39
+ /** @public */
40
+ declare const Billboard: ComponentDefinition<ISchema<PBBillboard>>;
41
+
42
+ /** @public */
43
+ declare const BoxShape: ComponentDefinition<ISchema<PBBoxShape>>;
44
+
32
45
  /**
33
46
  * @public
34
47
  */
35
48
  declare type ByteBuffer = ReturnType<typeof createByteBuffer>;
36
49
 
50
+ /** @public */
51
+ declare const CameraMode: ComponentDefinition<ISchema<PBCameraMode>>;
52
+
53
+ /** @public */
54
+ declare const CameraModeArea: ComponentDefinition<ISchema<PBCameraModeArea>>;
55
+
37
56
  declare const enum CameraModeValue {
38
57
  FIRST_PERSON = 0,
39
58
  THIRD_PERSON = 1,
@@ -49,7 +68,7 @@ declare interface Color3 {
49
68
  /**
50
69
  * @public
51
70
  */
52
- declare type ComponentDefinition<T extends EcsType = EcsType<any>> = {
71
+ declare type ComponentDefinition<T extends ISchema = ISchema<any>> = {
53
72
  _id: number;
54
73
  has(entity: Entity): boolean;
55
74
  getFrom(entity: Entity): DeepReadonly<ComponentType<T>>;
@@ -68,17 +87,80 @@ declare type ComponentDefinition<T extends EcsType = EcsType<any>> = {
68
87
  isDirty(entity: Entity): boolean;
69
88
  };
70
89
 
90
+ /** @public */
91
+ declare namespace Components {
92
+ /** @public */
93
+ const Transform: ComponentDefinition<ISchema< {
94
+ position: {
95
+ x: number;
96
+ y: number;
97
+ z: number;
98
+ };
99
+ rotation: {
100
+ x: number;
101
+ y: number;
102
+ z: number;
103
+ w: number;
104
+ };
105
+ scale: {
106
+ x: number;
107
+ y: number;
108
+ /** @public */
109
+ z: number;
110
+ };
111
+ parent?: Entity | undefined;
112
+ }>>;
113
+ /** @public */
114
+ const Animator: ComponentDefinition<ISchema<PBAnimator>>;
115
+ /** @public */
116
+ const AudioSource: ComponentDefinition<ISchema<PBAudioSource>>;
117
+ /** @public */
118
+ const AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>>;
119
+ /** @public */
120
+ const AvatarShape: ComponentDefinition<ISchema<PBAvatarShape>>;
121
+ /** @public */
122
+ const Billboard: ComponentDefinition<ISchema<PBBillboard>>;
123
+ /** @public */
124
+ const BoxShape: ComponentDefinition<ISchema<PBBoxShape>>;
125
+ /** @public */
126
+ const CameraMode: ComponentDefinition<ISchema<PBCameraMode>>;
127
+ /** @public */
128
+ const CameraModeArea: ComponentDefinition<ISchema<PBCameraModeArea>>;
129
+ /** @public */
130
+ const CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>>;
131
+ /** @public */
132
+ const GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>>;
133
+ /** @public */
134
+ const NFTShape: ComponentDefinition<ISchema<PBNFTShape>>;
135
+ /** @public */
136
+ const OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>>;
137
+ /** @public */
138
+ const OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>>;
139
+ /** @public */
140
+ const OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>>;
141
+ /** @public */
142
+ const OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>>;
143
+ /** @public */
144
+ const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>>;
145
+ /** @public */
146
+ const PointerLock: ComponentDefinition<ISchema<PBPointerLock>>;
147
+ /** @public */
148
+ const SphereShape: ComponentDefinition<ISchema<PBSphereShape>>;
149
+ /** @public */
150
+ const TextShape: ComponentDefinition<ISchema<PBTextShape>>;
151
+ }
152
+
71
153
  /**
72
154
  * @public
73
155
  */
74
- declare type ComponentEcsType<T extends [ComponentDefinition, ...ComponentDefinition[]]> = {
156
+ declare type ComponentSchema<T extends [ComponentDefinition, ...ComponentDefinition[]]> = {
75
157
  [K in keyof T]: T[K] extends ComponentDefinition ? ReturnType<T[K]['mutable']> : never;
76
158
  };
77
159
 
78
160
  /**
79
161
  * @public
80
162
  */
81
- declare type ComponentType<T extends EcsType> = EcsResult<T>;
163
+ declare type ComponentType<T extends ISchema> = EcsResult<T>;
82
164
 
83
165
  /**
84
166
  * ByteBuffer is a wrapper of DataView which also adds a read and write offset.
@@ -218,6 +300,9 @@ declare interface CreateByteBufferOptions {
218
300
  initialCapacity?: number;
219
301
  }
220
302
 
303
+ /** @public */
304
+ declare const CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>>;
305
+
221
306
  /**
222
307
  * Make each field readonly deeply
223
308
  * @public
@@ -226,27 +311,45 @@ declare type DeepReadonly<T> = {
226
311
  readonly [P in keyof T]: DeepReadonly<T[P]>;
227
312
  };
228
313
 
229
- declare function defineSdkComponents(engine: Pick<IEngine, 'defineComponent'>): {
230
- Animator: ComponentDefinition<EcsType<PBAnimator>>;
231
- AudioSource: ComponentDefinition<EcsType<PBAudioSource>>;
232
- AvatarAttach: ComponentDefinition<EcsType<PBAvatarAttach>>;
233
- AvatarShape: ComponentDefinition<EcsType<PBAvatarShape>>;
234
- Billboard: ComponentDefinition<EcsType<PBBillboard>>;
235
- BoxShape: ComponentDefinition<EcsType<PBBoxShape>>;
236
- CameraMode: ComponentDefinition<EcsType<PBCameraMode>>;
237
- CameraModeArea: ComponentDefinition<EcsType<PBCameraModeArea>>;
238
- CylinderShape: ComponentDefinition<EcsType<PBCylinderShape>>;
239
- GLTFShape: ComponentDefinition<EcsType<PBGLTFShape>>;
240
- NFTShape: ComponentDefinition<EcsType<PBNFTShape>>;
241
- OnPointerDown: ComponentDefinition<EcsType<PBOnPointerDown>>;
242
- OnPointerDownResult: ComponentDefinition<EcsType<PBOnPointerDownResult>>;
243
- OnPointerUp: ComponentDefinition<EcsType<PBOnPointerUp>>;
244
- OnPointerUpResult: ComponentDefinition<EcsType<PBOnPointerUpResult>>;
245
- PlaneShape: ComponentDefinition<EcsType<PBPlaneShape>>;
246
- PointerLock: ComponentDefinition<EcsType<PBPointerLock>>;
247
- SphereShape: ComponentDefinition<EcsType<PBSphereShape>>;
248
- TextShape: ComponentDefinition<EcsType<PBTextShape>>;
249
- Transform: ComponentDefinition<EcsType<Transform>>;
314
+ declare function defineLibraryComponents({ defineComponent }: Pick<IEngine, 'defineComponent'>): {
315
+ Transform: ComponentDefinition<ISchema< {
316
+ position: {
317
+ x: number;
318
+ y: number;
319
+ z: number;
320
+ };
321
+ rotation: {
322
+ x: number;
323
+ y: number;
324
+ z: number;
325
+ w: number;
326
+ };
327
+ scale: {
328
+ x: number;
329
+ y: number;
330
+ z: number;
331
+ };
332
+ parent?: Entity | undefined;
333
+ }>>;
334
+ Animator: ComponentDefinition<ISchema<PBAnimator>>;
335
+ AudioSource: ComponentDefinition<ISchema<PBAudioSource>>;
336
+ AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>>;
337
+ AvatarShape: ComponentDefinition<ISchema<PBAvatarShape>>;
338
+ Billboard: ComponentDefinition<ISchema<PBBillboard>>;
339
+ BoxShape: ComponentDefinition<ISchema<PBBoxShape>>;
340
+ CameraMode: ComponentDefinition<ISchema<PBCameraMode>>;
341
+ CameraModeArea: ComponentDefinition<ISchema<PBCameraModeArea>>;
342
+ CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>>;
343
+ GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>>;
344
+ NFTShape: ComponentDefinition<ISchema<PBNFTShape>>;
345
+ OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>>;
346
+ OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>>;
347
+ OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>>;
348
+ OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>>;
349
+ PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>>;
350
+ PointerLock: ComponentDefinition<ISchema<PBPointerLock>>;
351
+ SphereShape: ComponentDefinition<ISchema<PBSphereShape>>;
352
+ TextShape: ComponentDefinition<ISchema<PBTextShape>>;
250
353
  };
251
354
 
252
355
  /**
@@ -261,26 +364,7 @@ declare type double = number;
261
364
  /**
262
365
  * @public
263
366
  */
264
- declare const EcsBoolean: EcsType<boolean>;
265
-
266
- /**
267
- * @public
268
- */
269
- declare type EcsResult<T extends EcsType> = T extends EcsType ? ReturnType<T['deserialize']> : never;
270
-
271
- /**
272
- * @public
273
- */
274
- declare const EcsString: EcsType<string>;
275
-
276
- /**
277
- * @public
278
- */
279
- declare type EcsType<T = any> = {
280
- serialize(value: T, builder: ByteBuffer): void;
281
- deserialize(reader: ByteBuffer): T;
282
- create(): T;
283
- };
367
+ declare type EcsResult<T extends ISchema> = T extends ISchema ? ReturnType<T['deserialize']> : never;
284
368
 
285
369
  /**
286
370
  * @public
@@ -302,11 +386,6 @@ declare type Entity = number & {
302
386
 
303
387
  declare const entitySymbol: unique symbol;
304
388
 
305
- /**
306
- * @public
307
- */
308
- declare function Enum<T>(type: EcsType<any>): EcsType<T>;
309
-
310
389
  /**
311
390
  * Constant used to define the minimal number value in Babylon.js
312
391
  * @public
@@ -318,26 +397,19 @@ declare type ExcludeUndefined<T> = {
318
397
  [P in keyof T]: undefined extends T[P] ? never : P;
319
398
  }[keyof T];
320
399
 
321
- /**
322
- * @public
323
- */
324
- declare const FlatString: EcsType<string>;
325
-
326
400
  /** @public */
327
401
  declare type float = number;
328
402
 
329
- /**
330
- * @public
331
- */
332
- declare const Float32: EcsType<number>;
403
+ /** @public */
404
+ declare type FloatArray = number[];
405
+
406
+ /** @public */
407
+ declare const GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>>;
333
408
 
334
409
  /**
335
410
  * @public
336
411
  */
337
- declare const Float64: EcsType<number>;
338
-
339
- /** @public */
340
- declare type FloatArray = number[];
412
+ declare function IArray<T>(type: ISchema<T>): ISchema<Array<T>>;
341
413
 
342
414
  /**
343
415
  * @public
@@ -348,10 +420,10 @@ declare type IEngine = {
348
420
  removeEntity(entity: Entity): void;
349
421
  addSystem(system: Update, priority?: number, name?: string): void;
350
422
  removeSystem(selector: string | Update): boolean;
351
- defineComponent<T extends EcsType>(componentId: number, spec: T): ComponentDefinition<T>;
352
- mutableGroupOf<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...ComponentEcsType<T>]>;
353
- groupOf<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...DeepReadonly<ComponentEcsType<T>>]>;
354
- getComponent<T extends EcsType>(componentId: number): ComponentDefinition<T>;
423
+ defineComponent<T extends ISchema>(componentId: number, spec: T): ComponentDefinition<T>;
424
+ mutableGroupOf<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...ComponentSchema<T>]>;
425
+ groupOf<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...DeepReadonly<ComponentSchema<T>>]>;
426
+ getComponent<T extends ISchema>(componentId: number): ComponentDefinition<T>;
355
427
  update(dt: number): void;
356
428
  baseComponents: SdkComponents;
357
429
  };
@@ -363,30 +435,34 @@ declare type IEngineParams = {
363
435
  transports?: Transport[];
364
436
  };
365
437
 
366
- /** Include property keys from T where the property is assignable to U */
367
- declare type IncludeUndefined<T> = {
368
- [P in keyof T]: undefined extends T[P] ? P : never;
369
- }[keyof T];
370
-
371
438
  /**
372
439
  * @public
373
440
  */
374
- declare const Int16: EcsType<number>;
441
+ declare function IEnum<T>(type: ISchema<any>): ISchema<T>;
375
442
 
376
443
  /**
377
444
  * @public
378
445
  */
379
- declare const Int32: EcsType<number>;
446
+ declare function IMap<T extends Spec>(spec: T): ISchema<Result<T>>;
447
+
448
+ /** Include property keys from T where the property is assignable to U */
449
+ declare type IncludeUndefined<T> = {
450
+ [P in keyof T]: undefined extends T[P] ? P : never;
451
+ }[keyof T];
380
452
 
381
453
  /**
382
454
  * @public
383
455
  */
384
- declare const Int64: EcsType<number>;
456
+ declare function IOptional<T>(spec: ISchema<T>): ISchema<T | undefined>;
385
457
 
386
458
  /**
387
459
  * @public
388
460
  */
389
- declare const Int8: EcsType<number>;
461
+ declare type ISchema<T = any> = {
462
+ serialize(value: T, builder: ByteBuffer): void;
463
+ deserialize(reader: ByteBuffer): T;
464
+ create(): T;
465
+ };
390
466
 
391
467
  /**
392
468
  * Interface for the size containing width and height
@@ -403,11 +479,6 @@ declare interface ISize {
403
479
  height: number;
404
480
  }
405
481
 
406
- /**
407
- * @public
408
- */
409
- declare function MapType<T extends Spec>(spec: T): EcsType<Result<T>>;
410
-
411
482
  /**
412
483
  * Class used to store matrix data (4x4)
413
484
  * @public
@@ -1127,6 +1198,9 @@ declare namespace Matrix {
1127
1198
  function toggleProjectionMatrixHandInPlace(self: MutableMatrix): void;
1128
1199
  }
1129
1200
 
1201
+ /** @public */
1202
+ declare const NFTShape: ComponentDefinition<ISchema<PBNFTShape>>;
1203
+
1130
1204
  /** @public */
1131
1205
  declare type Nullable<T> = T | null;
1132
1206
 
@@ -1138,10 +1212,17 @@ declare type OnlyOptionalUndefinedTypes<T> = {
1138
1212
  [K in IncludeUndefined<T>]?: T[K];
1139
1213
  };
1140
1214
 
1141
- /**
1142
- * @public
1143
- */
1144
- declare function Optional<T>(spec: EcsType<T>): EcsType<T | undefined>;
1215
+ /** @public */
1216
+ declare const OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>>;
1217
+
1218
+ /** @public */
1219
+ declare const OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>>;
1220
+
1221
+ /** @public */
1222
+ declare const OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>>;
1223
+
1224
+ /** @public */
1225
+ declare const OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>>;
1145
1226
 
1146
1227
  /**
1147
1228
  * Defines potential orientation for back face culling
@@ -1159,11 +1240,14 @@ declare enum Orientation {
1159
1240
  declare interface PBAnimationState {
1160
1241
  name: string;
1161
1242
  clip: string;
1162
- playing: boolean;
1163
- weight: number;
1164
- speed: number;
1165
- loop: boolean;
1166
- shouldReset: boolean;
1243
+ playing?: boolean | undefined;
1244
+ /** default=1.0s */
1245
+ weight?: number | undefined;
1246
+ /** default=1.0 */
1247
+ speed?: number | undefined;
1248
+ /** default=true */
1249
+ loop?: boolean | undefined;
1250
+ shouldReset?: boolean | undefined;
1167
1251
  }
1168
1252
 
1169
1253
  declare interface PBAnimator {
@@ -1171,10 +1255,12 @@ declare interface PBAnimator {
1171
1255
  }
1172
1256
 
1173
1257
  declare interface PBAudioSource {
1174
- playing: boolean;
1175
- volume: number;
1176
- loop: boolean;
1177
- pitch: number;
1258
+ playing?: boolean | undefined;
1259
+ /** default=1.0f */
1260
+ volume?: number | undefined;
1261
+ loop?: boolean | undefined;
1262
+ /** default=1.0f */
1263
+ pitch?: number | undefined;
1178
1264
  audioClipUrl: string;
1179
1265
  }
1180
1266
 
@@ -1185,29 +1271,35 @@ declare interface PBAvatarAttach {
1185
1271
 
1186
1272
  declare interface PBAvatarShape {
1187
1273
  id: string;
1188
- name: string;
1189
- bodyShape: string;
1190
- skinColor: Color3 | undefined;
1191
- hairColor: Color3 | undefined;
1192
- eyeColor: Color3 | undefined;
1274
+ name?: string | undefined;
1275
+ bodyShape?: string | undefined;
1276
+ skinColor?: Color3 | undefined;
1277
+ hairColor?: Color3 | undefined;
1278
+ eyeColor?: Color3 | undefined;
1193
1279
  wearables: string[];
1194
- expressionTriggerId: string;
1195
- expressionTriggerTimestamp: number;
1196
- stickerTriggerId: string;
1197
- stickerTriggerTimestamp: number;
1198
- talking: boolean;
1280
+ expressionTriggerId?: string | undefined;
1281
+ expressionTriggerTimestamp?: number | undefined;
1282
+ stickerTriggerId?: string | undefined;
1283
+ stickerTriggerTimestamp?: number | undefined;
1284
+ talking?: boolean | undefined;
1199
1285
  }
1200
1286
 
1201
1287
  declare interface PBBillboard {
1202
- x: boolean;
1203
- y: boolean;
1204
- z: boolean;
1288
+ /** default=true */
1289
+ x?: boolean | undefined;
1290
+ /** default=true */
1291
+ y?: boolean | undefined;
1292
+ /** default=true */
1293
+ z?: boolean | undefined;
1205
1294
  }
1206
1295
 
1207
1296
  declare interface PBBoxShape {
1208
- withCollisions: boolean;
1209
- isPointerBlocker: boolean;
1210
- visible: boolean;
1297
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1298
+ withCollisions?: boolean | undefined;
1299
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1300
+ isPointerBlocker?: boolean | undefined;
1301
+ /** @deprecated use HiddenComponent instead https://github.com/decentraland/sdk/issues/353 */
1302
+ visible?: boolean | undefined;
1211
1303
  uvs: number[];
1212
1304
  }
1213
1305
 
@@ -1221,35 +1313,50 @@ declare interface PBCameraModeArea {
1221
1313
  }
1222
1314
 
1223
1315
  declare interface PBCylinderShape {
1224
- withCollisions: boolean;
1225
- isPointerBlocker: boolean;
1226
- visible: boolean;
1227
- radiusTop: number;
1228
- radiusBottom: number;
1316
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1317
+ withCollisions?: boolean | undefined;
1318
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1319
+ isPointerBlocker?: boolean | undefined;
1320
+ /** @deprecated use HiddenComponent instead https://github.com/decentraland/sdk/issues/353 */
1321
+ visible?: boolean | undefined;
1322
+ /** default=1.0 */
1323
+ radiusTop?: number | undefined;
1324
+ /** default=1.0 */
1325
+ radiusBottom?: number | undefined;
1229
1326
  }
1230
1327
 
1231
1328
  declare interface PBGLTFShape {
1232
- withCollisions: boolean;
1233
- isPointerBlocker: boolean;
1234
- visible: boolean;
1329
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1330
+ withCollisions?: boolean | undefined;
1331
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1332
+ isPointerBlocker?: boolean | undefined;
1333
+ /** @deprecated use HiddenComponent instead https://github.com/decentraland/sdk/issues/353 */
1334
+ visible?: boolean | undefined;
1235
1335
  src: string;
1236
1336
  }
1237
1337
 
1238
1338
  declare interface PBNFTShape {
1239
- withCollisions: boolean;
1240
- isPointerBlocker: boolean;
1241
- visible: boolean;
1339
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1340
+ withCollisions?: boolean | undefined;
1341
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1342
+ isPointerBlocker?: boolean | undefined;
1343
+ /** @deprecated use HiddenComponent instead https://github.com/decentraland/sdk/issues/353 */
1344
+ visible?: boolean | undefined;
1242
1345
  src: string;
1243
- assetId: string;
1244
- style: number;
1245
- color: Color3 | undefined;
1346
+ assetId?: string | undefined;
1347
+ style?: number | undefined;
1348
+ color?: Color3 | undefined;
1246
1349
  }
1247
1350
 
1248
1351
  declare interface PBOnPointerDown {
1249
- button: ActionButton;
1250
- hoverText: string;
1251
- distance: number;
1252
- showFeedback: boolean;
1352
+ /** default=ActionButton.ANY */
1353
+ button?: ActionButton | undefined;
1354
+ /** default='Interact' */
1355
+ hoverText?: string | undefined;
1356
+ /** default=10 */
1357
+ maxDistance?: number | undefined;
1358
+ /** default=true */
1359
+ showFeedback?: boolean | undefined;
1253
1360
  }
1254
1361
 
1255
1362
  declare interface PBOnPointerDownResult {
@@ -1264,10 +1371,14 @@ declare interface PBOnPointerDownResult {
1264
1371
  }
1265
1372
 
1266
1373
  declare interface PBOnPointerUp {
1267
- button: ActionButton;
1268
- hoverText: string;
1269
- distance: number;
1270
- showFeedback: boolean;
1374
+ /** default=ActionButton.ANY */
1375
+ button?: ActionButton | undefined;
1376
+ /** default='Interact' */
1377
+ hoverText?: string | undefined;
1378
+ /** default=10 */
1379
+ maxDistance?: number | undefined;
1380
+ /** default=true */
1381
+ showFeedback?: boolean | undefined;
1271
1382
  }
1272
1383
 
1273
1384
  declare interface PBOnPointerUpResult {
@@ -1282,9 +1393,12 @@ declare interface PBOnPointerUpResult {
1282
1393
  }
1283
1394
 
1284
1395
  declare interface PBPlaneShape {
1285
- withCollisions: boolean;
1286
- isPointerBlocker: boolean;
1287
- visible: boolean;
1396
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1397
+ withCollisions?: boolean | undefined;
1398
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1399
+ isPointerBlocker?: boolean | undefined;
1400
+ /** @deprecated use HiddenComponent instead https://github.com/decentraland/sdk/issues/353 */
1401
+ visible?: boolean | undefined;
1288
1402
  uvs: number[];
1289
1403
  }
1290
1404
 
@@ -1293,36 +1407,49 @@ declare interface PBPointerLock {
1293
1407
  }
1294
1408
 
1295
1409
  declare interface PBSphereShape {
1296
- withCollisions: boolean;
1297
- isPointerBlocker: boolean;
1298
- visible: boolean;
1410
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1411
+ withCollisions?: boolean | undefined;
1412
+ /** @deprecated use MeshCollider instead https://github.com/decentraland/sdk/issues/366 */
1413
+ isPointerBlocker?: boolean | undefined;
1414
+ /** @deprecated use HiddenComponent instead https://github.com/decentraland/sdk/issues/353 */
1415
+ visible?: boolean | undefined;
1299
1416
  }
1300
1417
 
1301
1418
  declare interface PBTextShape {
1302
1419
  text: string;
1303
- visible: boolean;
1304
- font: string;
1305
- opacity: number;
1306
- fontSize: number;
1307
- fontAutoSize: boolean;
1308
- hTextAlign: string;
1309
- vTextAlign: string;
1310
- width: number;
1311
- height: number;
1312
- paddingTop: number;
1313
- paddingRight: number;
1314
- paddingBottom: number;
1315
- paddingLeft: number;
1316
- lineSpacing: number;
1317
- lineCount: number;
1318
- textWrapping: boolean;
1319
- shadowBlur: number;
1320
- shadowOffsetX: number;
1321
- shadowOffsetY: number;
1322
- outlineWidth: number;
1323
- shadowColor: Color3 | undefined;
1324
- outlineColor: Color3 | undefined;
1325
- textColor: Color3 | undefined;
1420
+ /** @deprecated use HiddenComponent instead https://github.com/decentraland/sdk/issues/353 */
1421
+ visible?: boolean | undefined;
1422
+ font?: string | undefined;
1423
+ /** default=1.0f */
1424
+ opacity?: number | undefined;
1425
+ /** default=10 */
1426
+ fontSize?: number | undefined;
1427
+ fontAutoSize?: boolean | undefined;
1428
+ /** default='center' */
1429
+ hTextAlign?: string | undefined;
1430
+ /** default='center' */
1431
+ vTextAlign?: string | undefined;
1432
+ /** default=1 */
1433
+ width?: number | undefined;
1434
+ /** default=1 */
1435
+ height?: number | undefined;
1436
+ paddingTop?: number | undefined;
1437
+ paddingRight?: number | undefined;
1438
+ paddingBottom?: number | undefined;
1439
+ paddingLeft?: number | undefined;
1440
+ lineSpacing?: number | undefined;
1441
+ lineCount?: number | undefined;
1442
+ textWrapping?: boolean | undefined;
1443
+ shadowBlur?: number | undefined;
1444
+ shadowOffsetX?: number | undefined;
1445
+ shadowOffsetY?: number | undefined;
1446
+ outlineWidth?: number | undefined;
1447
+ /** default=(1.0,1.0,1.0) */
1448
+ shadowColor?: Color3 | undefined;
1449
+ /** default=(1.0,1.0,1.0) */
1450
+ outlineColor?: Color3 | undefined;
1451
+ /** default=(1.0,1.0,1.0) */
1452
+ textColor?: Color3 | undefined;
1326
1453
  }
1327
1454
 
1328
1455
  /**
@@ -1434,6 +1561,12 @@ declare namespace Plane {
1434
1561
  function signedDistanceTo(plane: ReadonlyPlane, point: Vector3.ReadonlyVector3): number;
1435
1562
  }
1436
1563
 
1564
+ /** @public */
1565
+ declare const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>>;
1566
+
1567
+ /** @public */
1568
+ declare const PointerLock: ComponentDefinition<ISchema<PBPointerLock>>;
1569
+
1437
1570
  /**
1438
1571
  * @public
1439
1572
  */
@@ -1618,13 +1751,33 @@ declare type ReceiveMessage = {
1618
1751
  * @public
1619
1752
  */
1620
1753
  declare type Result<T extends Spec> = ToOptional<{
1621
- [K in keyof T]: T[K] extends EcsType ? ReturnType<T[K]['deserialize']> : T[K] extends Spec ? Result<T[K]> : never;
1754
+ [K in keyof T]: T[K] extends ISchema ? ReturnType<T[K]['deserialize']> : T[K] extends Spec ? Result<T[K]> : never;
1622
1755
  }>;
1623
1756
 
1624
1757
  /**
1625
1758
  * @public
1626
1759
  */
1627
- declare type SdkComponents = ReturnType<typeof defineSdkComponents>;
1760
+ declare namespace Schemas {
1761
+ export type SchemaType = ISchema;
1762
+ const Boolean: ISchema<boolean>;
1763
+ const String: ISchema<string>;
1764
+ const Float: ISchema<number>;
1765
+ const Double: ISchema<number>;
1766
+ const Byte: ISchema<number>;
1767
+ const Short: ISchema<number>;
1768
+ const Int: ISchema<number>;
1769
+ const Int64: ISchema<number>;
1770
+ const Number: ISchema<number>;
1771
+ const Enum: typeof IEnum;
1772
+ const Array: typeof IArray;
1773
+ const Map: typeof IMap;
1774
+ const Optional: typeof IOptional;
1775
+ }
1776
+
1777
+ /**
1778
+ * @public
1779
+ */
1780
+ declare type SdkComponents = ReturnType<typeof defineLibraryComponents>;
1628
1781
 
1629
1782
  /**
1630
1783
  * Defines supported spaces
@@ -1643,9 +1796,15 @@ declare enum Space {
1643
1796
  * @public
1644
1797
  */
1645
1798
  declare interface Spec {
1646
- [key: string]: EcsType;
1799
+ [key: string]: ISchema;
1647
1800
  }
1648
1801
 
1802
+ /** @public */
1803
+ declare const SphereShape: ComponentDefinition<ISchema<PBSphereShape>>;
1804
+
1805
+ /** @public */
1806
+ declare const TextShape: ComponentDefinition<ISchema<PBTextShape>>;
1807
+
1649
1808
  /**
1650
1809
  * Constant used to convert a value to gamma space
1651
1810
  * @public
@@ -1660,17 +1819,26 @@ declare const ToLinearSpace = 2.2;
1660
1819
 
1661
1820
  declare type ToOptional<T> = OnlyOptionalUndefinedTypes<T> & OnlyNonUndefinedTypes<T>;
1662
1821
 
1663
- /**
1664
- * @public
1665
- */
1666
- declare type Transform = {
1667
- position: Vector3.MutableVector3;
1668
- rotation: Quaternion.MutableQuaternion;
1669
- scale: Vector3.MutableVector3;
1670
- parent?: Entity;
1822
+ /** @public */
1823
+ declare const Transform: ComponentDefinition<ISchema< {
1824
+ position: {
1825
+ x: number;
1826
+ y: number;
1827
+ z: number;
1671
1828
  };
1672
-
1673
- declare const Transform: EcsType<Transform>;
1829
+ rotation: {
1830
+ x: number;
1831
+ y: number;
1832
+ z: number;
1833
+ w: number;
1834
+ };
1835
+ scale: {
1836
+ x: number;
1837
+ y: number;
1838
+ z: number;
1839
+ };
1840
+ parent?: Entity | undefined;
1841
+ }>>;
1674
1842
 
1675
1843
  declare type Transport = {
1676
1844
  type: string;