custom.d.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. declare module '*.svg' {
  2. const content: string;
  3. export default content;
  4. }
  5. declare module 'pdfjs-dist';
  6. declare module 'pdfjs-dist/build/pdf.worker.entry';
  7. declare module 'query-string';
  8. declare module 'react-toast-notifications';
  9. declare module 'react-color';
  10. declare module 'react-color/lib/components/common';
  11. type SelectOptionType = {
  12. key: string | number;
  13. content: React.ReactNode;
  14. child: React.ReactNode;
  15. };
  16. type RenderingStateType = 'RENDERING' | 'LOADING' | 'FINISHED' | 'PAUSED';
  17. type LineType = 'Highlight' | 'Underline' | 'Squiggly' | 'StrikeOut';
  18. type ReducerFuncType = (
  19. state: Record<string, any>,
  20. action: { type: string; payload: any }
  21. ) => any;
  22. type ViewportType = {
  23. width: number;
  24. height: number;
  25. };
  26. type ProgressType = {
  27. loaded: number;
  28. total: number;
  29. };
  30. type ScrollStateType = {
  31. right: boolean;
  32. down: boolean;
  33. lastX: number;
  34. lastY: number;
  35. subscriber: any;
  36. };
  37. type PositionType = {
  38. top: number;
  39. bottom: number;
  40. left: number;
  41. right: number;
  42. };
  43. type HTMLCoordinateType = {
  44. top: number;
  45. left: number;
  46. width: number;
  47. height: number;
  48. };
  49. type PointType = {
  50. x: number;
  51. y: number;
  52. };
  53. type LinePositionType = {
  54. start: PointType;
  55. end: PointType;
  56. };
  57. type AnnotationPositionType =
  58. | string
  59. | PositionType
  60. | LinePositionType
  61. | PointType
  62. | (PositionType | PointType[])[];
  63. type AnnotationAttributeType = {
  64. page: number;
  65. bdcolor?: string | undefined;
  66. position?: AnnotationPositionType;
  67. transparency?: number | undefined;
  68. content?: string | undefined;
  69. style?: number | undefined;
  70. fcolor?: string | undefined;
  71. ftransparency?: number | undefined;
  72. bdwidth?: number | undefined;
  73. fontname?: string | undefined;
  74. fontsize?: number | undefined;
  75. textcolor?: string | undefined;
  76. is_arrow?: boolean | undefined;
  77. };
  78. type AnnotationType = {
  79. id?: string;
  80. obj_type: string;
  81. obj_attr: AnnotationAttributeType;
  82. };
  83. type UpdateData = {
  84. bdcolor?: string;
  85. transparency?: number;
  86. position?: AnnotationPositionType;
  87. content?: string;
  88. fontsize?: number;
  89. };
  90. type OnUpdateType = (data: UpdateData) => void;
  91. type DispatchType = {
  92. type: string;
  93. payload: string | number | boolean | Record<string, any> | any[];
  94. };
  95. type ActionType = (
  96. dispatch: (obj: DispatchType) => void
  97. ) => Record<string, any>;
  98. type AnnotationElementPropsType = AnnotationType & {
  99. isCovered: boolean;
  100. isCollapse: boolean;
  101. mousePosition: Record<string, any>;
  102. onUpdate: OnUpdateType;
  103. onDelete: () => void;
  104. scale: number;
  105. viewport: ViewportType;
  106. onEdit: () => void;
  107. isEdit: boolean;
  108. onBlur: () => void;
  109. };
  110. type OptionPropsType = {
  111. type?: string;
  112. color?: string;
  113. opacity?: number;
  114. fontName?: string;
  115. fontSize?: number;
  116. width?: number;
  117. align?: string;
  118. fontStyle?: string;
  119. shape?: string;
  120. text?: string;
  121. setDataState?: (arg: Record<string, any>) => void;
  122. };
  123. type CoordType = {
  124. left: number;
  125. top: number;
  126. width?: number;
  127. height?: number;
  128. };
  129. type CircleType = {
  130. direction: string;
  131. cx: number;
  132. cy: number;
  133. r: number;
  134. };
  135. type WatermarkType = {
  136. type?: 'image' | 'text';
  137. scale?: number;
  138. opacity?: number;
  139. rotation?: number;
  140. pages?: string;
  141. vertalign?: 'top' | 'center' | 'bottom';
  142. horizalign?: 'left' | 'center' | 'right';
  143. xoffset?: number;
  144. yoffset?: number;
  145. imagepath?: string;
  146. text?: string;
  147. textcolor?: string;
  148. isfront?: 'yes' | 'no';
  149. };