|
@@ -1,39 +1,33 @@
|
|
import * as types from '../constants/actionTypes';
|
|
import * as types from '../constants/actionTypes';
|
|
import {
|
|
import {
|
|
- ProgressType, ViewportType, AnnotationType, ActionType, WatermarkType,
|
|
|
|
|
|
+ ProgressType,
|
|
|
|
+ ViewportType,
|
|
|
|
+ AnnotationType,
|
|
|
|
+ ActionType,
|
|
|
|
+ WatermarkType,
|
|
} from '../constants/type';
|
|
} from '../constants/type';
|
|
|
|
|
|
const actions: ActionType = dispatch => ({
|
|
const actions: ActionType = dispatch => ({
|
|
- setTotalPage: (page: number): void => (
|
|
|
|
- dispatch({ type: types.SET_TOTAL_PAGE, payload: page })
|
|
|
|
- ),
|
|
|
|
- setCurrentPage: (page: number): void => (
|
|
|
|
- dispatch({ type: types.SET_CURRENT_PAGE, payload: page })
|
|
|
|
- ),
|
|
|
|
- setPdf: (pdf: Record<string, any>): void => (
|
|
|
|
- dispatch({ type: types.SET_PDF, payload: pdf })
|
|
|
|
- ),
|
|
|
|
- setProgress: (progress: ProgressType): void => (
|
|
|
|
- dispatch({ type: types.SET_PROGRESS, payload: progress })
|
|
|
|
- ),
|
|
|
|
- setViewport: (viewport: ViewportType): void => (
|
|
|
|
- dispatch({ type: types.SET_VIEWPORT, payload: viewport })
|
|
|
|
- ),
|
|
|
|
- changeScale: (scale: number | string): void => (
|
|
|
|
- dispatch({ type: types.CHANGE_SCALE, payload: scale })
|
|
|
|
- ),
|
|
|
|
- changeRotate: (rotation: number): void => (
|
|
|
|
- dispatch({ type: types.CHANGE_ROTATE, payload: rotation })
|
|
|
|
- ),
|
|
|
|
- addAnnots: (annotations: AnnotationType[], init: boolean): void => (
|
|
|
|
- dispatch({ type: types.ADD_ANNOTS, payload: { annotations, init } })
|
|
|
|
- ),
|
|
|
|
- updateAnnots: (annotations: AnnotationType[]): void => (
|
|
|
|
- dispatch({ type: types.UPDATE_ANNOTS, payload: annotations })
|
|
|
|
- ),
|
|
|
|
- updateWatermark: (watermark: WatermarkType): void => (
|
|
|
|
- dispatch({ type: types.UPDATE_WATERMARK, payload: watermark })
|
|
|
|
- ),
|
|
|
|
|
|
+ setTotalPage: (page: number): void =>
|
|
|
|
+ dispatch({ type: types.SET_TOTAL_PAGE, payload: page }),
|
|
|
|
+ setCurrentPage: (page: number): void =>
|
|
|
|
+ dispatch({ type: types.SET_CURRENT_PAGE, payload: page }),
|
|
|
|
+ setPdf: (pdf: Record<string, any>): void =>
|
|
|
|
+ dispatch({ type: types.SET_PDF, payload: pdf }),
|
|
|
|
+ setProgress: (progress: ProgressType): void =>
|
|
|
|
+ dispatch({ type: types.SET_PROGRESS, payload: progress }),
|
|
|
|
+ setViewport: (viewport: ViewportType): void =>
|
|
|
|
+ dispatch({ type: types.SET_VIEWPORT, payload: viewport }),
|
|
|
|
+ changeScale: (scale: number | string): void =>
|
|
|
|
+ dispatch({ type: types.CHANGE_SCALE, payload: scale }),
|
|
|
|
+ changeRotate: (rotation: number): void =>
|
|
|
|
+ dispatch({ type: types.CHANGE_ROTATE, payload: rotation }),
|
|
|
|
+ addAnnots: (annotations: AnnotationType[], init: boolean): void =>
|
|
|
|
+ dispatch({ type: types.ADD_ANNOTS, payload: { annotations, init } }),
|
|
|
|
+ updateAnnots: (annotations: AnnotationType[]): void =>
|
|
|
|
+ dispatch({ type: types.UPDATE_ANNOTS, payload: annotations }),
|
|
|
|
+ updateWatermark: (watermark: WatermarkType): void =>
|
|
|
|
+ dispatch({ type: types.UPDATE_WATERMARK, payload: watermark }),
|
|
});
|
|
});
|
|
|
|
|
|
export default actions;
|
|
export default actions;
|