@divriots/pdfjs-dist 3.10.111-divriots2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/CODE_OF_CONDUCT.md +15 -0
  2. package/LICENSE +177 -0
  3. package/README.md +14 -0
  4. package/build/pdf.js +18009 -0
  5. package/build/pdf.js.map +1 -0
  6. package/build/pdf.min.js +22 -0
  7. package/build/pdf.sandbox.js +280 -0
  8. package/build/pdf.sandbox.js.map +1 -0
  9. package/build/pdf.sandbox.min.js +22 -0
  10. package/build/pdf.worker.entry.js +19 -0
  11. package/build/pdf.worker.js +57863 -0
  12. package/build/pdf.worker.js.map +1 -0
  13. package/build/pdf.worker.min.js +22 -0
  14. package/cmaps/78-EUC-H.bcmap +0 -0
  15. package/cmaps/78-EUC-V.bcmap +0 -0
  16. package/cmaps/78-H.bcmap +0 -0
  17. package/cmaps/78-RKSJ-H.bcmap +0 -0
  18. package/cmaps/78-RKSJ-V.bcmap +0 -0
  19. package/cmaps/78-V.bcmap +0 -0
  20. package/cmaps/78ms-RKSJ-H.bcmap +0 -0
  21. package/cmaps/78ms-RKSJ-V.bcmap +0 -0
  22. package/cmaps/83pv-RKSJ-H.bcmap +0 -0
  23. package/cmaps/90ms-RKSJ-H.bcmap +0 -0
  24. package/cmaps/90ms-RKSJ-V.bcmap +0 -0
  25. package/cmaps/90msp-RKSJ-H.bcmap +0 -0
  26. package/cmaps/90msp-RKSJ-V.bcmap +0 -0
  27. package/cmaps/90pv-RKSJ-H.bcmap +0 -0
  28. package/cmaps/90pv-RKSJ-V.bcmap +0 -0
  29. package/cmaps/Add-H.bcmap +0 -0
  30. package/cmaps/Add-RKSJ-H.bcmap +0 -0
  31. package/cmaps/Add-RKSJ-V.bcmap +0 -0
  32. package/cmaps/Add-V.bcmap +0 -0
  33. package/cmaps/Adobe-CNS1-0.bcmap +0 -0
  34. package/cmaps/Adobe-CNS1-1.bcmap +0 -0
  35. package/cmaps/Adobe-CNS1-2.bcmap +0 -0
  36. package/cmaps/Adobe-CNS1-3.bcmap +0 -0
  37. package/cmaps/Adobe-CNS1-4.bcmap +0 -0
  38. package/cmaps/Adobe-CNS1-5.bcmap +0 -0
  39. package/cmaps/Adobe-CNS1-6.bcmap +0 -0
  40. package/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  41. package/cmaps/Adobe-GB1-0.bcmap +0 -0
  42. package/cmaps/Adobe-GB1-1.bcmap +0 -0
  43. package/cmaps/Adobe-GB1-2.bcmap +0 -0
  44. package/cmaps/Adobe-GB1-3.bcmap +0 -0
  45. package/cmaps/Adobe-GB1-4.bcmap +0 -0
  46. package/cmaps/Adobe-GB1-5.bcmap +0 -0
  47. package/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  48. package/cmaps/Adobe-Japan1-0.bcmap +0 -0
  49. package/cmaps/Adobe-Japan1-1.bcmap +0 -0
  50. package/cmaps/Adobe-Japan1-2.bcmap +0 -0
  51. package/cmaps/Adobe-Japan1-3.bcmap +0 -0
  52. package/cmaps/Adobe-Japan1-4.bcmap +0 -0
  53. package/cmaps/Adobe-Japan1-5.bcmap +0 -0
  54. package/cmaps/Adobe-Japan1-6.bcmap +0 -0
  55. package/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  56. package/cmaps/Adobe-Korea1-0.bcmap +0 -0
  57. package/cmaps/Adobe-Korea1-1.bcmap +0 -0
  58. package/cmaps/Adobe-Korea1-2.bcmap +0 -0
  59. package/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  60. package/cmaps/B5-H.bcmap +0 -0
  61. package/cmaps/B5-V.bcmap +0 -0
  62. package/cmaps/B5pc-H.bcmap +0 -0
  63. package/cmaps/B5pc-V.bcmap +0 -0
  64. package/cmaps/CNS-EUC-H.bcmap +0 -0
  65. package/cmaps/CNS-EUC-V.bcmap +0 -0
  66. package/cmaps/CNS1-H.bcmap +0 -0
  67. package/cmaps/CNS1-V.bcmap +0 -0
  68. package/cmaps/CNS2-H.bcmap +0 -0
  69. package/cmaps/CNS2-V.bcmap +3 -0
  70. package/cmaps/ETHK-B5-H.bcmap +0 -0
  71. package/cmaps/ETHK-B5-V.bcmap +0 -0
  72. package/cmaps/ETen-B5-H.bcmap +0 -0
  73. package/cmaps/ETen-B5-V.bcmap +0 -0
  74. package/cmaps/ETenms-B5-H.bcmap +3 -0
  75. package/cmaps/ETenms-B5-V.bcmap +0 -0
  76. package/cmaps/EUC-H.bcmap +0 -0
  77. package/cmaps/EUC-V.bcmap +0 -0
  78. package/cmaps/Ext-H.bcmap +0 -0
  79. package/cmaps/Ext-RKSJ-H.bcmap +0 -0
  80. package/cmaps/Ext-RKSJ-V.bcmap +0 -0
  81. package/cmaps/Ext-V.bcmap +0 -0
  82. package/cmaps/GB-EUC-H.bcmap +0 -0
  83. package/cmaps/GB-EUC-V.bcmap +0 -0
  84. package/cmaps/GB-H.bcmap +4 -0
  85. package/cmaps/GB-V.bcmap +0 -0
  86. package/cmaps/GBK-EUC-H.bcmap +0 -0
  87. package/cmaps/GBK-EUC-V.bcmap +0 -0
  88. package/cmaps/GBK2K-H.bcmap +0 -0
  89. package/cmaps/GBK2K-V.bcmap +0 -0
  90. package/cmaps/GBKp-EUC-H.bcmap +0 -0
  91. package/cmaps/GBKp-EUC-V.bcmap +0 -0
  92. package/cmaps/GBT-EUC-H.bcmap +0 -0
  93. package/cmaps/GBT-EUC-V.bcmap +0 -0
  94. package/cmaps/GBT-H.bcmap +0 -0
  95. package/cmaps/GBT-V.bcmap +0 -0
  96. package/cmaps/GBTpc-EUC-H.bcmap +0 -0
  97. package/cmaps/GBTpc-EUC-V.bcmap +0 -0
  98. package/cmaps/GBpc-EUC-H.bcmap +0 -0
  99. package/cmaps/GBpc-EUC-V.bcmap +0 -0
  100. package/cmaps/H.bcmap +0 -0
  101. package/cmaps/HKdla-B5-H.bcmap +0 -0
  102. package/cmaps/HKdla-B5-V.bcmap +0 -0
  103. package/cmaps/HKdlb-B5-H.bcmap +0 -0
  104. package/cmaps/HKdlb-B5-V.bcmap +0 -0
  105. package/cmaps/HKgccs-B5-H.bcmap +0 -0
  106. package/cmaps/HKgccs-B5-V.bcmap +0 -0
  107. package/cmaps/HKm314-B5-H.bcmap +0 -0
  108. package/cmaps/HKm314-B5-V.bcmap +0 -0
  109. package/cmaps/HKm471-B5-H.bcmap +0 -0
  110. package/cmaps/HKm471-B5-V.bcmap +0 -0
  111. package/cmaps/HKscs-B5-H.bcmap +0 -0
  112. package/cmaps/HKscs-B5-V.bcmap +0 -0
  113. package/cmaps/Hankaku.bcmap +0 -0
  114. package/cmaps/Hiragana.bcmap +0 -0
  115. package/cmaps/KSC-EUC-H.bcmap +0 -0
  116. package/cmaps/KSC-EUC-V.bcmap +0 -0
  117. package/cmaps/KSC-H.bcmap +0 -0
  118. package/cmaps/KSC-Johab-H.bcmap +0 -0
  119. package/cmaps/KSC-Johab-V.bcmap +0 -0
  120. package/cmaps/KSC-V.bcmap +0 -0
  121. package/cmaps/KSCms-UHC-H.bcmap +0 -0
  122. package/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  123. package/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  124. package/cmaps/KSCms-UHC-V.bcmap +0 -0
  125. package/cmaps/KSCpc-EUC-H.bcmap +0 -0
  126. package/cmaps/KSCpc-EUC-V.bcmap +0 -0
  127. package/cmaps/Katakana.bcmap +0 -0
  128. package/cmaps/LICENSE +36 -0
  129. package/cmaps/NWP-H.bcmap +0 -0
  130. package/cmaps/NWP-V.bcmap +0 -0
  131. package/cmaps/RKSJ-H.bcmap +0 -0
  132. package/cmaps/RKSJ-V.bcmap +0 -0
  133. package/cmaps/Roman.bcmap +0 -0
  134. package/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  135. package/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  136. package/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  137. package/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  138. package/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  139. package/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  140. package/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  141. package/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  142. package/cmaps/UniGB-UCS2-H.bcmap +0 -0
  143. package/cmaps/UniGB-UCS2-V.bcmap +0 -0
  144. package/cmaps/UniGB-UTF16-H.bcmap +0 -0
  145. package/cmaps/UniGB-UTF16-V.bcmap +0 -0
  146. package/cmaps/UniGB-UTF32-H.bcmap +0 -0
  147. package/cmaps/UniGB-UTF32-V.bcmap +0 -0
  148. package/cmaps/UniGB-UTF8-H.bcmap +0 -0
  149. package/cmaps/UniGB-UTF8-V.bcmap +0 -0
  150. package/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  151. package/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  152. package/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  153. package/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  154. package/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  155. package/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  156. package/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  157. package/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  158. package/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  159. package/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  160. package/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  161. package/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  162. package/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  163. package/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  164. package/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  165. package/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  166. package/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  167. package/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  168. package/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  169. package/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  170. package/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  171. package/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  172. package/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  173. package/cmaps/UniKS-UCS2-H.bcmap +0 -0
  174. package/cmaps/UniKS-UCS2-V.bcmap +0 -0
  175. package/cmaps/UniKS-UTF16-H.bcmap +0 -0
  176. package/cmaps/UniKS-UTF16-V.bcmap +0 -0
  177. package/cmaps/UniKS-UTF32-H.bcmap +0 -0
  178. package/cmaps/UniKS-UTF32-V.bcmap +0 -0
  179. package/cmaps/UniKS-UTF8-H.bcmap +0 -0
  180. package/cmaps/UniKS-UTF8-V.bcmap +0 -0
  181. package/cmaps/V.bcmap +0 -0
  182. package/cmaps/WP-Symbol.bcmap +0 -0
  183. package/image_decoders/pdf.image_decoders.js +7490 -0
  184. package/image_decoders/pdf.image_decoders.js.map +1 -0
  185. package/image_decoders/pdf.image_decoders.min.js +22 -0
  186. package/legacy/build/pdf.d.ts +1 -0
  187. package/legacy/build/pdf.js +22941 -0
  188. package/legacy/build/pdf.js.map +1 -0
  189. package/legacy/build/pdf.min.js +22 -0
  190. package/legacy/build/pdf.sandbox.js +3274 -0
  191. package/legacy/build/pdf.sandbox.js.map +1 -0
  192. package/legacy/build/pdf.sandbox.min.js +22 -0
  193. package/legacy/build/pdf.worker.entry.js +19 -0
  194. package/legacy/build/pdf.worker.js +62058 -0
  195. package/legacy/build/pdf.worker.js.map +1 -0
  196. package/legacy/build/pdf.worker.min.js +22 -0
  197. package/legacy/image_decoders/pdf.image_decoders.js +10615 -0
  198. package/legacy/image_decoders/pdf.image_decoders.js.map +1 -0
  199. package/legacy/image_decoders/pdf.image_decoders.min.js +22 -0
  200. package/legacy/web/images/annotation-check.svg +11 -0
  201. package/legacy/web/images/annotation-comment.svg +16 -0
  202. package/legacy/web/images/annotation-help.svg +26 -0
  203. package/legacy/web/images/annotation-insert.svg +10 -0
  204. package/legacy/web/images/annotation-key.svg +11 -0
  205. package/legacy/web/images/annotation-newparagraph.svg +11 -0
  206. package/legacy/web/images/annotation-noicon.svg +7 -0
  207. package/legacy/web/images/annotation-note.svg +42 -0
  208. package/legacy/web/images/annotation-paperclip.svg +6 -0
  209. package/legacy/web/images/annotation-paragraph.svg +16 -0
  210. package/legacy/web/images/annotation-pushpin.svg +7 -0
  211. package/legacy/web/images/loading-icon.gif +0 -0
  212. package/legacy/web/pdf_viewer.css +1375 -0
  213. package/legacy/web/pdf_viewer.d.ts +1 -0
  214. package/legacy/web/pdf_viewer.js +10502 -0
  215. package/legacy/web/pdf_viewer.js.map +1 -0
  216. package/package.json +35 -0
  217. package/standard_fonts/FoxitDingbats.pfb +0 -0
  218. package/standard_fonts/FoxitFixed.pfb +0 -0
  219. package/standard_fonts/FoxitFixedBold.pfb +0 -0
  220. package/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  221. package/standard_fonts/FoxitFixedItalic.pfb +0 -0
  222. package/standard_fonts/FoxitSerif.pfb +0 -0
  223. package/standard_fonts/FoxitSerifBold.pfb +0 -0
  224. package/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  225. package/standard_fonts/FoxitSerifItalic.pfb +0 -0
  226. package/standard_fonts/FoxitSymbol.pfb +0 -0
  227. package/standard_fonts/LICENSE_FOXIT +27 -0
  228. package/standard_fonts/LICENSE_LIBERATION +102 -0
  229. package/standard_fonts/LiberationSans-Bold.ttf +0 -0
  230. package/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  231. package/standard_fonts/LiberationSans-Italic.ttf +0 -0
  232. package/standard_fonts/LiberationSans-Regular.ttf +0 -0
  233. package/types/external/webL10n/l10n.d.ts +0 -0
  234. package/types/src/display/annotation_layer.d.ts +203 -0
  235. package/types/src/display/annotation_storage.d.ts +89 -0
  236. package/types/src/display/api.d.ts +1592 -0
  237. package/types/src/display/base_factory.d.ts +54 -0
  238. package/types/src/display/canvas.d.ts +208 -0
  239. package/types/src/display/display_utils.d.ts +277 -0
  240. package/types/src/display/editor/annotation_editor_layer.d.ts +196 -0
  241. package/types/src/display/editor/editor.d.ts +325 -0
  242. package/types/src/display/editor/freetext.d.ts +72 -0
  243. package/types/src/display/editor/ink.d.ts +95 -0
  244. package/types/src/display/editor/stamp.d.ts +28 -0
  245. package/types/src/display/editor/tools.d.ts +349 -0
  246. package/types/src/display/font_loader.d.ts +43 -0
  247. package/types/src/display/metadata.d.ts +11 -0
  248. package/types/src/display/optional_content_config.d.ts +13 -0
  249. package/types/src/display/pattern_helper.d.ts +73 -0
  250. package/types/src/display/text_layer.d.ts +151 -0
  251. package/types/src/display/transport_stream.d.ts +68 -0
  252. package/types/src/display/worker_options.d.ts +27 -0
  253. package/types/src/display/xfa_layer.d.ts +46 -0
  254. package/types/src/display/xfa_text.d.ts +19 -0
  255. package/types/src/pdf.d.ts +62 -0
  256. package/types/src/shared/image_utils.d.ts +17 -0
  257. package/types/src/shared/message_handler.d.ts +43 -0
  258. package/types/src/shared/murmurhash3.d.ts +7 -0
  259. package/types/src/shared/scripting_utils.d.ts +16 -0
  260. package/types/src/shared/util.d.ts +398 -0
  261. package/types/web/annotation_editor_layer_builder.d.ts +50 -0
  262. package/types/web/annotation_layer_builder.d.ts +83 -0
  263. package/types/web/app_options.d.ts +14 -0
  264. package/types/web/download_manager.d.ts +14 -0
  265. package/types/web/event_utils.d.ts +75 -0
  266. package/types/web/generic_scripting.d.ts +8 -0
  267. package/types/web/genericl10n.d.ts +13 -0
  268. package/types/web/interfaces.d.ts +163 -0
  269. package/types/web/l10n_utils.d.ts +7 -0
  270. package/types/web/pdf_find_controller.d.ts +108 -0
  271. package/types/web/pdf_find_utils.d.ts +16 -0
  272. package/types/web/pdf_history.d.ts +168 -0
  273. package/types/web/pdf_link_service.d.ts +243 -0
  274. package/types/web/pdf_page_view.d.ts +209 -0
  275. package/types/web/pdf_rendering_queue.d.ts +53 -0
  276. package/types/web/pdf_scripting_manager.component.d.ts +5 -0
  277. package/types/web/pdf_scripting_manager.d.ts +61 -0
  278. package/types/web/pdf_single_page_viewer.d.ts +7 -0
  279. package/types/web/pdf_thumbnail_view.d.ts +131 -0
  280. package/types/web/pdf_thumbnail_viewer.d.ts +104 -0
  281. package/types/web/pdf_viewer.component.d.ts +24 -0
  282. package/types/web/pdf_viewer.d.ts +455 -0
  283. package/types/web/struct_tree_layer_builder.d.ts +7 -0
  284. package/types/web/text_accessibility.d.ts +42 -0
  285. package/types/web/text_highlighter.d.ts +63 -0
  286. package/types/web/text_layer_builder.d.ts +64 -0
  287. package/types/web/ui_utils.d.ts +288 -0
  288. package/types/web/xfa_layer_builder.d.ts +41 -0
  289. package/web/images/annotation-check.svg +11 -0
  290. package/web/images/annotation-comment.svg +16 -0
  291. package/web/images/annotation-help.svg +26 -0
  292. package/web/images/annotation-insert.svg +10 -0
  293. package/web/images/annotation-key.svg +11 -0
  294. package/web/images/annotation-newparagraph.svg +11 -0
  295. package/web/images/annotation-noicon.svg +7 -0
  296. package/web/images/annotation-note.svg +42 -0
  297. package/web/images/annotation-paperclip.svg +6 -0
  298. package/web/images/annotation-paragraph.svg +16 -0
  299. package/web/images/annotation-pushpin.svg +7 -0
  300. package/web/images/loading-icon.gif +0 -0
  301. package/web/pdf_viewer.css +1375 -0
  302. package/web/pdf_viewer.d.ts +1 -0
  303. package/web/pdf_viewer.js +7752 -0
  304. package/web/pdf_viewer.js.map +1 -0
  305. package/webpack.js +26 -0
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Basic text editor in order to create a FreeTex annotation.
3
+ */
4
+ export class StampEditor extends AnnotationEditor {
5
+ static _type: string;
6
+ static get supportedTypes(): any;
7
+ static get supportedTypesStr(): any;
8
+ /** @inheritdoc */
9
+ static isHandlingMimeForPasting(mime: any): any;
10
+ /** @inheritdoc */
11
+ static paste(item: any, parent: any): void;
12
+ /** @inheritdoc */
13
+ static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
14
+ constructor(params: any);
15
+ /** @inheritdoc */
16
+ render(): HTMLDivElement | null;
17
+ /** @inheritdoc */
18
+ serialize(isForCopying?: boolean, context?: null): {
19
+ annotationType: number;
20
+ bitmapId: null;
21
+ pageIndex: number;
22
+ rect: any[];
23
+ rotation: number;
24
+ isSvg: boolean;
25
+ } | null;
26
+ #private;
27
+ }
28
+ import { AnnotationEditor } from "./editor.js";
@@ -0,0 +1,349 @@
1
+ export type AnnotationEditor = import("./editor.js").AnnotationEditor;
2
+ export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;
3
+ /**
4
+ * A pdf has several pages and each of them when it will rendered
5
+ * will have an AnnotationEditorLayer which will contain the some
6
+ * new Annotations associated to an editor in order to modify them.
7
+ *
8
+ * This class is used to manage all the different layers, editors and
9
+ * some action like copy/paste, undo/redo, ...
10
+ */
11
+ export class AnnotationEditorUIManager {
12
+ static TRANSLATE_SMALL: number;
13
+ static TRANSLATE_BIG: number;
14
+ static get _keyboardManager(): any;
15
+ constructor(container: any, viewer: any, eventBus: any, pdfDocument: any, pageColors: any);
16
+ viewParameters: {
17
+ realScale: number;
18
+ rotation: number;
19
+ };
20
+ destroy(): void;
21
+ get hcmFilter(): any;
22
+ onPageChanging({ pageNumber }: {
23
+ pageNumber: any;
24
+ }): void;
25
+ focusMainContainer(): void;
26
+ findParent(x: any, y: any): any;
27
+ disableUserSelect(value?: boolean): void;
28
+ addShouldRescale(editor: any): void;
29
+ removeShouldRescale(editor: any): void;
30
+ onScaleChanging({ scale }: {
31
+ scale: any;
32
+ }): void;
33
+ onRotationChanging({ pagesRotation }: {
34
+ pagesRotation: any;
35
+ }): void;
36
+ /**
37
+ * Add an editor in the annotation storage.
38
+ * @param {AnnotationEditor} editor
39
+ */
40
+ addToAnnotationStorage(editor: AnnotationEditor): void;
41
+ blur(): void;
42
+ focus(): void;
43
+ /**
44
+ * Copy callback.
45
+ * @param {ClipboardEvent} event
46
+ */
47
+ copy(event: ClipboardEvent): void;
48
+ /**
49
+ * Cut callback.
50
+ * @param {ClipboardEvent} event
51
+ */
52
+ cut(event: ClipboardEvent): void;
53
+ /**
54
+ * Paste callback.
55
+ * @param {ClipboardEvent} event
56
+ */
57
+ paste(event: ClipboardEvent): void;
58
+ /**
59
+ * Keydown callback.
60
+ * @param {KeyboardEvent} event
61
+ */
62
+ keydown(event: KeyboardEvent): void;
63
+ /**
64
+ * Execute an action for a given name.
65
+ * For example, the user can click on the "Undo" entry in the context menu
66
+ * and it'll trigger the undo action.
67
+ * @param {Object} details
68
+ */
69
+ onEditingAction(details: Object): void;
70
+ /**
71
+ * Set the editing state.
72
+ * It can be useful to temporarily disable it when the user is editing a
73
+ * FreeText annotation.
74
+ * @param {boolean} isEditing
75
+ */
76
+ setEditingState(isEditing: boolean): void;
77
+ registerEditorTypes(types: any): void;
78
+ /**
79
+ * Get an id.
80
+ * @returns {string}
81
+ */
82
+ getId(): string;
83
+ get currentLayer(): any;
84
+ getLayer(pageIndex: any): any;
85
+ get currentPageIndex(): number;
86
+ /**
87
+ * Add a new layer for a page which will contains the editors.
88
+ * @param {AnnotationEditorLayer} layer
89
+ */
90
+ addLayer(layer: AnnotationEditorLayer): void;
91
+ /**
92
+ * Remove a layer.
93
+ * @param {AnnotationEditorLayer} layer
94
+ */
95
+ removeLayer(layer: AnnotationEditorLayer): void;
96
+ /**
97
+ * Change the editor mode (None, FreeText, Ink, ...)
98
+ * @param {number} mode
99
+ * @param {string|null} editId
100
+ */
101
+ updateMode(mode: number, editId?: string | null): void;
102
+ /**
103
+ * Update the toolbar if it's required to reflect the tool currently used.
104
+ * @param {number} mode
105
+ * @returns {undefined}
106
+ */
107
+ updateToolbar(mode: number): undefined;
108
+ /**
109
+ * Update a parameter in the current editor or globally.
110
+ * @param {number} type
111
+ * @param {*} value
112
+ */
113
+ updateParams(type: number, value: any): void;
114
+ enableWaiting(mustWait?: boolean): void;
115
+ /**
116
+ * Get all the editors belonging to a given page.
117
+ * @param {number} pageIndex
118
+ * @returns {Array<AnnotationEditor>}
119
+ */
120
+ getEditors(pageIndex: number): Array<AnnotationEditor>;
121
+ /**
122
+ * Get an editor with the given id.
123
+ * @param {string} id
124
+ * @returns {AnnotationEditor}
125
+ */
126
+ getEditor(id: string): AnnotationEditor;
127
+ /**
128
+ * Add a new editor.
129
+ * @param {AnnotationEditor} editor
130
+ */
131
+ addEditor(editor: AnnotationEditor): void;
132
+ /**
133
+ * Remove an editor.
134
+ * @param {AnnotationEditor} editor
135
+ */
136
+ removeEditor(editor: AnnotationEditor): void;
137
+ /**
138
+ * The annotation element with the given id has been deleted.
139
+ * @param {AnnotationEditor} editor
140
+ */
141
+ addDeletedAnnotationElement(editor: AnnotationEditor): void;
142
+ /**
143
+ * Check if the annotation element with the given id has been deleted.
144
+ * @param {string} annotationElementId
145
+ * @returns {boolean}
146
+ */
147
+ isDeletedAnnotationElement(annotationElementId: string): boolean;
148
+ /**
149
+ * The annotation element with the given id have been restored.
150
+ * @param {AnnotationEditor} editor
151
+ */
152
+ removeDeletedAnnotationElement(editor: AnnotationEditor): void;
153
+ /**
154
+ * Set the given editor as the active one.
155
+ * @param {AnnotationEditor} editor
156
+ */
157
+ setActiveEditor(editor: AnnotationEditor): void;
158
+ /**
159
+ * Add or remove an editor the current selection.
160
+ * @param {AnnotationEditor} editor
161
+ */
162
+ toggleSelected(editor: AnnotationEditor): void;
163
+ /**
164
+ * Set the last selected editor.
165
+ * @param {AnnotationEditor} editor
166
+ */
167
+ setSelected(editor: AnnotationEditor): void;
168
+ /**
169
+ * Check if the editor is selected.
170
+ * @param {AnnotationEditor} editor
171
+ */
172
+ isSelected(editor: AnnotationEditor): boolean;
173
+ /**
174
+ * Unselect an editor.
175
+ * @param {AnnotationEditor} editor
176
+ */
177
+ unselect(editor: AnnotationEditor): void;
178
+ get hasSelection(): boolean;
179
+ /**
180
+ * Undo the last command.
181
+ */
182
+ undo(): void;
183
+ /**
184
+ * Redo the last undoed command.
185
+ */
186
+ redo(): void;
187
+ /**
188
+ * Add a command to execute (cmd) and another one to undo it.
189
+ * @param {Object} params
190
+ */
191
+ addCommands(params: Object): void;
192
+ /**
193
+ * Delete the current editor or all.
194
+ */
195
+ delete(): void;
196
+ commitOrRemove(): void;
197
+ hasSomethingToControl(): boolean;
198
+ /**
199
+ * Select all the editors.
200
+ */
201
+ selectAll(): void;
202
+ /**
203
+ * Unselect all the selected editors.
204
+ */
205
+ unselectAll(): void;
206
+ translateSelectedEditors(x: any, y: any, noCommit?: boolean): void;
207
+ /**
208
+ * Set up the drag session for moving the selected editors.
209
+ */
210
+ setUpDragSession(): void;
211
+ /**
212
+ * Ends the drag session.
213
+ * @returns {boolean} true if at least one editor has been moved.
214
+ */
215
+ endDragSession(): boolean;
216
+ /**
217
+ * Drag the set of selected editors.
218
+ * @param {number} tx
219
+ * @param {number} ty
220
+ */
221
+ dragSelectedEditors(tx: number, ty: number): void;
222
+ /**
223
+ * Rebuild the editor (usually on undo/redo actions) on a potentially
224
+ * non-rendered page.
225
+ * @param {AnnotationEditor} editor
226
+ */
227
+ rebuild(editor: AnnotationEditor): void;
228
+ /**
229
+ * Is the current editor the one passed as argument?
230
+ * @param {AnnotationEditor} editor
231
+ * @returns
232
+ */
233
+ isActive(editor: AnnotationEditor): boolean;
234
+ /**
235
+ * Get the current active editor.
236
+ * @returns {AnnotationEditor|null}
237
+ */
238
+ getActive(): AnnotationEditor | null;
239
+ /**
240
+ * Get the current editor mode.
241
+ * @returns {number}
242
+ */
243
+ getMode(): number;
244
+ get imageManager(): any;
245
+ #private;
246
+ }
247
+ export function bindEvents(obj: any, element: any, names: any): void;
248
+ export class ColorManager {
249
+ static _colorsMapping: Map<string, number[]>;
250
+ get _colors(): any;
251
+ /**
252
+ * In High Contrast Mode, the color on the screen is not always the
253
+ * real color used in the pdf.
254
+ * For example in some cases white can appear to be black but when saving
255
+ * we want to have white.
256
+ * @param {string} color
257
+ * @returns {Array<number>}
258
+ */
259
+ convert(color: string): Array<number>;
260
+ /**
261
+ * An input element must have its color value as a hex string
262
+ * and not as color name.
263
+ * So this function converts a name into an hex string.
264
+ * @param {string} name
265
+ * @returns {string}
266
+ */
267
+ getHexCode(name: string): string;
268
+ }
269
+ /**
270
+ * Class to handle undo/redo.
271
+ * Commands are just saved in a buffer.
272
+ * If we hit some memory issues we could likely use a circular buffer.
273
+ * It has to be used as a singleton.
274
+ */
275
+ export class CommandManager {
276
+ constructor(maxSize?: number);
277
+ /**
278
+ * @typedef {Object} addOptions
279
+ * @property {function} cmd
280
+ * @property {function} undo
281
+ * @property {boolean} mustExec
282
+ * @property {number} type
283
+ * @property {boolean} overwriteIfSameType
284
+ * @property {boolean} keepUndo
285
+ */
286
+ /**
287
+ * Add a new couple of commands to be used in case of redo/undo.
288
+ * @param {addOptions} options
289
+ */
290
+ add({ cmd, undo, mustExec, type, overwriteIfSameType, keepUndo, }: {
291
+ cmd: Function;
292
+ undo: Function;
293
+ mustExec: boolean;
294
+ type: number;
295
+ overwriteIfSameType: boolean;
296
+ keepUndo: boolean;
297
+ }): void;
298
+ /**
299
+ * Undo the last command.
300
+ */
301
+ undo(): void;
302
+ /**
303
+ * Redo the last command.
304
+ */
305
+ redo(): void;
306
+ /**
307
+ * Check if there is something to undo.
308
+ * @returns {boolean}
309
+ */
310
+ hasSomethingToUndo(): boolean;
311
+ /**
312
+ * Check if there is something to redo.
313
+ * @returns {boolean}
314
+ */
315
+ hasSomethingToRedo(): boolean;
316
+ destroy(): void;
317
+ #private;
318
+ }
319
+ /**
320
+ * Class to handle the different keyboards shortcuts we can have on mac or
321
+ * non-mac OSes.
322
+ */
323
+ export class KeyboardManager {
324
+ /**
325
+ * Create a new keyboard manager class.
326
+ * @param {Array<Array>} callbacks - an array containing an array of shortcuts
327
+ * and a callback to call.
328
+ * A shortcut is a string like `ctrl+c` or `mac+ctrl+c` for mac OS.
329
+ */
330
+ constructor(callbacks: Array<any[]>);
331
+ buffer: any[];
332
+ callbacks: Map<any, any>;
333
+ allKeys: Set<any>;
334
+ /**
335
+ * Execute a callback, if any, for a given keyboard event.
336
+ * The self is used as `this` in the callback.
337
+ * @param {Object} self.
338
+ * @param {KeyboardEvent} event
339
+ * @returns
340
+ */
341
+ exec(self: any, event: KeyboardEvent): void;
342
+ #private;
343
+ }
344
+ /**
345
+ * Convert a number between 0 and 100 into an hex number between 0 and 255.
346
+ * @param {number} opacity
347
+ * @return {string}
348
+ */
349
+ export function opacityToHex(opacity: number): string;
@@ -0,0 +1,43 @@
1
+ export class FontFaceObject {
2
+ constructor(translatedData: any, { isEvalSupported, disableFontFace, ignoreErrors, inspectFont, }: {
3
+ isEvalSupported?: boolean | undefined;
4
+ disableFontFace?: boolean | undefined;
5
+ ignoreErrors?: boolean | undefined;
6
+ inspectFont?: null | undefined;
7
+ });
8
+ compiledGlyphs: any;
9
+ isEvalSupported: boolean;
10
+ disableFontFace: boolean;
11
+ ignoreErrors: boolean;
12
+ _inspectFont: any;
13
+ createNativeFontFace(): FontFace | null;
14
+ createFontFaceRule(): string | null;
15
+ getPathGenerator(objs: any, character: any): any;
16
+ }
17
+ export class FontLoader {
18
+ constructor({ ownerDocument, styleElement, }: {
19
+ ownerDocument?: Document | undefined;
20
+ styleElement?: null | undefined;
21
+ });
22
+ _document: Document;
23
+ nativeFontFaces: Set<any>;
24
+ styleElement: HTMLStyleElement | null;
25
+ loadingRequests: any[] | undefined;
26
+ loadTestFontId: number | undefined;
27
+ addNativeFontFace(nativeFontFace: any): void;
28
+ removeNativeFontFace(nativeFontFace: any): void;
29
+ insertRule(rule: any): void;
30
+ clear(): void;
31
+ loadSystemFont(info: any): Promise<void>;
32
+ bind(font: any): Promise<void>;
33
+ get isFontLoadingAPISupported(): any;
34
+ get isSyncFontLoadingSupported(): any;
35
+ _queueLoadingCallback(callback: any): {
36
+ done: boolean;
37
+ complete: () => void;
38
+ callback: any;
39
+ };
40
+ get _loadTestFont(): any;
41
+ _prepareFontLoadEvent(font: any, request: any): void;
42
+ #private;
43
+ }
@@ -0,0 +1,11 @@
1
+ export class Metadata {
2
+ constructor({ parsedData, rawData }: {
3
+ parsedData: any;
4
+ rawData: any;
5
+ });
6
+ getRaw(): any;
7
+ get(name: any): any;
8
+ getAll(): any;
9
+ has(name: any): any;
10
+ #private;
11
+ }
@@ -0,0 +1,13 @@
1
+ export class OptionalContentConfig {
2
+ constructor(data: any);
3
+ name: any;
4
+ creator: any;
5
+ isVisible(group: any): any;
6
+ setVisibility(id: any, visible?: boolean): void;
7
+ get hasInitialVisibility(): boolean;
8
+ getOrder(): any;
9
+ getGroups(): any;
10
+ getGroup(id: any): any;
11
+ getHash(): string;
12
+ #private;
13
+ }
@@ -0,0 +1,73 @@
1
+ export function getShadingPattern(IR: any): RadialAxialShadingPattern | MeshShadingPattern | DummyShadingPattern;
2
+ export namespace PathType {
3
+ let FILL: string;
4
+ let STROKE: string;
5
+ let SHADING: string;
6
+ }
7
+ export class TilingPattern {
8
+ static MAX_PATTERN_SIZE: number;
9
+ constructor(IR: any, color: any, ctx: any, canvasGraphicsFactory: any, baseTransform: any);
10
+ operatorList: any;
11
+ matrix: any;
12
+ bbox: any;
13
+ xstep: any;
14
+ ystep: any;
15
+ paintType: any;
16
+ tilingType: any;
17
+ color: any;
18
+ ctx: any;
19
+ canvasGraphicsFactory: any;
20
+ baseTransform: any;
21
+ createPatternCanvas(owner: any): {
22
+ canvas: any;
23
+ scaleX: any;
24
+ scaleY: any;
25
+ offsetX: any;
26
+ offsetY: any;
27
+ };
28
+ getSizeAndScale(step: any, realOutputSize: any, scale: any): {
29
+ scale: any;
30
+ size: number;
31
+ };
32
+ clipBbox(graphics: any, x0: any, y0: any, x1: any, y1: any): void;
33
+ setFillAndStrokeStyleToContext(graphics: any, paintType: any, color: any): void;
34
+ getPattern(ctx: any, owner: any, inverse: any, pathType: any): any;
35
+ }
36
+ declare class RadialAxialShadingPattern extends BaseShadingPattern {
37
+ constructor(IR: any);
38
+ _type: any;
39
+ _bbox: any;
40
+ _colorStops: any;
41
+ _p0: any;
42
+ _p1: any;
43
+ _r0: any;
44
+ _r1: any;
45
+ matrix: any;
46
+ _createGradient(ctx: any): any;
47
+ getPattern(ctx: any, owner: any, inverse: any, pathType: any): any;
48
+ }
49
+ declare class MeshShadingPattern extends BaseShadingPattern {
50
+ constructor(IR: any);
51
+ _coords: any;
52
+ _colors: any;
53
+ _figures: any;
54
+ _bounds: any;
55
+ _bbox: any;
56
+ _background: any;
57
+ matrix: any;
58
+ _createMeshCanvas(combinedScale: any, backgroundColor: any, cachedCanvases: any): {
59
+ canvas: any;
60
+ offsetX: number;
61
+ offsetY: number;
62
+ scaleX: number;
63
+ scaleY: number;
64
+ };
65
+ getPattern(ctx: any, owner: any, inverse: any, pathType: any): any;
66
+ }
67
+ declare class DummyShadingPattern extends BaseShadingPattern {
68
+ getPattern(): string;
69
+ }
70
+ declare class BaseShadingPattern {
71
+ getPattern(): void;
72
+ }
73
+ export {};
@@ -0,0 +1,151 @@
1
+ export type PageViewport = import("./display_utils").PageViewport;
2
+ export type TextContent = import("./api").TextContent;
3
+ /**
4
+ * Text layer render parameters.
5
+ */
6
+ export type TextLayerRenderParameters = {
7
+ /**
8
+ * - Text content to
9
+ * render, i.e. the value returned by the page's `streamTextContent` or
10
+ * `getTextContent` method.
11
+ */
12
+ textContentSource: ReadableStream | TextContent;
13
+ /**
14
+ * - The DOM node that will contain the text
15
+ * runs.
16
+ */
17
+ container: HTMLElement;
18
+ /**
19
+ * - The target viewport to properly layout
20
+ * the text runs.
21
+ */
22
+ viewport: PageViewport;
23
+ /**
24
+ * - HTML elements that correspond to
25
+ * the text items of the textContent input.
26
+ * This is output and shall initially be set to an empty array.
27
+ */
28
+ textDivs?: HTMLElement[] | undefined;
29
+ /**
30
+ * - Some properties
31
+ * weakly mapped to the HTML elements used to render the text.
32
+ */
33
+ textDivProperties?: WeakMap<HTMLElement, Object> | undefined;
34
+ /**
35
+ * - Strings that correspond to
36
+ * the `str` property of the text items of the textContent input.
37
+ * This is output and shall initially be set to an empty array.
38
+ */
39
+ textContentItemsStr?: string[] | undefined;
40
+ /**
41
+ * true if we can use
42
+ * OffscreenCanvas to measure string widths.
43
+ */
44
+ isOffscreenCanvasSupported?: boolean | undefined;
45
+ };
46
+ /**
47
+ * Text layer update parameters.
48
+ */
49
+ export type TextLayerUpdateParameters = {
50
+ /**
51
+ * - The DOM node that will contain the text
52
+ * runs.
53
+ */
54
+ container: HTMLElement;
55
+ /**
56
+ * - The target viewport to properly layout
57
+ * the text runs.
58
+ */
59
+ viewport: PageViewport;
60
+ /**
61
+ * - HTML elements that correspond to
62
+ * the text items of the textContent input.
63
+ * This is output and shall initially be set to an empty array.
64
+ */
65
+ textDivs?: HTMLElement[] | undefined;
66
+ /**
67
+ * - Some properties
68
+ * weakly mapped to the HTML elements used to render the text.
69
+ */
70
+ textDivProperties?: WeakMap<HTMLElement, Object> | undefined;
71
+ /**
72
+ * true if we can use
73
+ * OffscreenCanvas to measure string widths.
74
+ */
75
+ isOffscreenCanvasSupported?: boolean | undefined;
76
+ /**
77
+ * true if the text layer must be rotated.
78
+ */
79
+ mustRotate?: boolean | undefined;
80
+ /**
81
+ * true if the text layer contents must be
82
+ * rescaled.
83
+ */
84
+ mustRescale?: boolean | undefined;
85
+ };
86
+ /**
87
+ * @param {TextLayerRenderParameters} params
88
+ * @returns {TextLayerRenderTask}
89
+ */
90
+ export function renderTextLayer(params: TextLayerRenderParameters): TextLayerRenderTask;
91
+ export class TextLayerRenderTask {
92
+ constructor({ textContentSource, container, viewport, textDivs, textDivProperties, textContentItemsStr, isOffscreenCanvasSupported, }: {
93
+ textContentSource: any;
94
+ container: any;
95
+ viewport: any;
96
+ textDivs: any;
97
+ textDivProperties: any;
98
+ textContentItemsStr: any;
99
+ isOffscreenCanvasSupported: any;
100
+ });
101
+ _textContentSource: any;
102
+ _isReadableStream: boolean;
103
+ _container: any;
104
+ _rootContainer: any;
105
+ _textDivs: any;
106
+ _textContentItemsStr: any;
107
+ _isOffscreenCanvasSupported: any;
108
+ _fontInspectorEnabled: boolean;
109
+ _reader: any;
110
+ _textDivProperties: any;
111
+ _canceled: boolean;
112
+ _capability: PromiseCapability;
113
+ _layoutTextParams: {
114
+ prevFontSize: null;
115
+ prevFontFamily: null;
116
+ div: null;
117
+ scale: number;
118
+ properties: null;
119
+ ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | null;
120
+ };
121
+ _transform: any[];
122
+ _pageWidth: any;
123
+ _pageHeight: any;
124
+ /**
125
+ * Promise for textLayer rendering task completion.
126
+ * @type {Promise<void>}
127
+ */
128
+ get promise(): Promise<void>;
129
+ /**
130
+ * Cancel rendering of the textLayer.
131
+ */
132
+ cancel(): void;
133
+ /**
134
+ * @private
135
+ */
136
+ private _processItems;
137
+ /**
138
+ * @private
139
+ */
140
+ private _layoutText;
141
+ /**
142
+ * @private
143
+ */
144
+ private _render;
145
+ }
146
+ /**
147
+ * @param {TextLayerUpdateParameters} params
148
+ * @returns {undefined}
149
+ */
150
+ export function updateTextLayer({ container, viewport, textDivs, textDivProperties, isOffscreenCanvasSupported, mustRotate, mustRescale, }: TextLayerUpdateParameters): undefined;
151
+ import { PromiseCapability } from "../shared/util.js";