@dcl/sdk 7.0.0-3330926564.commit-6f7f3bb → 7.0.0-3349175623.commit-522e724
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 +66 -1
- package/dist/ecs7/index.js +266 -66
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/package.json +7 -7
- package/types/ecs7/index.d.ts +66 -1
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-3349175623.commit-522e724",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/src/index.js",
|
6
6
|
"typings": "dist/index.d.ts",
|
@@ -23,12 +23,12 @@
|
|
23
23
|
"artifacts"
|
24
24
|
],
|
25
25
|
"dependencies": {
|
26
|
-
"@dcl/amd": "6.11.
|
27
|
-
"@dcl/build-ecs": "6.11.
|
28
|
-
"@dcl/kernel": "1.0.0-
|
26
|
+
"@dcl/amd": "6.11.11-3349175623.commit-522e724",
|
27
|
+
"@dcl/build-ecs": "6.11.11-3349175623.commit-522e724",
|
28
|
+
"@dcl/kernel": "^1.0.0-3339209749.commit-fa9e5d7",
|
29
29
|
"@dcl/posix": "^1.0.4",
|
30
|
-
"@dcl/unity-renderer": "^1.0.
|
30
|
+
"@dcl/unity-renderer": "^1.0.59980-20221027151836.commit-cc26142"
|
31
31
|
},
|
32
|
-
"minCliVersion": "3.
|
33
|
-
"commit": "
|
32
|
+
"minCliVersion": "3.12.3",
|
33
|
+
"commit": "522e724ec65aef9e7986069e9e65acb51e1a21be"
|
34
34
|
}
|
package/types/ecs7/index.d.ts
CHANGED
@@ -1210,13 +1210,67 @@ declare type Entity = number & {
|
|
1210
1210
|
|
1211
1211
|
declare const entitySymbol: unique symbol;
|
1212
1212
|
|
1213
|
+
/**
|
1214
|
+
* Error function. Prints a console error. Only works in debug mode, otherwise it does nothing.
|
1215
|
+
* @param error - string or Error object.
|
1216
|
+
* @param data - any debug information.
|
1217
|
+
* @public
|
1218
|
+
*/
|
1213
1219
|
declare const error: (message: string | Error, data?: any) => void;
|
1214
1220
|
|
1221
|
+
declare namespace EventsSystem {
|
1222
|
+
export type Callback = (event: PBPointerEventsResult_PointerCommand) => void | Promise<void>;
|
1223
|
+
export type Options = {
|
1224
|
+
button?: InputAction;
|
1225
|
+
hoverText?: string;
|
1226
|
+
};
|
1227
|
+
/**
|
1228
|
+
* Remove the callback for onClick event
|
1229
|
+
* @param entity Entity where the callback was attached
|
1230
|
+
*/
|
1231
|
+
export function removeOnClick(entity: Entity): void;
|
1232
|
+
/**
|
1233
|
+
* Remove the callback for onPointerDown event
|
1234
|
+
* @param entity Entity where the callback was attached
|
1235
|
+
*/
|
1236
|
+
export function removeOnPointerDown(entity: Entity): void;
|
1237
|
+
/**
|
1238
|
+
* Remove the callback for onPointerUp event
|
1239
|
+
* @param entity Entity where the callback was attached
|
1240
|
+
*/
|
1241
|
+
export function removeOnPointerUp(entity: Entity): void;
|
1242
|
+
/**
|
1243
|
+
* Execute callback when the user clicks the entity.
|
1244
|
+
* @param entity Entity to attach the callback
|
1245
|
+
* @param cb Function to execute when onPointerDown fires
|
1246
|
+
* @param opts Opts to trigger Feedback and Button
|
1247
|
+
*/
|
1248
|
+
export function onClick(entity: Entity, cb: Callback, opts?: Options): void;
|
1249
|
+
/**
|
1250
|
+
* Execute callback when the user a the entity
|
1251
|
+
* @param entity Entity to attach the callback
|
1252
|
+
* @param cb Function to execute when click fires
|
1253
|
+
* @param opts Opts to trigger Feedback and Button
|
1254
|
+
*/
|
1255
|
+
export function onPointerDown(entity: Entity, cb: Callback, opts?: Options): void;
|
1256
|
+
/**
|
1257
|
+
* Execute callback when the user releases the InputButton pointing at the entity
|
1258
|
+
* @param entity Entity to attach the callback
|
1259
|
+
* @param cb Function to execute when click fires
|
1260
|
+
* @param opts Opts to trigger Feedback and Button
|
1261
|
+
*/
|
1262
|
+
export function onPointerUp(entity: Entity, cb: Callback, opts?: Options): void;
|
1263
|
+
}
|
1264
|
+
|
1215
1265
|
/** Excludes property keys from T where the property is assignable to U */
|
1216
1266
|
declare type ExcludeUndefined<T> = {
|
1217
1267
|
[P in keyof T]: undefined extends T[P] ? never : P;
|
1218
1268
|
}[keyof T];
|
1219
1269
|
|
1270
|
+
/**
|
1271
|
+
* @public
|
1272
|
+
* Execute async task
|
1273
|
+
*/
|
1220
1274
|
declare const executeTask: (task: Task<unknown>) => void;
|
1221
1275
|
|
1222
1276
|
/** @public */
|
@@ -1259,6 +1313,12 @@ declare type IEngine = {
|
|
1259
1313
|
* @param firstEntity - the root entity of the tree
|
1260
1314
|
*/
|
1261
1315
|
removeEntityWithChildren(firstEntity: Entity): void;
|
1316
|
+
/**
|
1317
|
+
* Check if an entity exists in the engine
|
1318
|
+
* @param entity - the entity to validate
|
1319
|
+
* @returns true if the entity exists in the engine
|
1320
|
+
*/
|
1321
|
+
entityExists(entity: Entity): boolean;
|
1262
1322
|
/**
|
1263
1323
|
* Add the system to the engine. It will be called every tick updated.
|
1264
1324
|
* @param system function that receives the delta time between last tick and current one.
|
@@ -1458,6 +1518,11 @@ declare type ISchema<T = any> = {
|
|
1458
1518
|
create(): T;
|
1459
1519
|
};
|
1460
1520
|
|
1521
|
+
/**
|
1522
|
+
* Log function. Only works in debug mode, otherwise it does nothing.
|
1523
|
+
* @param args - any loggable parameter
|
1524
|
+
* @public
|
1525
|
+
*/
|
1461
1526
|
declare const log: (...a: any[]) => void;
|
1462
1527
|
|
1463
1528
|
/**
|
@@ -3097,7 +3162,7 @@ declare const PointerLock: ComponentDefinition<ISchema<PBPointerLock>, PBPointer
|
|
3097
3162
|
declare type PreEngine = ReturnType<typeof preEngine>;
|
3098
3163
|
|
3099
3164
|
declare function preEngine(): {
|
3100
|
-
|
3165
|
+
entityExists: (entity: Entity) => boolean;
|
3101
3166
|
componentsDefinition: Map<number, ComponentDefinition<any, any>>;
|
3102
3167
|
addEntity: (dynamic?: boolean) => Entity;
|
3103
3168
|
addDynamicEntity: () => Entity;
|