@dcl/sdk 7.0.0-2933918430.commit-d511778 → 7.0.0-2957285950.commit-2a77ef6
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.
- package/dist/ecs7/index.d.ts +138 -137
- package/dist/ecs7/index.js +1972 -536
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/dist/ecs7/proto-definitions/VisibilityComponent.proto +8 -0
- package/package.json +4 -4
- package/src/cli/mock-catalyst/index.js +4 -4
- package/src/cli/setupUtils.js +1 -1
- package/src/cli/wearables.js +10 -10
- package/src/setupProxy.js +1 -1
- package/types/ecs7/index.d.ts +137 -136
- package/types/tsconfig.ecs7.json +2 -2
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcl/sdk",
|
3
|
-
"version": "7.0.0-
|
3
|
+
"version": "7.0.0-2957285950.commit-2a77ef6",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/src/index.js",
|
6
6
|
"typings": "dist/index.d.ts",
|
@@ -27,8 +27,8 @@
|
|
27
27
|
"src/cli/**/*.js"
|
28
28
|
],
|
29
29
|
"dependencies": {
|
30
|
-
"@dcl/amd": "6.11.5-
|
31
|
-
"@dcl/build-ecs": "6.11.5-
|
30
|
+
"@dcl/amd": "6.11.5-2957285950.commit-2a77ef6",
|
31
|
+
"@dcl/build-ecs": "6.11.5-2957285950.commit-2a77ef6",
|
32
32
|
"@dcl/kernel": "1.0.0-2638443584.commit-696a74b",
|
33
33
|
"@dcl/posix": "^1.0.4",
|
34
34
|
"@dcl/schemas": "4.8.0",
|
@@ -38,5 +38,5 @@
|
|
38
38
|
"ignore": "^5.1.8"
|
39
39
|
},
|
40
40
|
"minCliVersion": "3.10.2",
|
41
|
-
"commit": "
|
41
|
+
"commit": "2a77ef6f1a5048b8d1b138ce6de416489221e9e2"
|
42
42
|
}
|
@@ -47,7 +47,7 @@ var mockCatalyst = function (app, baseFolders) {
|
|
47
47
|
res.json([
|
48
48
|
{
|
49
49
|
serverName: 'localhost',
|
50
|
-
url: "http://"
|
50
|
+
url: "http://".concat(req.get('host')),
|
51
51
|
layer: 'stub',
|
52
52
|
usersCount: 0,
|
53
53
|
maxUsers: 100,
|
@@ -58,7 +58,7 @@ var mockCatalyst = function (app, baseFolders) {
|
|
58
58
|
app.get('/lambdas/contracts/servers', function (req, res) {
|
59
59
|
res.json([
|
60
60
|
{
|
61
|
-
address: "http://"
|
61
|
+
address: "http://".concat(req.get('host')),
|
62
62
|
owner: '0x0000000000000000000000000000000000000000',
|
63
63
|
id: '0x0000000000000000000000000000000000000000000000000000000000000000'
|
64
64
|
}
|
@@ -70,7 +70,7 @@ var mockCatalyst = function (app, baseFolders) {
|
|
70
70
|
return __generator(this, function (_b) {
|
71
71
|
switch (_b.label) {
|
72
72
|
case 0:
|
73
|
-
baseUrl = req.protocol
|
73
|
+
baseUrl = "".concat(req.protocol, "://").concat(req.get('host'), "/content/contents");
|
74
74
|
_b.label = 1;
|
75
75
|
case 1:
|
76
76
|
_b.trys.push([1, 6, , 7]);
|
@@ -81,7 +81,7 @@ var mockCatalyst = function (app, baseFolders) {
|
|
81
81
|
case 2:
|
82
82
|
previewWearables = _b.sent();
|
83
83
|
if (!(previewWearables.length === 1)) return [3 /*break*/, 5];
|
84
|
-
return [4 /*yield*/, fetch("https://peer.decentraland.org"
|
84
|
+
return [4 /*yield*/, fetch("https://peer.decentraland.org".concat(req.originalUrl))];
|
85
85
|
case 3: return [4 /*yield*/, (_b.sent()).json()];
|
86
86
|
case 4:
|
87
87
|
deployedProfile = _b.sent();
|
package/src/cli/setupUtils.js
CHANGED
@@ -275,7 +275,7 @@ var downloadFile = function (url, path, timeout_seg) {
|
|
275
275
|
setTimeout(function () {
|
276
276
|
if (!finished) {
|
277
277
|
request.destroy();
|
278
|
-
reject(new Error("Timeout "
|
278
|
+
reject(new Error("Timeout ".concat(url)));
|
279
279
|
}
|
280
280
|
}, timeout_seg * 1000);
|
281
281
|
})];
|
package/src/cli/wearables.js
CHANGED
@@ -60,15 +60,15 @@ var serveWearable = function (_a) {
|
|
60
60
|
var wearableJson = JSON.parse(fs.readFileSync(wearableJsonPath).toString());
|
61
61
|
if (!(0, exports.wearableValidator)(wearableJson)) {
|
62
62
|
var errors = (exports.wearableValidator.errors || [])
|
63
|
-
.map(function (a) { return a.dataPath
|
63
|
+
.map(function (a) { return "".concat(a.dataPath, " ").concat(a.message); })
|
64
64
|
.join('');
|
65
65
|
if (errors.length > 0) {
|
66
|
-
console.error("Unable to validate '"
|
66
|
+
console.error("Unable to validate '".concat(wearableJsonPath, "' properly, please check it: ").concat(errors));
|
67
67
|
}
|
68
68
|
else {
|
69
|
-
console.error("Unable to validate '"
|
69
|
+
console.error("Unable to validate '".concat(wearableJsonPath, "' properly, please check it."));
|
70
70
|
}
|
71
|
-
throw new Error("Invalid wearable.json ("
|
71
|
+
throw new Error("Invalid wearable.json (".concat(wearableJson, ")"));
|
72
72
|
}
|
73
73
|
else {
|
74
74
|
}
|
@@ -85,10 +85,10 @@ var serveWearable = function (_a) {
|
|
85
85
|
var thumbnailFiltered = hashedFiles.filter(function ($) { return ($ === null || $ === void 0 ? void 0 : $.file) === wearableJson.thumbnail; });
|
86
86
|
var thumbnail = thumbnailFiltered.length > 0 &&
|
87
87
|
((_b = thumbnailFiltered[0]) === null || _b === void 0 ? void 0 : _b.hash) &&
|
88
|
-
baseUrl
|
88
|
+
"".concat(baseUrl, "/").concat(thumbnailFiltered[0].hash);
|
89
89
|
var wearableJsonWithContents = __assign(__assign({}, wearableJson), { baseUrl: baseUrl, thumbnail: thumbnail, data: __assign(__assign({}, wearableJson.data), { thumbnail: thumbnail, scene: hashedFiles, baseUrl: baseUrl, representations: wearableJson.data.representations.map(function (representation) { return (__assign(__assign({}, representation), { contents: hashedFiles.map(function (file) { return ({
|
90
|
-
key: ""
|
91
|
-
url: baseUrl
|
90
|
+
key: "".concat(file === null || file === void 0 ? void 0 : file.file),
|
91
|
+
url: "".concat(baseUrl, "/").concat(file === null || file === void 0 ? void 0 : file.hash)
|
92
92
|
}); }) })); }) }) });
|
93
93
|
return wearableJsonWithContents;
|
94
94
|
};
|
@@ -109,7 +109,7 @@ var getAllPreviewWearables = function (_a) {
|
|
109
109
|
ret.push(serveWearable({ wearableJsonPath: wearableJsonPath, baseUrl: baseUrl }));
|
110
110
|
}
|
111
111
|
catch (err) {
|
112
|
-
console.error("Couldn't mock the wearable "
|
112
|
+
console.error("Couldn't mock the wearable ".concat(wearableJsonPath, ". Please verify the correct format and scheme."), err);
|
113
113
|
}
|
114
114
|
}
|
115
115
|
return ret;
|
@@ -119,7 +119,7 @@ var mockPreviewWearables = function (app, baseFolders) {
|
|
119
119
|
app.use('/preview-wearables/:id', function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
120
120
|
var baseUrl, wearables, wearableId;
|
121
121
|
return __generator(this, function (_a) {
|
122
|
-
baseUrl = req.protocol
|
122
|
+
baseUrl = "".concat(req.protocol, "://").concat(req.get('host'), "/content/contents");
|
123
123
|
wearables = (0, exports.getAllPreviewWearables)({
|
124
124
|
baseUrl: baseUrl,
|
125
125
|
baseFolders: baseFolders
|
@@ -134,7 +134,7 @@ var mockPreviewWearables = function (app, baseFolders) {
|
|
134
134
|
app.use('/preview-wearables', function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
135
135
|
var baseUrl;
|
136
136
|
return __generator(this, function (_a) {
|
137
|
-
baseUrl = req.protocol
|
137
|
+
baseUrl = "".concat(req.protocol, "://").concat(req.get('host'), "/content/contents");
|
138
138
|
return [2 /*return*/, res.json({
|
139
139
|
ok: true,
|
140
140
|
data: (0, exports.getAllPreviewWearables)({ baseUrl: baseUrl, baseFolders: baseFolders })
|
package/src/setupProxy.js
CHANGED
@@ -151,7 +151,7 @@ var setupProxy = function (dcl, app) {
|
|
151
151
|
var featureFlagResponse, featureFlagBody;
|
152
152
|
return __generator(this, function (_a) {
|
153
153
|
switch (_a.label) {
|
154
|
-
case 0: return [4 /*yield*/, fetch("https://feature-flags.decentraland.zone/"
|
154
|
+
case 0: return [4 /*yield*/, fetch("https://feature-flags.decentraland.zone/".concat(req.params.file))];
|
155
155
|
case 1:
|
156
156
|
featureFlagResponse = _a.sent();
|
157
157
|
return [4 /*yield*/, featureFlagResponse.json()];
|
package/types/ecs7/index.d.ts
CHANGED
@@ -17,10 +17,10 @@ declare const enum ActionButton {
|
|
17
17
|
}
|
18
18
|
|
19
19
|
/** @public */
|
20
|
-
declare const Animator: ComponentDefinition<ISchema<PBAnimator
|
20
|
+
declare const Animator: ComponentDefinition<ISchema<PBAnimator>, PBAnimator>;
|
21
21
|
|
22
22
|
/** @public */
|
23
|
-
declare const AudioSource: ComponentDefinition<ISchema<PBAudioSource
|
23
|
+
declare const AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
|
24
24
|
|
25
25
|
declare const enum AvatarAnchorPoint {
|
26
26
|
POSITION = 0,
|
@@ -31,7 +31,7 @@ declare const enum AvatarAnchorPoint {
|
|
31
31
|
}
|
32
32
|
|
33
33
|
/** @public */
|
34
|
-
declare const AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach
|
34
|
+
declare const AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>, PBAvatarAttach>;
|
35
35
|
|
36
36
|
declare const enum AvatarModifier {
|
37
37
|
HIDE_AVATARS = 0,
|
@@ -40,16 +40,16 @@ declare const enum AvatarModifier {
|
|
40
40
|
}
|
41
41
|
|
42
42
|
/** @public */
|
43
|
-
declare const AvatarModifierArea: ComponentDefinition<ISchema<PBAvatarModifierArea
|
43
|
+
declare const AvatarModifierArea: ComponentDefinition<ISchema<PBAvatarModifierArea>, PBAvatarModifierArea>;
|
44
44
|
|
45
45
|
/** @public */
|
46
|
-
declare const AvatarShape: ComponentDefinition<ISchema<PBAvatarShape
|
46
|
+
declare const AvatarShape: ComponentDefinition<ISchema<PBAvatarShape>, PBAvatarShape>;
|
47
47
|
|
48
48
|
/** @public */
|
49
|
-
declare const Billboard: ComponentDefinition<ISchema<PBBillboard
|
49
|
+
declare const Billboard: ComponentDefinition<ISchema<PBBillboard>, PBBillboard>;
|
50
50
|
|
51
51
|
/** @public */
|
52
|
-
declare const BoxShape: ComponentDefinition<ISchema<PBBoxShape
|
52
|
+
declare const BoxShape: ComponentDefinition<ISchema<PBBoxShape>, PBBoxShape>;
|
53
53
|
|
54
54
|
/**
|
55
55
|
* @public
|
@@ -57,10 +57,10 @@ declare const BoxShape: ComponentDefinition<ISchema<PBBoxShape>>;
|
|
57
57
|
declare type ByteBuffer = ReturnType<typeof createByteBuffer>;
|
58
58
|
|
59
59
|
/** @public */
|
60
|
-
declare const CameraMode: ComponentDefinition<ISchema<PBCameraMode
|
60
|
+
declare const CameraMode: ComponentDefinition<ISchema<PBCameraMode>, PBCameraMode>;
|
61
61
|
|
62
62
|
/** @public */
|
63
|
-
declare const CameraModeArea: ComponentDefinition<ISchema<PBCameraModeArea
|
63
|
+
declare const CameraModeArea: ComponentDefinition<ISchema<PBCameraModeArea>, PBCameraModeArea>;
|
64
64
|
|
65
65
|
declare const enum CameraModeValue {
|
66
66
|
FIRST_PERSON = 0,
|
@@ -77,7 +77,7 @@ declare interface Color3 {
|
|
77
77
|
/**
|
78
78
|
* @public
|
79
79
|
*/
|
80
|
-
declare type ComponentDefinition<T extends ISchema = ISchema<any>> = {
|
80
|
+
declare type ComponentDefinition<T extends ISchema = ISchema<any>, ConstructorType = ComponentType<T>> = {
|
81
81
|
_id: number;
|
82
82
|
/**
|
83
83
|
* Return the default value of the current component
|
@@ -141,7 +141,7 @@ declare type ComponentDefinition<T extends ISchema = ISchema<any>> = {
|
|
141
141
|
* Transform.create(myEntity) // throw an error, the `Transform` component already exists in `myEntity`
|
142
142
|
* ````
|
143
143
|
*/
|
144
|
-
create(entity: Entity, val?:
|
144
|
+
create(entity: Entity, val?: ConstructorType): ComponentType<T>;
|
145
145
|
/**
|
146
146
|
* Add the current component to an entity or replace the content if the entity already has the component
|
147
147
|
* - Internal comment: This method adds the <entity,component> to the list to be reviewed next frame
|
@@ -203,72 +203,55 @@ declare type ComponentDefinition<T extends ISchema = ISchema<any>> = {
|
|
203
203
|
/** @public */
|
204
204
|
declare namespace Components {
|
205
205
|
/** @public */
|
206
|
-
const Transform: ComponentDefinition<ISchema<
|
207
|
-
position: {
|
208
|
-
x: number;
|
209
|
-
y: number;
|
210
|
-
z: number;
|
211
|
-
};
|
212
|
-
rotation: {
|
213
|
-
x: number;
|
214
|
-
y: number;
|
215
|
-
z: number;
|
216
|
-
w: number;
|
217
|
-
};
|
218
|
-
scale: {
|
219
|
-
x: number;
|
220
|
-
y: number;
|
206
|
+
const Transform: ComponentDefinition<ISchema<TransformType>, Partial<TransformType>>;
|
221
207
|
/** @public */
|
222
|
-
|
223
|
-
};
|
224
|
-
parent?: Entity | undefined;
|
225
|
-
}>>;
|
208
|
+
const Animator: ComponentDefinition<ISchema<PBAnimator>, PBAnimator>;
|
226
209
|
/** @public */
|
227
|
-
const
|
210
|
+
const AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
|
228
211
|
/** @public */
|
229
|
-
const
|
212
|
+
const AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>, PBAvatarAttach>;
|
230
213
|
/** @public */
|
231
|
-
const
|
214
|
+
const AvatarModifierArea: ComponentDefinition<ISchema<PBAvatarModifierArea>, PBAvatarModifierArea>;
|
232
215
|
/** @public */
|
233
|
-
const
|
216
|
+
const AvatarShape: ComponentDefinition<ISchema<PBAvatarShape>, PBAvatarShape>;
|
234
217
|
/** @public */
|
235
|
-
const
|
218
|
+
const Billboard: ComponentDefinition<ISchema<PBBillboard>, PBBillboard>;
|
236
219
|
/** @public */
|
237
|
-
const
|
220
|
+
const BoxShape: ComponentDefinition<ISchema<PBBoxShape>, PBBoxShape>;
|
238
221
|
/** @public */
|
239
|
-
const
|
222
|
+
const CameraMode: ComponentDefinition<ISchema<PBCameraMode>, PBCameraMode>;
|
240
223
|
/** @public */
|
241
|
-
const
|
224
|
+
const CameraModeArea: ComponentDefinition<ISchema<PBCameraModeArea>, PBCameraModeArea>;
|
242
225
|
/** @public */
|
243
|
-
const
|
226
|
+
const CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>, PBCylinderShape>;
|
244
227
|
/** @public */
|
245
|
-
const
|
228
|
+
const GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>, PBGLTFShape>;
|
246
229
|
/** @public */
|
247
|
-
const
|
230
|
+
const Material: ComponentDefinition<ISchema<PBMaterial>, PBMaterial>;
|
248
231
|
/** @public */
|
249
|
-
const
|
232
|
+
const MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
|
250
233
|
/** @public */
|
251
|
-
const
|
234
|
+
const NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTShape>;
|
252
235
|
/** @public */
|
253
|
-
const
|
236
|
+
const OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>, PBOnPointerDown>;
|
254
237
|
/** @public */
|
255
|
-
const
|
238
|
+
const OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>, PBOnPointerDownResult>;
|
256
239
|
/** @public */
|
257
|
-
const
|
240
|
+
const OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
|
258
241
|
/** @public */
|
259
|
-
const
|
242
|
+
const OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>, PBOnPointerUpResult>;
|
260
243
|
/** @public */
|
261
|
-
const
|
244
|
+
const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
|
262
245
|
/** @public */
|
263
|
-
const
|
246
|
+
const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
|
264
247
|
/** @public */
|
265
|
-
const
|
248
|
+
const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
|
266
249
|
/** @public */
|
267
|
-
const
|
250
|
+
const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
|
268
251
|
/** @public */
|
269
|
-
const
|
252
|
+
const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
|
270
253
|
/** @public */
|
271
|
-
const
|
254
|
+
const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
|
272
255
|
}
|
273
256
|
|
274
257
|
/**
|
@@ -422,7 +405,7 @@ declare interface CreateByteBufferOptions {
|
|
422
405
|
}
|
423
406
|
|
424
407
|
/** @public */
|
425
|
-
declare const CylinderShape: ComponentDefinition<ISchema<PBCylinderShape
|
408
|
+
declare const CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>, PBCylinderShape>;
|
426
409
|
|
427
410
|
/**
|
428
411
|
* Make each field readonly deeply
|
@@ -432,49 +415,32 @@ declare type DeepReadonly<T> = {
|
|
432
415
|
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
433
416
|
};
|
434
417
|
|
435
|
-
declare function
|
436
|
-
Transform: ComponentDefinition<ISchema<
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
BoxShape: ComponentDefinition<ISchema<PBBoxShape>>;
|
462
|
-
CameraMode: ComponentDefinition<ISchema<PBCameraMode>>;
|
463
|
-
CameraModeArea: ComponentDefinition<ISchema<PBCameraModeArea>>;
|
464
|
-
CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>>;
|
465
|
-
GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>>;
|
466
|
-
Material: ComponentDefinition<ISchema<PBMaterial>>;
|
467
|
-
MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>>;
|
468
|
-
NFTShape: ComponentDefinition<ISchema<PBNFTShape>>;
|
469
|
-
OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>>;
|
470
|
-
OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>>;
|
471
|
-
OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>>;
|
472
|
-
OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>>;
|
473
|
-
PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>>;
|
474
|
-
PointerLock: ComponentDefinition<ISchema<PBPointerLock>>;
|
475
|
-
SphereShape: ComponentDefinition<ISchema<PBSphereShape>>;
|
476
|
-
TextShape: ComponentDefinition<ISchema<PBTextShape>>;
|
477
|
-
UiText: ComponentDefinition<ISchema<PBUiText>>;
|
418
|
+
declare function defineSdkComponents(engine: PreEngine): {
|
419
|
+
Transform: ComponentDefinition<ISchema<TransformType>, Partial<TransformType>>;
|
420
|
+
MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
|
421
|
+
Animator: ComponentDefinition<ISchema<PBAnimator>, PBAnimator>;
|
422
|
+
AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
|
423
|
+
AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>, PBAvatarAttach>;
|
424
|
+
AvatarModifierArea: ComponentDefinition<ISchema<PBAvatarModifierArea>, PBAvatarModifierArea>;
|
425
|
+
AvatarShape: ComponentDefinition<ISchema<PBAvatarShape>, PBAvatarShape>;
|
426
|
+
Billboard: ComponentDefinition<ISchema<PBBillboard>, PBBillboard>;
|
427
|
+
BoxShape: ComponentDefinition<ISchema<PBBoxShape>, PBBoxShape>;
|
428
|
+
CameraMode: ComponentDefinition<ISchema<PBCameraMode>, PBCameraMode>;
|
429
|
+
CameraModeArea: ComponentDefinition<ISchema<PBCameraModeArea>, PBCameraModeArea>;
|
430
|
+
CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>, PBCylinderShape>;
|
431
|
+
GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>, PBGLTFShape>;
|
432
|
+
Material: ComponentDefinition<ISchema<PBMaterial>, PBMaterial>;
|
433
|
+
NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTShape>;
|
434
|
+
OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>, PBOnPointerDown>;
|
435
|
+
OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>, PBOnPointerDownResult>;
|
436
|
+
OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
|
437
|
+
OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>, PBOnPointerUpResult>;
|
438
|
+
PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
|
439
|
+
PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
|
440
|
+
SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
|
441
|
+
TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
|
442
|
+
UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
|
443
|
+
VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
|
478
444
|
};
|
479
445
|
|
480
446
|
/**
|
@@ -496,10 +462,6 @@ declare type EcsResult<T extends ISchema> = T extends ISchema ? ReturnType<T['de
|
|
496
462
|
*/
|
497
463
|
declare function Engine({ transports }?: IEngineParams): IEngine;
|
498
464
|
|
499
|
-
/**
|
500
|
-
* @alpha * This file initialization is an alpha one. This is based on the old-ecs
|
501
|
-
* init and it'll be changing.
|
502
|
-
*/
|
503
465
|
declare const engine: IEngine;
|
504
466
|
|
505
467
|
/**
|
@@ -538,7 +500,7 @@ declare type float = number;
|
|
538
500
|
declare type FloatArray = number[];
|
539
501
|
|
540
502
|
/** @public */
|
541
|
-
declare const GLTFShape: ComponentDefinition<ISchema<PBGLTFShape
|
503
|
+
declare const GLTFShape: ComponentDefinition<ISchema<PBGLTFShape>, PBGLTFShape>;
|
542
504
|
|
543
505
|
/**
|
544
506
|
* @public
|
@@ -592,6 +554,7 @@ declare type IEngine = {
|
|
592
554
|
* Define a component and add it to the engine.
|
593
555
|
* @param spec An object with schema fields
|
594
556
|
* @param componentId unique id to identify the component, if the component id already exist, it will fail.
|
557
|
+
* @param constructorDefault the initial value prefilled when a component is created without a value
|
595
558
|
* @return The component definition
|
596
559
|
*
|
597
560
|
* ```ts
|
@@ -603,7 +566,7 @@ declare type IEngine = {
|
|
603
566
|
*
|
604
567
|
* ```
|
605
568
|
*/
|
606
|
-
defineComponent<T extends Spec
|
569
|
+
defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: Spec, componentId: number, constructorDefault?: Partial<Result<T>>): ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
|
607
570
|
/**
|
608
571
|
* Define a component and add it to the engine.
|
609
572
|
* @param spec An object with schema fields
|
@@ -615,7 +578,7 @@ declare type IEngine = {
|
|
615
578
|
* const StateComponent = engine.defineComponent(Schemas.Bool, VisibleComponentId)
|
616
579
|
* ```
|
617
580
|
*/
|
618
|
-
defineComponentFromSchema<T extends ISchema
|
581
|
+
defineComponentFromSchema<T extends ISchema<Record<string, any>>, ConstructorType = ComponentType<T>>(spec: T, componentId: number, constructorDefault?: ConstructorType): ComponentDefinition<T, ConstructorType>;
|
619
582
|
/**
|
620
583
|
* Get the component definition from the component id.
|
621
584
|
* @param componentId
|
@@ -634,7 +597,7 @@ declare type IEngine = {
|
|
634
597
|
* Example:
|
635
598
|
* ```ts
|
636
599
|
* for (const [entity, boxShape, transform] of engine.getEntitiesWith(BoxShape, Transform)) {
|
637
|
-
*
|
600
|
+
* // the properties of boxShape and transform are read only
|
638
601
|
* }
|
639
602
|
* ```
|
640
603
|
*/
|
@@ -696,7 +659,7 @@ declare interface ISize {
|
|
696
659
|
declare const log: (...a: any[]) => void;
|
697
660
|
|
698
661
|
/** @public */
|
699
|
-
declare const Material: ComponentDefinition<ISchema<PBMaterial
|
662
|
+
declare const Material: ComponentDefinition<ISchema<PBMaterial>, PBMaterial>;
|
700
663
|
|
701
664
|
/**
|
702
665
|
* Class used to store matrix data (4x4)
|
@@ -1418,10 +1381,10 @@ declare namespace Matrix {
|
|
1418
1381
|
}
|
1419
1382
|
|
1420
1383
|
/** @public */
|
1421
|
-
declare const MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>>;
|
1384
|
+
declare const MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
|
1422
1385
|
|
1423
1386
|
/** @public */
|
1424
|
-
declare const NFTShape: ComponentDefinition<ISchema<PBNFTShape
|
1387
|
+
declare const NFTShape: ComponentDefinition<ISchema<PBNFTShape>, PBNFTShape>;
|
1425
1388
|
|
1426
1389
|
/** @public */
|
1427
1390
|
declare type Nullable<T> = T | null;
|
@@ -1435,16 +1398,16 @@ declare type OnlyOptionalUndefinedTypes<T> = {
|
|
1435
1398
|
};
|
1436
1399
|
|
1437
1400
|
/** @public */
|
1438
|
-
declare const OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown
|
1401
|
+
declare const OnPointerDown: ComponentDefinition<ISchema<PBOnPointerDown>, PBOnPointerDown>;
|
1439
1402
|
|
1440
1403
|
/** @public */
|
1441
|
-
declare const OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult
|
1404
|
+
declare const OnPointerDownResult: ComponentDefinition<ISchema<PBOnPointerDownResult>, PBOnPointerDownResult>;
|
1442
1405
|
|
1443
1406
|
/** @public */
|
1444
|
-
declare const OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp
|
1407
|
+
declare const OnPointerUp: ComponentDefinition<ISchema<PBOnPointerUp>, PBOnPointerUp>;
|
1445
1408
|
|
1446
1409
|
/** @public */
|
1447
|
-
declare const OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult
|
1410
|
+
declare const OnPointerUpResult: ComponentDefinition<ISchema<PBOnPointerUpResult>, PBOnPointerUpResult>;
|
1448
1411
|
|
1449
1412
|
/**
|
1450
1413
|
* Defines potential orientation for back face culling
|
@@ -1753,6 +1716,11 @@ declare interface PBUiText {
|
|
1753
1716
|
textColor: Color3 | undefined;
|
1754
1717
|
}
|
1755
1718
|
|
1719
|
+
declare interface PBVisibilityComponent {
|
1720
|
+
/** default=true */
|
1721
|
+
visible?: boolean | undefined;
|
1722
|
+
}
|
1723
|
+
|
1756
1724
|
/**
|
1757
1725
|
* Represens a plane by the equation ax + by + cz + d = 0
|
1758
1726
|
* @public
|
@@ -1863,10 +1831,35 @@ declare namespace Plane {
|
|
1863
1831
|
}
|
1864
1832
|
|
1865
1833
|
/** @public */
|
1866
|
-
declare const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape
|
1834
|
+
declare const PlaneShape: ComponentDefinition<ISchema<PBPlaneShape>, PBPlaneShape>;
|
1867
1835
|
|
1868
1836
|
/** @public */
|
1869
|
-
declare const PointerLock: ComponentDefinition<ISchema<PBPointerLock
|
1837
|
+
declare const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointerLock>;
|
1838
|
+
|
1839
|
+
/**
|
1840
|
+
* @public
|
1841
|
+
*/
|
1842
|
+
declare type PreEngine = ReturnType<typeof preEngine>;
|
1843
|
+
|
1844
|
+
declare function preEngine(): {
|
1845
|
+
entitiesComponent: Map<number, Set<number>>;
|
1846
|
+
componentsDefinition: Map<number, ComponentDefinition<any, any>>;
|
1847
|
+
addEntity: (dynamic?: boolean) => Entity;
|
1848
|
+
addDynamicEntity: () => Entity;
|
1849
|
+
removeEntity: (entity: Entity) => boolean;
|
1850
|
+
addSystem: (fn: Update, priority?: number, name?: string | undefined) => void;
|
1851
|
+
getSystems: () => {
|
1852
|
+
fn: Update;
|
1853
|
+
priority: number;
|
1854
|
+
name?: string | undefined;
|
1855
|
+
}[];
|
1856
|
+
removeSystem: (selector: string | Update) => boolean;
|
1857
|
+
defineComponent: <T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType | undefined) => ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
|
1858
|
+
defineComponentFromSchema: <T_1 extends ISchema<any>, ConstructorType_1 = EcsResult<T_1>>(spec: T_1, componentId: number, constructorDefault?: ConstructorType_1 | undefined) => ComponentDefinition<T_1, ConstructorType_1>;
|
1859
|
+
getEntitiesWith: <T_2 extends [ComponentDefinition<ISchema<any>, any>, ...ComponentDefinition<ISchema<any>, any>[]]>(...components: T_2) => Iterable<[Entity, ...DeepReadonly<ComponentSchema<T_2>>]>;
|
1860
|
+
getComponent: <T_3 extends ISchema<any>>(componentId: number) => ComponentDefinition<T_3, EcsResult<T_3>>;
|
1861
|
+
removeComponentDefinition: (componentId: number) => void;
|
1862
|
+
};
|
1870
1863
|
|
1871
1864
|
/**
|
1872
1865
|
* @public
|
@@ -2078,7 +2071,7 @@ declare namespace Schemas {
|
|
2078
2071
|
/**
|
2079
2072
|
* @public
|
2080
2073
|
*/
|
2081
|
-
declare type SdkComponents = ReturnType<typeof
|
2074
|
+
declare type SdkComponents = ReturnType<typeof defineSdkComponents>;
|
2082
2075
|
|
2083
2076
|
/**
|
2084
2077
|
* Defines supported spaces
|
@@ -2101,10 +2094,10 @@ declare interface Spec {
|
|
2101
2094
|
}
|
2102
2095
|
|
2103
2096
|
/** @public */
|
2104
|
-
declare const SphereShape: ComponentDefinition<ISchema<PBSphereShape
|
2097
|
+
declare const SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
|
2105
2098
|
|
2106
2099
|
/** @public */
|
2107
|
-
declare const TextShape: ComponentDefinition<ISchema<PBTextShape
|
2100
|
+
declare const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
|
2108
2101
|
|
2109
2102
|
declare const enum TextureWrapMode {
|
2110
2103
|
Repeat = 0,
|
@@ -2129,25 +2122,30 @@ declare const ToLinearSpace = 2.2;
|
|
2129
2122
|
declare type ToOptional<T> = OnlyOptionalUndefinedTypes<T> & OnlyNonUndefinedTypes<T>;
|
2130
2123
|
|
2131
2124
|
/** @public */
|
2132
|
-
declare const Transform: ComponentDefinition<ISchema<
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
x: number;
|
2140
|
-
y: number;
|
2141
|
-
z: number;
|
2142
|
-
|
2143
|
-
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2147
|
-
|
2125
|
+
declare const Transform: ComponentDefinition<ISchema<TransformType>, Partial<TransformType>>;
|
2126
|
+
|
2127
|
+
/**
|
2128
|
+
* @public
|
2129
|
+
*/
|
2130
|
+
declare type TransformType = {
|
2131
|
+
position: {
|
2132
|
+
x: number;
|
2133
|
+
y: number;
|
2134
|
+
z: number;
|
2135
|
+
};
|
2136
|
+
rotation: {
|
2137
|
+
x: number;
|
2138
|
+
y: number;
|
2139
|
+
z: number;
|
2140
|
+
w: number;
|
2141
|
+
};
|
2142
|
+
scale: {
|
2143
|
+
x: number;
|
2144
|
+
y: number;
|
2145
|
+
z: number;
|
2146
|
+
};
|
2147
|
+
parent?: Entity;
|
2148
2148
|
};
|
2149
|
-
parent?: Entity | undefined;
|
2150
|
-
}>>;
|
2151
2149
|
|
2152
2150
|
declare const enum TransparencyMode {
|
2153
2151
|
Opaque = 0,
|
@@ -2170,7 +2168,7 @@ declare type TransportMessage = Omit<ReceiveMessage, 'data'>;
|
|
2170
2168
|
declare type Uint32 = number;
|
2171
2169
|
|
2172
2170
|
/** @public */
|
2173
|
-
declare const UiText: ComponentDefinition<ISchema<PBUiText
|
2171
|
+
declare const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
|
2174
2172
|
|
2175
2173
|
/**
|
2176
2174
|
* @public
|
@@ -2391,6 +2389,9 @@ declare interface Vector3_2 {
|
|
2391
2389
|
z: number;
|
2392
2390
|
}
|
2393
2391
|
|
2392
|
+
/** @public */
|
2393
|
+
declare const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
|
2394
|
+
|
2394
2395
|
declare namespace WireMessage {
|
2395
2396
|
enum Enum {
|
2396
2397
|
RESERVED = 0,
|