pdf.ts 1.0 KB

12345678910111213141516171819202122232425
  1. import * as types from '../constants/actionTypes';
  2. const actions: ActionType = (dispatch) => ({
  3. setTotalPage: (page) =>
  4. dispatch({ type: types.SET_TOTAL_PAGE, payload: page }),
  5. setCurrentPage: (page) =>
  6. dispatch({ type: types.SET_CURRENT_PAGE, payload: page }),
  7. setPdf: (pdf) => dispatch({ type: types.SET_PDF, payload: pdf }),
  8. setProgress: (progress) =>
  9. dispatch({ type: types.SET_PROGRESS, payload: progress }),
  10. setViewport: (viewport) =>
  11. dispatch({ type: types.SET_VIEWPORT, payload: viewport }),
  12. changeScale: (scale) =>
  13. dispatch({ type: types.CHANGE_SCALE, payload: scale }),
  14. changeRotate: (rotation) =>
  15. dispatch({ type: types.CHANGE_ROTATE, payload: rotation }),
  16. addAnnots: (annotations, init = true) =>
  17. dispatch({ type: types.ADD_ANNOTS, payload: { annotations, init } }),
  18. updateAnnots: (annotations) =>
  19. dispatch({ type: types.UPDATE_ANNOTS, payload: annotations }),
  20. updateWatermark: (watermark) =>
  21. dispatch({ type: types.UPDATE_WATERMARK, payload: watermark }),
  22. });
  23. export default actions;