custom.d.ts 3.7 KB

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