inputInterfaces.d.ts 927 B

123456789101112131415161718192021
  1. import type { IDisposable } from "../scene";
  2. import type { DeviceType } from "./InputDevices/deviceEnums";
  3. /**
  4. * Interface for DeviceInputSystem implementations (JS and Native)
  5. */
  6. export interface IDeviceInputSystem extends IDisposable {
  7. /**
  8. * Checks for current device input value, given an id and input index. Throws exception if requested device not initialized.
  9. * @param deviceType Enum specifying device type
  10. * @param deviceSlot "Slot" or index that device is referenced in
  11. * @param inputIndex Id of input to be checked
  12. * @returns Current value of input
  13. */
  14. pollInput(deviceType: DeviceType, deviceSlot: number, inputIndex: number): number;
  15. /**
  16. * Check for a specific device in the DeviceInputSystem
  17. * @param deviceType Type of device to check for
  18. * @returns bool with status of device's existence
  19. */
  20. isDeviceAvailable(deviceType: DeviceType): boolean;
  21. }