123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- declare module '*.svg' {
- const content: string;
- export default content;
- }
- declare module 'pdfjs-dist/es5/build/pdf.js';
- declare module 'query-string';
- declare module 'react-color';
- declare module 'react-color/lib/components/common';
- declare module 'react-toast-notifications';
- interface RefObject<T> {
- readonly current: T | null;
- }
- type SelectOptionType = {
- key: string | number;
- content: React.ReactNode;
- child: React.ReactNode;
- };
- type RenderingStateType = 'RENDERING' | 'LOADING' | 'FINISHED' | 'PAUSED';
- type LineType = 'Highlight' | 'Underline' | 'Squiggly' | 'StrikeOut';
- type FormType = 'textfield' | 'checkbox' | 'radio';
- type ToolType = 'highlight' | 'freehand' | 'text' | 'sticky' | 'shape';
- type SidebarType = 'markup-tools' | 'create-form' | 'watermark' | 'image';
- type ViewportType = {
- width: number;
- height: number;
- };
- type ProgressType = {
- loaded: number;
- total: number;
- };
- type ScrollStateType = {
- right: boolean;
- down: boolean;
- lastX: number;
- lastY: number;
- subscriber: Subscription;
- };
- type PositionType = {
- top: number;
- bottom: number;
- left: number;
- right: number;
- };
- type HTMLCoordinateType = {
- top: number;
- left: number;
- width: number;
- height: number;
- };
- type PointType = {
- x: number;
- y: number;
- };
- type LinePositionType = {
- start: PointType;
- end: PointType;
- };
- type AnnotationPositionType =
- | PositionType
- | LinePositionType
- | PointType
- | (PositionType | PointType[])[];
- type AnnotationAttributeType = {
- title?: string;
- date?: string;
- page: number;
- bdcolor?: string | undefined;
- position?: AnnotationPositionType;
- transparency?: number | undefined;
- content?: string | undefined;
- style?: string | undefined;
- fcolor?: string | undefined;
- ftransparency?: number | undefined;
- bdwidth?: number | undefined;
- fontname?: string | undefined;
- fontsize?: number | undefined;
- textcolor?: string | undefined;
- is_arrow?: boolean | undefined;
- src?: string | undefined;
- };
- type AnnotationType = {
- id?: string;
- obj_type: string;
- obj_attr: AnnotationAttributeType;
- };
- type UpdateData = {
- bdcolor?: string;
- transparency?: number;
- position?: AnnotationPositionType;
- content?: string;
- fontsize?: number;
- };
- type OnUpdateType = (data: UpdateData) => void;
- type AnnotationElementPropsType = AnnotationType & {
- isCovered: boolean;
- isCollapse: boolean;
- mousePosition: Record<string, unknown>;
- onUpdate: OnUpdateType;
- onDelete: () => void;
- scale: number;
- viewport: ViewportType;
- onEdit: () => void;
- isEdit: boolean;
- onBlur: () => void;
- onMouseOver?: () => void;
- onMouseOut?: () => void;
- };
- type OptionPropsType = {
- type?: string;
- color?: string;
- opacity?: number;
- fontName?: string;
- fontSize?: number;
- width?: number;
- align?: string;
- fontStyle?: string;
- shape?: string;
- text?: string;
- setDataState?: (arg: Record<string, unknown>) => void;
- };
- type CoordType = {
- left: number;
- top: number;
- width?: number;
- height?: number;
- };
- type CircleType = {
- direction: string;
- cx: number;
- cy: number;
- r: number;
- };
- type WatermarkType = {
- type?: 'image' | 'text';
- scale?: number;
- opacity?: number;
- rotation?: number;
- pages?: string;
- vertalign?: 'top' | 'center' | 'bottom';
- horizalign?: 'left' | 'center' | 'right';
- xoffset?: number;
- yoffset?: number;
- imagepath?: string;
- text?: string;
- textcolor?: string;
- isfront?: 'yes' | 'no';
- };
- type MatchType = {
- page: number;
- index: number;
- };
- type ColorType = {
- h?: string;
- s?: string;
- l?: string;
- v?: string;
- a?: string;
- hex?: string;
- };
- type PdfType = {
- getPage: (number) => Promise<PdfPageType>;
- numPages: number;
- } | null;
- type GetPageType = () => Promise<PdfPageType>;
- type TextItem = {
- items: unknown[];
- };
- type PdfPageType = {
- getTextContent: ({ normalizeWhitespace: boolean }) => Promise<TextItemp>;
- getViewport: (any) => ViewportType;
- cleanup: () => void;
- render: ({ canvasContext: any, viewport: any }) => RenderTaskType;
- } | null;
- type RenderTaskType = {
- cancel: () => void;
- promise: {
- catch: (arg0: (reason: sting) => void) => string;
- };
- };
- type ElementAttributeType = {
- title: Attr;
- date: Attr;
- page: Attr;
- color: Attr;
- width: Attr;
- opacity: Attr;
- 'interior-color': Attr;
- 'interior-opacity': Attr;
- tail: Attr;
- style: Attr;
- start: Attr;
- end: Attr;
- rect: Attr;
- coords: Attr;
- } & NamedNodeMap;
- type DispatchObjType = {
- type: string;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- payload: any;
- };
- type DispatchType = ({ type, payload }: DispatchObjType) => void;
- type ActionType = (
- dispatch: DispatchType,
- ) => Record<string, (arg0?: unknown, arg1?: unknown) => void>;
- type ReducerFuncType = (
- state: MainStateType & PdfStateType & SearchStateType,
- action: DispatchObjType,
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- ) => any;
- type MainStateType = {
- displayMode: 'full' | 'normal';
- navbarState: 'search' | 'annotations' | 'thumbnails' | '';
- sidebarState: SidebarType | '';
- toolState: ToolType | FormType | '';
- info: { token: string; id: string };
- initiated: boolean;
- isLoading: boolean;
- };
- type PdfStateType = {
- totalPage: number;
- currentPage: number;
- pdf: PdfType;
- progress: ProgressType;
- viewport: ViewportType;
- scale: number;
- rotation: number;
- annotations: AnnotationType[];
- watermark: WatermarkType;
- };
- type SearchStateType = {
- queryString: string;
- currentIndex: number;
- matchesMap: MatchType[];
- };
|