Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

actions.ts 1023B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { CLOSE_HID_DEVICE, INIT_DEVICE, REQUEST_HID_DEVICE, UPDATE_DEVICE } from './actionTypes';
  2. import { IDeviceInfo } from './types';
  3. /**
  4. * Action used to init device.
  5. *
  6. * @param {IDeviceInfo} deviceInfo - Telephony device information.
  7. * @returns {Object}
  8. */
  9. export function initDeviceInfo(deviceInfo: IDeviceInfo) {
  10. return {
  11. type: INIT_DEVICE,
  12. deviceInfo
  13. };
  14. }
  15. /**
  16. * Request hid device.
  17. *
  18. * @returns {Object}
  19. */
  20. export function closeHidDevice() {
  21. return {
  22. type: CLOSE_HID_DEVICE
  23. };
  24. }
  25. /**
  26. * Request hid device.
  27. *
  28. * @param {IDeviceInfo} deviceInfo - Telephony device information.
  29. * @returns {Object}
  30. */
  31. export function requestHidDevice() {
  32. return {
  33. type: REQUEST_HID_DEVICE
  34. };
  35. }
  36. /**
  37. * Action used to init device.
  38. *
  39. * @param {IDeviceInfo} deviceInfo - Telephony device information.
  40. * @returns {Object}
  41. */
  42. export function updateDeviceInfo(deviceInfo: IDeviceInfo) {
  43. return {
  44. type: UPDATE_DEVICE,
  45. updates: deviceInfo
  46. };
  47. }