pdf.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. export const setCurrentPage: ReducerFuncType = (state, { payload }) => ({
  2. ...state,
  3. currentPage: payload,
  4. });
  5. export const setTotalPage: ReducerFuncType = (state, { payload }) => ({
  6. ...state,
  7. totalPage: payload,
  8. });
  9. export const setPdf: ReducerFuncType = (state, { payload }) => ({
  10. ...state,
  11. pdf: payload,
  12. });
  13. export const setProgress: ReducerFuncType = (state, { payload }) => ({
  14. ...state,
  15. progress: payload,
  16. });
  17. export const setViewport: ReducerFuncType = (state, { payload }) => ({
  18. ...state,
  19. viewport: payload,
  20. });
  21. export const changeScale: ReducerFuncType = (state, { payload }) => ({
  22. ...state,
  23. scale: payload,
  24. });
  25. export const changeRotate: ReducerFuncType = (state, { payload }) => ({
  26. ...state,
  27. rotation: payload,
  28. });
  29. export const addAnnotation: ReducerFuncType = (state, { payload }) => ({
  30. ...state,
  31. annotations: [...state.annotations, ...payload.annotations],
  32. initiated: payload.init,
  33. });
  34. export const updateAnnotation: ReducerFuncType = (state, { payload }) => ({
  35. ...state,
  36. annotations: [...payload],
  37. initiated: true,
  38. });
  39. export const updateWatermark: ReducerFuncType = (state, { payload }) => ({
  40. ...state,
  41. watermark: {
  42. ...state.watermark,
  43. ...payload,
  44. },
  45. });
  46. export const setTextDivs: ReducerFuncType = (state, { payload }) => ({
  47. ...state,
  48. textDivs: payload,
  49. });