@dcl/sdk 7.0.0-3290193397.commit-3ca136b → 7.0.0-3313983919.commit-4ba44d2

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.
@@ -1333,6 +1333,53 @@ export declare type IEngineParams = {
1333
1333
  */
1334
1334
  declare function IEnum<T>(type: ISchema<any>): ISchema<T>;
1335
1335
 
1336
+ /**
1337
+ * @public
1338
+ */
1339
+ export declare type IInput = {
1340
+ /**
1341
+ * Check if a click was emmited in the current tick for the input action.
1342
+ * This is defined when an UP event is triggered with a previously DOWN state.
1343
+ * @param inputAction - the input action to query
1344
+ * @param entity - the entity to query, ignore for global events.
1345
+ * @returns true if the entity was clicked in the last tick-update
1346
+ */
1347
+ wasJustClicked: (inputAction: InputAction, entity?: Entity) => boolean;
1348
+ /**
1349
+ * Check if a pointer event has been emited in the last tick-update.
1350
+ * @param inputAction - the input action to query
1351
+ * @param pointerEventType - the pointer event type to query
1352
+ * @param entity - the entity to query, ignore for global
1353
+ * @returns
1354
+ */
1355
+ wasInputJustActive: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => boolean;
1356
+ /**
1357
+ * Check if an input action is in DOWN state.
1358
+ * @param inputAction - the input action to query
1359
+ * @returns true if the input action is being pressed
1360
+ */
1361
+ isActionDown: (inputAction: InputAction) => boolean;
1362
+ /**
1363
+ * Get the click info if a click was emmited in the current tick for the input action.
1364
+ * This is defined when an UP event is triggered with a previously DOWN state.
1365
+ * @param inputAction - the input action to query
1366
+ * @param entity - the entity to query, ignore for global events.
1367
+ * @returns the click info or undefined if there is no command in the last tick-update
1368
+ */
1369
+ getClick: (inputAction: InputAction, entity?: Entity) => {
1370
+ up: PBPointerEventsResult_PointerCommand;
1371
+ down: PBPointerEventsResult_PointerCommand;
1372
+ } | null;
1373
+ /**
1374
+ * Get the input command info if a pointer event has been emited in the last tick-update.
1375
+ * @param inputAction - the input action to query
1376
+ * @param pointerEventType - the pointer event type to query
1377
+ * @param entity - the entity to query, ignore for global
1378
+ * @returns the input command info or undefined if there is no command in the last tick-update
1379
+ */
1380
+ getInputCommand: (inputAction: InputAction, pointerEventType: PointerEventType, entity?: Entity) => PBPointerEventsResult_PointerCommand | null;
1381
+ };
1382
+
1336
1383
  /**
1337
1384
  * @public
1338
1385
  */
@@ -1343,6 +1390,11 @@ declare type IncludeUndefined<T> = {
1343
1390
  [P in keyof T]: undefined extends T[P] ? P : never;
1344
1391
  }[keyof T];
1345
1392
 
1393
+ /**
1394
+ * @public
1395
+ */
1396
+ export declare const Input: IInput;
1397
+
1346
1398
  declare const enum InputAction {
1347
1399
  IA_POINTER = 0,
1348
1400
  IA_PRIMARY = 1,
@@ -1374,10 +1426,6 @@ export declare type ISchema<T = any> = {
1374
1426
  create(): T;
1375
1427
  };
1376
1428
 
1377
- export declare const isPointerEventActive: (entity: Entity, actionButton: InputAction, pointerEventType: PointerEventType) => boolean;
1378
-
1379
- export declare function isPointerEventActiveGenerator(engine: IEngine): (entity: Entity, actionButton: InputAction, pointerEventType: PointerEventType) => boolean;
1380
-
1381
1429
  export declare const log: (...a: any[]) => void;
1382
1430
 
1383
1431
  /**
@@ -4245,10 +4293,6 @@ declare interface Vector3_2 {
4245
4293
  /** @public */
4246
4294
  export declare const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
4247
4295
 
4248
- export declare const wasEntityClicked: (entity: Entity, actionButton: InputAction) => boolean;
4249
-
4250
- export declare function wasEntityClickedGenerator(engine: IEngine): (entity: Entity, actionButton: InputAction) => boolean;
4251
-
4252
4296
  declare namespace WireMessage {
4253
4297
  enum Enum {
4254
4298
  RESERVED = 0,