You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.ts 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import {
  2. RESET_WHITEBOARD,
  3. SETUP_WHITEBOARD,
  4. SET_WHITEBOARD_OPEN
  5. } from './actionTypes';
  6. import { IWhiteboardAction } from './reducer';
  7. /**
  8. * Configures the whiteboard collaboration details.
  9. *
  10. * @param {Object} payload - The whiteboard settings.
  11. * @returns {{
  12. * type: SETUP_WHITEBOARD,
  13. * collabDetails: { roomId: string, roomKey: string }
  14. * }}
  15. */
  16. export const setupWhiteboard = ({ collabDetails }: {
  17. collabDetails: { roomId: string; roomKey: string; };
  18. }): IWhiteboardAction => {
  19. return {
  20. type: SETUP_WHITEBOARD,
  21. collabDetails
  22. };
  23. };
  24. /**
  25. * Cleans up the whiteboard collaboration settings.
  26. * To be used only on native for cleanup in between conferences.
  27. *
  28. * @returns {{
  29. * type: RESET_WHITEBOARD
  30. * }}
  31. */
  32. export const resetWhiteboard = (): IWhiteboardAction => {
  33. return { type: RESET_WHITEBOARD };
  34. };
  35. /**
  36. * Sets the whiteboard visibility status.
  37. *
  38. * @param {boolean} isOpen - The whiteboard visibility flag.
  39. * @returns {{
  40. * type: SET_WHITEBOARD_OPEN,
  41. * isOpen
  42. * }}
  43. */
  44. export const setWhiteboardOpen = (isOpen: boolean): IWhiteboardAction => {
  45. return {
  46. type: SET_WHITEBOARD_OPEN,
  47. isOpen
  48. };
  49. };