Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

actions.ts 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'image-capture';
  2. import './createImageBitmap';
  3. import { AnyAction } from 'redux';
  4. import {
  5. ADD_FACE_LANDMARKS,
  6. CLEAR_FACE_LANDMARKS_BUFFER,
  7. NEW_FACE_COORDINATES
  8. } from './actionTypes';
  9. import { FaceBox, FaceLandmarks } from './types';
  10. /**
  11. * Adds new face landmarks to the timeline.
  12. *
  13. * @param {FaceLandmarks} faceLandmarks - The new face landmarks to timeline.
  14. * @param {boolean} addToBuffer - If true adds the face landmarks to a buffer in the reducer for webhook.
  15. * @returns {AnyAction}
  16. */
  17. export function addFaceLandmarks(faceLandmarks: FaceLandmarks, addToBuffer: boolean): AnyAction {
  18. return {
  19. type: ADD_FACE_LANDMARKS,
  20. faceLandmarks,
  21. addToBuffer
  22. };
  23. }
  24. /**
  25. * Clears the face landmarks array in the state.
  26. *
  27. * @returns {AnyAction}
  28. */
  29. export function clearFaceExpressionBuffer(): AnyAction {
  30. return {
  31. type: CLEAR_FACE_LANDMARKS_BUFFER
  32. };
  33. }
  34. /**
  35. * Signals that a new face box was obtained for the local participant.
  36. *
  37. * @param {FaceBox} faceBox - The face box of the local participant.
  38. * @returns {AnyAction}
  39. */
  40. export function newFaceBox(faceBox: FaceBox): AnyAction {
  41. return {
  42. type: NEW_FACE_COORDINATES,
  43. faceBox
  44. };
  45. }