@zilijonas/foliark 0.0.0-stage → 0.1.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 (276) hide show
  1. package/COMMERCIAL-LICENSING.md +33 -0
  2. package/LICENSE +235 -0
  3. package/LICENSE_FOXIT +27 -0
  4. package/LICENSING.md +55 -0
  5. package/NOTICE +14 -0
  6. package/README.md +101 -2
  7. package/SUPPORT_MATRIX.md +126 -0
  8. package/THIRD_PARTY_NOTICES.md +3603 -0
  9. package/cmaps/83pv-RKSJ-H.cmap +312 -0
  10. package/cmaps/90ms-RKSJ-H.cmap +257 -0
  11. package/cmaps/90ms-RKSJ-V.cmap +154 -0
  12. package/cmaps/90msp-RKSJ-H.cmap +255 -0
  13. package/cmaps/90msp-RKSJ-V.cmap +153 -0
  14. package/cmaps/90pv-RKSJ-H.cmap +353 -0
  15. package/cmaps/Add-RKSJ-H.cmap +736 -0
  16. package/cmaps/Add-RKSJ-V.cmap +133 -0
  17. package/cmaps/Adobe-CNS1-UCS2.cmap +18303 -0
  18. package/cmaps/Adobe-GB1-UCS2.cmap +14268 -0
  19. package/cmaps/Adobe-Japan1-UCS2.cmap +19160 -0
  20. package/cmaps/Adobe-Korea1-UCS2.cmap +9265 -0
  21. package/cmaps/B5pc-H.cmap +335 -0
  22. package/cmaps/B5pc-V.cmap +88 -0
  23. package/cmaps/CNS-EUC-H.cmap +488 -0
  24. package/cmaps/CNS-EUC-V.cmap +536 -0
  25. package/cmaps/ETen-B5-H.cmap +341 -0
  26. package/cmaps/ETen-B5-V.cmap +89 -0
  27. package/cmaps/ETenms-B5-H.cmap +77 -0
  28. package/cmaps/ETenms-B5-V.cmap +97 -0
  29. package/cmaps/EUC-H.cmap +205 -0
  30. package/cmaps/EUC-V.cmap +103 -0
  31. package/cmaps/Ext-RKSJ-H.cmap +766 -0
  32. package/cmaps/Ext-RKSJ-V.cmap +115 -0
  33. package/cmaps/GB-EUC-H.cmap +171 -0
  34. package/cmaps/GB-EUC-V.cmap +96 -0
  35. package/cmaps/GBK-EUC-H.cmap +4271 -0
  36. package/cmaps/GBK-EUC-V.cmap +95 -0
  37. package/cmaps/GBK2K-H.cmap +5517 -0
  38. package/cmaps/GBK2K-V.cmap +116 -0
  39. package/cmaps/GBKp-EUC-H.cmap +4270 -0
  40. package/cmaps/GBKp-EUC-V.cmap +95 -0
  41. package/cmaps/GBpc-EUC-H.cmap +173 -0
  42. package/cmaps/GBpc-EUC-V.cmap +96 -0
  43. package/cmaps/H.cmap +198 -0
  44. package/cmaps/HKscs-B5-H.cmap +1329 -0
  45. package/cmaps/HKscs-B5-V.cmap +88 -0
  46. package/cmaps/KSC-EUC-H.cmap +560 -0
  47. package/cmaps/KSC-EUC-V.cmap +92 -0
  48. package/cmaps/KSCms-UHC-H.cmap +774 -0
  49. package/cmaps/KSCms-UHC-HW-H.cmap +773 -0
  50. package/cmaps/KSCms-UHC-HW-V.cmap +91 -0
  51. package/cmaps/KSCms-UHC-V.cmap +92 -0
  52. package/cmaps/KSCpc-EUC-H.cmap +606 -0
  53. package/cmaps/LICENSE.txt +28 -0
  54. package/cmaps/MANIFEST.json +258 -0
  55. package/cmaps/UniCNS-UCS2-H.cmap +16990 -0
  56. package/cmaps/UniCNS-UCS2-V.cmap +88 -0
  57. package/cmaps/UniCNS-UTF16-H.cmap +19146 -0
  58. package/cmaps/UniCNS-UTF16-V.cmap +92 -0
  59. package/cmaps/UniGB-UCS2-H.cmap +14319 -0
  60. package/cmaps/UniGB-UCS2-V.cmap +99 -0
  61. package/cmaps/UniGB-UTF16-H.cmap +14567 -0
  62. package/cmaps/UniGB-UTF16-V.cmap +102 -0
  63. package/cmaps/UniJIS-UCS2-H.cmap +8868 -0
  64. package/cmaps/UniJIS-UCS2-HW-H.cmap +79 -0
  65. package/cmaps/UniJIS-UCS2-HW-V.cmap +277 -0
  66. package/cmaps/UniJIS-UCS2-V.cmap +273 -0
  67. package/cmaps/UniJIS-UTF16-H.cmap +14483 -0
  68. package/cmaps/UniJIS-UTF16-V.cmap +305 -0
  69. package/cmaps/UniKS-UCS2-H.cmap +8723 -0
  70. package/cmaps/UniKS-UCS2-V.cmap +93 -0
  71. package/cmaps/UniKS-UTF16-H.cmap +8893 -0
  72. package/cmaps/UniKS-UTF16-V.cmap +97 -0
  73. package/cmaps/V.cmap +103 -0
  74. package/dist/client.d.ts +48 -0
  75. package/dist/client.js +200 -0
  76. package/dist/document.d.ts +100 -0
  77. package/dist/document.js +108 -0
  78. package/dist/generated/AnnotationPolicy.d.ts +1 -0
  79. package/dist/generated/AnnotationPolicy.js +2 -0
  80. package/dist/generated/Capabilities.d.ts +9 -0
  81. package/dist/generated/Capabilities.js +1 -0
  82. package/dist/generated/Capability.d.ts +9 -0
  83. package/dist/generated/Capability.js +1 -0
  84. package/dist/generated/CapabilityReason.d.ts +5 -0
  85. package/dist/generated/CapabilityReason.js +1 -0
  86. package/dist/generated/CapabilityStatus.d.ts +1 -0
  87. package/dist/generated/CapabilityStatus.js +2 -0
  88. package/dist/generated/ChangeResult.d.ts +12 -0
  89. package/dist/generated/ChangeResult.js +1 -0
  90. package/dist/generated/ChangeSet.d.ts +16 -0
  91. package/dist/generated/ChangeSet.js +1 -0
  92. package/dist/generated/Cluster.d.ts +12 -0
  93. package/dist/generated/Cluster.js +1 -0
  94. package/dist/generated/Collateral.d.ts +5 -0
  95. package/dist/generated/Collateral.js +1 -0
  96. package/dist/generated/Ctl.d.ts +3 -0
  97. package/dist/generated/Ctl.js +1 -0
  98. package/dist/generated/CtlCancel.d.ts +8 -0
  99. package/dist/generated/CtlCancel.js +1 -0
  100. package/dist/generated/CtlEvent.d.ts +1 -0
  101. package/dist/generated/CtlEvent.js +2 -0
  102. package/dist/generated/CtlEventMsg.d.ts +8 -0
  103. package/dist/generated/CtlEventMsg.js +1 -0
  104. package/dist/generated/DocumentFeatures.d.ts +13 -0
  105. package/dist/generated/DocumentFeatures.js +2 -0
  106. package/dist/generated/DocumentInfo.d.ts +12 -0
  107. package/dist/generated/DocumentInfo.js +1 -0
  108. package/dist/generated/EditLayout.d.ts +11 -0
  109. package/dist/generated/EditLayout.js +1 -0
  110. package/dist/generated/EditPreview.d.ts +35 -0
  111. package/dist/generated/EditPreview.js +1 -0
  112. package/dist/generated/EditorFace.d.ts +7 -0
  113. package/dist/generated/EditorFace.js +2 -0
  114. package/dist/generated/EditsReport.d.ts +4 -0
  115. package/dist/generated/EditsReport.js +2 -0
  116. package/dist/generated/ErrorCode.d.ts +4 -0
  117. package/dist/generated/ErrorCode.js +2 -0
  118. package/dist/generated/ErrorDetails.d.ts +20 -0
  119. package/dist/generated/ErrorDetails.js +2 -0
  120. package/dist/generated/ErrorWire.d.ts +11 -0
  121. package/dist/generated/ErrorWire.js +1 -0
  122. package/dist/generated/ExportMode.d.ts +1 -0
  123. package/dist/generated/ExportMode.js +2 -0
  124. package/dist/generated/ExportPlan.d.ts +13 -0
  125. package/dist/generated/ExportPlan.js +1 -0
  126. package/dist/generated/ExportPolicy.d.ts +13 -0
  127. package/dist/generated/ExportPolicy.js +1 -0
  128. package/dist/generated/ExportReport.d.ts +20 -0
  129. package/dist/generated/ExportReport.js +1 -0
  130. package/dist/generated/ExtractOptions.d.ts +7 -0
  131. package/dist/generated/ExtractOptions.js +2 -0
  132. package/dist/generated/Flattened.d.ts +5 -0
  133. package/dist/generated/Flattened.js +2 -0
  134. package/dist/generated/FoliarkError.d.ts +10 -0
  135. package/dist/generated/FoliarkError.js +1 -0
  136. package/dist/generated/FontMatchRule.d.ts +7 -0
  137. package/dist/generated/FontMatchRule.js +2 -0
  138. package/dist/generated/FontResolution.d.ts +12 -0
  139. package/dist/generated/FontResolution.js +1 -0
  140. package/dist/generated/FontRule.d.ts +1 -0
  141. package/dist/generated/FontRule.js +2 -0
  142. package/dist/generated/FontSource.d.ts +10 -0
  143. package/dist/generated/FontSource.js +1 -0
  144. package/dist/generated/FontStyle.d.ts +1 -0
  145. package/dist/generated/FontStyle.js +2 -0
  146. package/dist/generated/GeneratedOrigin.d.ts +4 -0
  147. package/dist/generated/GeneratedOrigin.js +2 -0
  148. package/dist/generated/Hit.d.ts +7 -0
  149. package/dist/generated/Hit.js +1 -0
  150. package/dist/generated/InstancePath.d.ts +5 -0
  151. package/dist/generated/InstancePath.js +1 -0
  152. package/dist/generated/InstanceStep.d.ts +9 -0
  153. package/dist/generated/InstanceStep.js +1 -0
  154. package/dist/generated/InvisibleTextPolicy.d.ts +1 -0
  155. package/dist/generated/InvisibleTextPolicy.js +2 -0
  156. package/dist/generated/KeptReport.d.ts +4 -0
  157. package/dist/generated/KeptReport.js +2 -0
  158. package/dist/generated/LayoutRun.d.ts +6 -0
  159. package/dist/generated/LayoutRun.js +1 -0
  160. package/dist/generated/Limits.d.ts +18 -0
  161. package/dist/generated/Limits.js +2 -0
  162. package/dist/generated/Loss.d.ts +6 -0
  163. package/dist/generated/Loss.js +1 -0
  164. package/dist/generated/LossCode.d.ts +1 -0
  165. package/dist/generated/LossCode.js +2 -0
  166. package/dist/generated/Matrix.d.ts +4 -0
  167. package/dist/generated/Matrix.js +2 -0
  168. package/dist/generated/ObjectId.d.ts +10 -0
  169. package/dist/generated/ObjectId.js +2 -0
  170. package/dist/generated/OkFalse.d.ts +1 -0
  171. package/dist/generated/OkFalse.js +2 -0
  172. package/dist/generated/OkTrue.d.ts +1 -0
  173. package/dist/generated/OkTrue.js +2 -0
  174. package/dist/generated/OpName.d.ts +4 -0
  175. package/dist/generated/OpName.js +2 -0
  176. package/dist/generated/Origin.d.ts +12 -0
  177. package/dist/generated/Origin.js +1 -0
  178. package/dist/generated/PageGeometry.d.ts +24 -0
  179. package/dist/generated/PageGeometry.js +1 -0
  180. package/dist/generated/ParagraphInfo.d.ts +26 -0
  181. package/dist/generated/ParagraphInfo.js +1 -0
  182. package/dist/generated/Phase.d.ts +1 -0
  183. package/dist/generated/Phase.js +2 -0
  184. package/dist/generated/Point.d.ts +4 -0
  185. package/dist/generated/Point.js +2 -0
  186. package/dist/generated/PreviewGlyph.d.ts +13 -0
  187. package/dist/generated/PreviewGlyph.js +2 -0
  188. package/dist/generated/PreviewLine.d.ts +10 -0
  189. package/dist/generated/PreviewLine.js +2 -0
  190. package/dist/generated/Prog.d.ts +7 -0
  191. package/dist/generated/Prog.js +1 -0
  192. package/dist/generated/Progress.d.ts +6 -0
  193. package/dist/generated/Progress.js +1 -0
  194. package/dist/generated/Quad.d.ts +5 -0
  195. package/dist/generated/Quad.js +1 -0
  196. package/dist/generated/RasterPolicy.d.ts +4 -0
  197. package/dist/generated/RasterPolicy.js +2 -0
  198. package/dist/generated/Rect.d.ts +9 -0
  199. package/dist/generated/Rect.js +2 -0
  200. package/dist/generated/Redaction.d.ts +18 -0
  201. package/dist/generated/Redaction.js +1 -0
  202. package/dist/generated/RedactionReport.d.ts +16 -0
  203. package/dist/generated/RedactionReport.js +1 -0
  204. package/dist/generated/RegisteredFont.d.ts +9 -0
  205. package/dist/generated/RegisteredFont.js +1 -0
  206. package/dist/generated/RejectedChange.d.ts +7 -0
  207. package/dist/generated/RejectedChange.js +1 -0
  208. package/dist/generated/RenderWarning.d.ts +5 -0
  209. package/dist/generated/RenderWarning.js +1 -0
  210. package/dist/generated/RenderWarningCode.d.ts +1 -0
  211. package/dist/generated/RenderWarningCode.js +2 -0
  212. package/dist/generated/RenderedPageHeader.d.ts +17 -0
  213. package/dist/generated/RenderedPageHeader.js +1 -0
  214. package/dist/generated/Req.d.ts +13 -0
  215. package/dist/generated/Req.js +1 -0
  216. package/dist/generated/Res.d.ts +3 -0
  217. package/dist/generated/Res.js +1 -0
  218. package/dist/generated/ResErr.d.ts +9 -0
  219. package/dist/generated/ResErr.js +1 -0
  220. package/dist/generated/ResOk.d.ts +8 -0
  221. package/dist/generated/ResOk.js +1 -0
  222. package/dist/generated/RunSource.d.ts +1 -0
  223. package/dist/generated/RunSource.js +2 -0
  224. package/dist/generated/SanitizedItem.d.ts +1 -0
  225. package/dist/generated/SanitizedItem.js +2 -0
  226. package/dist/generated/SearchHit.d.ts +13 -0
  227. package/dist/generated/SearchHit.js +1 -0
  228. package/dist/generated/SearchOptions.d.ts +10 -0
  229. package/dist/generated/SearchOptions.js +2 -0
  230. package/dist/generated/SharedKind.d.ts +1 -0
  231. package/dist/generated/SharedKind.js +2 -0
  232. package/dist/generated/SharedSurvivor.d.ts +6 -0
  233. package/dist/generated/SharedSurvivor.js +1 -0
  234. package/dist/generated/SignedInputPolicy.d.ts +1 -0
  235. package/dist/generated/SignedInputPolicy.js +2 -0
  236. package/dist/generated/SourceLoc.d.ts +9 -0
  237. package/dist/generated/SourceLoc.js +1 -0
  238. package/dist/generated/StyleFlags.d.ts +6 -0
  239. package/dist/generated/StyleFlags.js +2 -0
  240. package/dist/generated/StyleRun.d.ts +18 -0
  241. package/dist/generated/StyleRun.js +1 -0
  242. package/dist/generated/TextEdit.d.ts +11 -0
  243. package/dist/generated/TextEdit.js +1 -0
  244. package/dist/generated/TextPage.d.ts +17 -0
  245. package/dist/generated/TextPage.js +1 -0
  246. package/dist/generated/TextRange.d.ts +11 -0
  247. package/dist/generated/TextRange.js +1 -0
  248. package/dist/generated/TextStats.d.ts +9 -0
  249. package/dist/generated/TextStats.js +2 -0
  250. package/dist/generated/V1.d.ts +1 -0
  251. package/dist/generated/V1.js +2 -0
  252. package/dist/generated/Word.d.ts +27 -0
  253. package/dist/generated/Word.js +1 -0
  254. package/dist/generated/WordSource.d.ts +1 -0
  255. package/dist/generated/WordSource.js +2 -0
  256. package/dist/index.d.ts +42 -0
  257. package/dist/index.js +3 -0
  258. package/dist/inline.d.ts +18 -0
  259. package/dist/inline.js +33 -0
  260. package/dist/layout.d.ts +5 -0
  261. package/dist/layout.js +3 -0
  262. package/dist/lifecycle.d.ts +7 -0
  263. package/dist/lifecycle.js +28 -0
  264. package/dist/protocol.d.ts +162 -0
  265. package/dist/protocol.js +302 -0
  266. package/dist/worker-core.d.ts +15 -0
  267. package/dist/worker-core.js +244 -0
  268. package/dist/worker-supervisor.d.ts +23 -0
  269. package/dist/worker-supervisor.js +41 -0
  270. package/dist/worker.d.ts +1 -0
  271. package/dist/worker.js +9 -0
  272. package/package.json +71 -3
  273. package/wasm/foliark_wasm.d.ts +120 -0
  274. package/wasm/foliark_wasm.js +1050 -0
  275. package/wasm/foliark_wasm_bg.wasm +0 -0
  276. package/wasm/foliark_wasm_bg.wasm.d.ts +32 -0
@@ -0,0 +1,97 @@
1
+ %!PS-Adobe-3.0 Resource-CMap
2
+ %%DocumentNeededResources: ProcSet (CIDInit)
3
+ %%DocumentNeededResources: CMap (UniKS-UTF16-H)
4
+ %%IncludeResource: ProcSet (CIDInit)
5
+ %%IncludeResource: CMap (UniKS-UTF16-H)
6
+ %%BeginResource: CMap (UniKS-UTF16-V)
7
+ %%Title: (UniKS-UTF16-V Adobe Korea1 1)
8
+ %%Version: 1.005
9
+ %%Copyright: -----------------------------------------------------------
10
+ %%Copyright: Copyright 1990-2019 Adobe. All rights reserved.
11
+ %%Copyright:
12
+ %%Copyright: Redistribution and use in source and binary forms, with or
13
+ %%Copyright: without modification, are permitted provided that the
14
+ %%Copyright: following conditions are met:
15
+ %%Copyright:
16
+ %%Copyright: Redistributions of source code must retain the above
17
+ %%Copyright: copyright notice, this list of conditions and the following
18
+ %%Copyright: disclaimer.
19
+ %%Copyright:
20
+ %%Copyright: Redistributions in binary form must reproduce the above
21
+ %%Copyright: copyright notice, this list of conditions and the following
22
+ %%Copyright: disclaimer in the documentation and/or other materials
23
+ %%Copyright: provided with the distribution.
24
+ %%Copyright:
25
+ %%Copyright: Neither the name of Adobe nor the names of its contributors
26
+ %%Copyright: may be used to endorse or promote products derived from
27
+ %%Copyright: this software without specific prior written permission.
28
+ %%Copyright:
29
+ %%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
30
+ %%Copyright: CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
31
+ %%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32
+ %%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33
+ %%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
34
+ %%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35
+ %%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
36
+ %%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37
+ %%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38
+ %%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39
+ %%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
40
+ %%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41
+ %%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
+ %%Copyright: -----------------------------------------------------------
43
+ %%EndComments
44
+
45
+ /CIDInit /ProcSet findresource begin
46
+
47
+ 12 dict begin
48
+
49
+ begincmap
50
+
51
+ /UniKS-UTF16-H usecmap
52
+
53
+ /CIDSystemInfo 3 dict dup begin
54
+ /Registry (Adobe) def
55
+ /Ordering (Korea1) def
56
+ /Supplement 1 def
57
+ end def
58
+
59
+ /CMapName /UniKS-UTF16-V def
60
+ /CMapVersion 1.005 def
61
+ /CMapType 1 def
62
+
63
+ /XUID [1 10 25545] def
64
+
65
+ /WMode 1 def
66
+
67
+ 11 begincidchar
68
+ <2016> 8061
69
+ <2025> 8058
70
+ <3013> 8075
71
+ <ff01> 8076
72
+ <ff0c> 8079
73
+ <ff0e> 8080
74
+ <ff3b> 8087
75
+ <ff3d> 8088
76
+ <ff3f> 8089
77
+ <ff5e> 8062
78
+ <ffe3> 8093
79
+ endcidchar
80
+
81
+ 7 begincidrange
82
+ <2013> <2014> 8059
83
+ <3001> <3002> 8056
84
+ <3008> <3011> 8065
85
+ <3014> <3015> 8063
86
+ <ff08> <ff09> 8077
87
+ <ff1a> <ff1f> 8081
88
+ <ff5b> <ff5d> 8090
89
+ endcidrange
90
+
91
+ endcmap
92
+ CMapName currentdict /CMap defineresource pop
93
+ end
94
+ end
95
+
96
+ %%EndResource
97
+ %%EOF
package/cmaps/V.cmap ADDED
@@ -0,0 +1,103 @@
1
+ %!PS-Adobe-3.0 Resource-CMap
2
+ %%DocumentNeededResources: ProcSet (CIDInit)
3
+ %%DocumentNeededResources: CMap (H)
4
+ %%IncludeResource: ProcSet (CIDInit)
5
+ %%IncludeResource: CMap (H)
6
+ %%BeginResource: CMap (V)
7
+ %%Title: (V Adobe Japan1 1)
8
+ %%Version: 12.005
9
+ %%Copyright: -----------------------------------------------------------
10
+ %%Copyright: Copyright 1990-2019 Adobe. All rights reserved.
11
+ %%Copyright:
12
+ %%Copyright: Redistribution and use in source and binary forms, with or
13
+ %%Copyright: without modification, are permitted provided that the
14
+ %%Copyright: following conditions are met:
15
+ %%Copyright:
16
+ %%Copyright: Redistributions of source code must retain the above
17
+ %%Copyright: copyright notice, this list of conditions and the following
18
+ %%Copyright: disclaimer.
19
+ %%Copyright:
20
+ %%Copyright: Redistributions in binary form must reproduce the above
21
+ %%Copyright: copyright notice, this list of conditions and the following
22
+ %%Copyright: disclaimer in the documentation and/or other materials
23
+ %%Copyright: provided with the distribution.
24
+ %%Copyright:
25
+ %%Copyright: Neither the name of Adobe nor the names of its contributors
26
+ %%Copyright: may be used to endorse or promote products derived from
27
+ %%Copyright: this software without specific prior written permission.
28
+ %%Copyright:
29
+ %%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
30
+ %%Copyright: CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
31
+ %%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32
+ %%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33
+ %%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
34
+ %%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35
+ %%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
36
+ %%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37
+ %%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38
+ %%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39
+ %%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
40
+ %%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41
+ %%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
+ %%Copyright: -----------------------------------------------------------
43
+ %%EndComments
44
+
45
+ /CIDInit /ProcSet findresource begin
46
+
47
+ 12 dict begin
48
+
49
+ begincmap
50
+
51
+ /H usecmap
52
+
53
+ /CIDSystemInfo 3 dict dup begin
54
+ /Registry (Adobe) def
55
+ /Ordering (Japan1) def
56
+ /Supplement 1 def
57
+ end def
58
+
59
+ /CMapName /V def
60
+ /CMapVersion 12.005 def
61
+ /CMapType 1 def
62
+
63
+ /UIDOffset 850 def
64
+ /XUID [1 10 25340] def
65
+
66
+ /WMode 1 def
67
+
68
+ 27 begincidrange
69
+ <2122> <2123> 7887
70
+ <2131> <2132> 7889
71
+ <213c> <213e> 7891
72
+ <2141> <2145> 7894
73
+ <214a> <215b> 7899
74
+ <2161> <2161> 7917
75
+ <2421> <2421> 7918
76
+ <2423> <2423> 7919
77
+ <2425> <2425> 7920
78
+ <2427> <2427> 7921
79
+ <2429> <2429> 7922
80
+ <2443> <2443> 7923
81
+ <2463> <2463> 7924
82
+ <2465> <2465> 7925
83
+ <2467> <2467> 7926
84
+ <246e> <246e> 7927
85
+ <2521> <2521> 7928
86
+ <2523> <2523> 7929
87
+ <2525> <2525> 7930
88
+ <2527> <2527> 7931
89
+ <2529> <2529> 7932
90
+ <2543> <2543> 7933
91
+ <2563> <2563> 7934
92
+ <2565> <2565> 7935
93
+ <2567> <2567> 7936
94
+ <256e> <256e> 7937
95
+ <2575> <2576> 7938
96
+ endcidrange
97
+ endcmap
98
+ CMapName currentdict /CMap defineresource pop
99
+ end
100
+ end
101
+
102
+ %%EndResource
103
+ %%EOF
@@ -0,0 +1,48 @@
1
+ import { type DocumentHandle, type Signal } from "./document.js";
2
+ import type { FontMatchRule } from "./generated/FontMatchRule.js";
3
+ import type { FontSource } from "./generated/FontSource.js";
4
+ import type { Limits } from "./generated/Limits.js";
5
+ import type { RegisteredFont } from "./generated/RegisteredFont.js";
6
+ export type ResetReason = "hang" | "crash" | "oom" | "restart";
7
+ export interface FoliarkOptions {
8
+ wasmUrl: string | URL;
9
+ /** Exactly one of `workerUrl` and `worker`. */
10
+ workerUrl?: string | URL;
11
+ worker?: () => Worker;
12
+ /**
13
+ * Folder that serves the CMap pack (`<name>.cmap` files, spec 10.3), absolute or relative to the page. Default: the
14
+ * `cmaps/` folder shipped in this package, resolved from the SDK's own URL (a bundler must copy it, see docs/deployment.md).
15
+ * Only the files a document lists in `requiredAssets` are fetched, at `open`; a missing or corrupt one rejects `open`
16
+ * with `ASSET_LOAD_FAILED` and `details.feature = "cmap:<name>"`.
17
+ */
18
+ cmapsUrl?: string | URL;
19
+ limits?: Partial<Limits>;
20
+ fontMatch?: FontMatchRule[];
21
+ /** Default 10000 (spec 10.2). */
22
+ hangTimeoutMs?: number;
23
+ /** Called with a reason (never content) for every message that broke the protocol and was dropped or failed. */
24
+ onProtocolViolation?: (reason: string) => void;
25
+ }
26
+ export interface OpenOptions extends Signal {
27
+ /** User or owner password; not retained. */
28
+ password?: string;
29
+ /** Accept a file whose xref had to be rebuilt (false). */
30
+ allowRepaired?: boolean;
31
+ /** An `ArrayBuffer` is transferred (detached in the caller) unless `false`; a view is always copied. Default true. */
32
+ transfer?: boolean;
33
+ }
34
+ export interface Foliark {
35
+ /** +1 per worker (re)start. */
36
+ readonly generation: number;
37
+ open(bytes: ArrayBuffer | Uint8Array, o?: OpenOptions): Promise<DocumentHandle>;
38
+ registerFonts(f: FontSource[], o?: Signal): Promise<RegisteredFont[]>;
39
+ /** Hard reset: a fresh worker, pending calls reject `WORKER_RESET`, old handles are gone (spec 10.2). */
40
+ restart(): Promise<void>;
41
+ onReset(cb: (e: {
42
+ generation: number;
43
+ reason: ResetReason;
44
+ }) => void): () => void;
45
+ /** Later calls reject `CLIENT_DISPOSED`. */
46
+ dispose(): Promise<void>;
47
+ }
48
+ export declare function createFoliark(o: FoliarkOptions): Promise<Foliark>;
package/dist/client.js ADDED
@@ -0,0 +1,200 @@
1
+ // Main-thread client (spec 1, 10): owns the worker, speaks the validated envelope of spec 10.4, keeps the
2
+ // registered fonts so a reset can re-send them, and hands out `DocumentHandle`s. Every way a worker is replaced
3
+ // (hang watchdog, error, fatal, out of memory, restart()) goes through the one `reset` routine (spec 10.2).
4
+ import { makeHandle } from "./document.js";
5
+ import { Lifecycle } from "./lifecycle.js";
6
+ import { checkRequest, Correlator, FoliarkError, postTransfer } from "./protocol.js";
7
+ import { DEFAULT_HANG_TIMEOUT_MS, failureReason, Watchdog } from "./worker-supervisor.js";
8
+ const copyOf = (b) => (b instanceof Uint8Array ? b.slice() : new Uint8Array(b.slice(0)));
9
+ export async function createFoliark(o) {
10
+ if ((o.workerUrl === undefined) === (o.worker === undefined)) {
11
+ throw new FoliarkError("INVALID_ARGUMENT", "pass exactly one of workerUrl and worker");
12
+ }
13
+ const hangTimeoutMs = o.hangTimeoutMs ?? DEFAULT_HANG_TIMEOUT_MS;
14
+ if (!(Number.isFinite(hangTimeoutMs) && hangTimeoutMs > 0)) {
15
+ throw new FoliarkError("INVALID_ARGUMENT", "hangTimeoutMs must be a positive number");
16
+ }
17
+ const corr = new Correlator();
18
+ const violation = o.onProtocolViolation ?? ((reason) => console.warn(`foliark protocol violation: ${reason}`));
19
+ const listeners = new Set();
20
+ /** Client-held bytes of every registered font, re-sent after a reset (spec 10.2). */
21
+ const fonts = [];
22
+ const lifecycle = new Lifecycle();
23
+ let disposed = false;
24
+ let worker;
25
+ // No message from the worker for `hangTimeoutMs` while a request is unanswered: it is stuck in one call.
26
+ const watchdog = new Watchdog(hangTimeoutMs, () => {
27
+ violation(`worker silent for ${hangTimeoutMs} ms`);
28
+ reset("hang").catch(resetFailed);
29
+ });
30
+ const resetFailed = (e) => {
31
+ if (!disposed)
32
+ violation(`reset failed: ${e instanceof Error ? e.message : String(e)}`);
33
+ };
34
+ /** Terminal: no worker, no timer, every waiter settled. */
35
+ const shutdown = () => {
36
+ disposed = true;
37
+ watchdog.stop();
38
+ worker.terminate();
39
+ const err = new FoliarkError("CLIENT_DISPOSED", "client disposed");
40
+ for (const w of corr.reset())
41
+ w.reject(err);
42
+ lifecycle.releaseAll();
43
+ fonts.length = 0; // the client-held font bytes are the one big thing it keeps
44
+ listeners.clear();
45
+ };
46
+ const call = (op, args, c = {}) => new Promise((resolve, reject) => {
47
+ if (disposed)
48
+ return reject(new FoliarkError("CLIENT_DISPOSED", "client disposed"));
49
+ if (c.signal?.aborted)
50
+ return reject(new FoliarkError("CANCELLED", "operation cancelled", { recoverable: true }));
51
+ const msg = { v: 1, id: 0, gen: corr.generation, op, ...(c.doc === undefined ? {} : { doc: c.doc }), args };
52
+ const checked = checkRequest(msg, corr.generation);
53
+ if (!checked.ok)
54
+ return reject(checked.error);
55
+ let onAbort;
56
+ const settle = (f) => () => {
57
+ if (onAbort)
58
+ c.signal?.removeEventListener("abort", onAbort);
59
+ f();
60
+ };
61
+ const id = corr.register(op, {
62
+ resolve: (v) => settle(() => resolve(v))(),
63
+ reject: (e) => settle(() => reject(e))(),
64
+ });
65
+ msg.id = id;
66
+ watchdog.arm();
67
+ // The worker answers a cancelled op itself (CANCELLED), so the correlator settles it like any other.
68
+ if (c.signal) {
69
+ onAbort = () => worker.postMessage({ v: 1, cancel: id });
70
+ c.signal.addEventListener("abort", onAbort, { once: true });
71
+ }
72
+ try {
73
+ postTransfer(worker, msg, c.transfer ?? []);
74
+ }
75
+ catch (e) {
76
+ reject(e);
77
+ }
78
+ });
79
+ const fontArgs = () => ({ fonts: fonts.map((f) => ({ ...f, bytes: f.bytes.slice().buffer })) });
80
+ /** Start a worker for the current generation: init, then the registered fonts, in order. */
81
+ function spawn(first = false) {
82
+ const w = (worker = o.worker ? o.worker() : new Worker(o.workerUrl, { type: "module" }));
83
+ w.onmessage = (e) => {
84
+ if (w !== worker)
85
+ return;
86
+ const m = corr.receive(e.data);
87
+ if (corr.size)
88
+ watchdog.kick();
89
+ else
90
+ watchdog.stop();
91
+ if (m.kind === "result")
92
+ m.ctx.resolve(m.value);
93
+ else if (m.kind === "failure") {
94
+ if (m.error.code === "PROTOCOL_ERROR")
95
+ violation(m.error.message);
96
+ m.ctx.reject(m.error);
97
+ }
98
+ else if (m.kind === "dropped")
99
+ violation(m.reason);
100
+ else if (m.kind === "event" && m.event === "fatal")
101
+ crash(m.reason ?? "worker fatal");
102
+ };
103
+ // A first worker that dies before init answered could not load its script (missing, offline): an asset failure (spec 10.3).
104
+ // Later workers keep the crash path (their script was already fetched once).
105
+ let failInit;
106
+ const unloadable = new Promise((_, reject) => (failInit = reject));
107
+ let starting = first;
108
+ w.onerror = (e) => {
109
+ if (w !== worker)
110
+ return;
111
+ if (starting)
112
+ failInit(new FoliarkError("ASSET_LOAD_FAILED", `worker script failed to load${e.message ? `: ${e.message}` : ""}`));
113
+ else
114
+ crash(`worker error: ${e.message}`, e.message);
115
+ };
116
+ const initCall = call("init", {
117
+ wasmUrl: String(o.wasmUrl),
118
+ cmapsUrl: o.cmapsUrl === undefined ? undefined : new URL(String(o.cmapsUrl), globalThis.location?.href).href,
119
+ limits: o.limits,
120
+ fontMatch: o.fontMatch,
121
+ });
122
+ const init = Promise.race([unloadable, initCall]).finally(() => (starting = false));
123
+ const registered = fonts.length
124
+ ? (() => {
125
+ const args = fontArgs();
126
+ return call("registerFonts", args, { transfer: args.fonts.map((f) => f.bytes) });
127
+ })()
128
+ : undefined;
129
+ return Promise.all([init, registered]);
130
+ }
131
+ async function reset(reason) {
132
+ if (disposed)
133
+ return;
134
+ watchdog.stop();
135
+ worker.terminate();
136
+ lifecycle.releaseAll(); // every handle of the dead generation is gone, whoever still holds it
137
+ const err = new FoliarkError("WORKER_RESET", `worker reset (${reason})`, { recoverable: true });
138
+ for (const w of corr.reset())
139
+ w.reject(err);
140
+ const ready = spawn();
141
+ for (const cb of [...listeners]) {
142
+ try {
143
+ cb({ generation: corr.generation, reason });
144
+ }
145
+ catch {
146
+ // a listener's bug must not break the reset
147
+ }
148
+ }
149
+ await ready;
150
+ }
151
+ const crash = (why, cause = why) => {
152
+ violation(why);
153
+ reset(failureReason(cause)).catch(resetFailed);
154
+ };
155
+ const link = {
156
+ get generation() {
157
+ return corr.generation;
158
+ },
159
+ get disposed() {
160
+ return disposed;
161
+ },
162
+ call,
163
+ own: (release) => lifecycle.own(release),
164
+ };
165
+ try {
166
+ await spawn(true);
167
+ }
168
+ catch (e) {
169
+ // A client that never started owns no worker.
170
+ shutdown();
171
+ throw e;
172
+ }
173
+ return {
174
+ get generation() {
175
+ return corr.generation;
176
+ },
177
+ async open(bytes, opts) {
178
+ const transferable = bytes instanceof ArrayBuffer && opts?.transfer !== false;
179
+ const buf = transferable ? bytes : copyOf(bytes).buffer;
180
+ const { docId, info } = await call("open", { bytes: buf, password: opts?.password, allowRepaired: opts?.allowRepaired }, { transfer: [buf], signal: opts?.signal });
181
+ return makeHandle(link, docId, info);
182
+ },
183
+ async registerFonts(list, opts) {
184
+ const kept = list.map((f) => ({ bytes: copyOf(f.bytes), family: f.family, weight: f.weight, style: f.style }));
185
+ const args = { fonts: kept.map((f) => ({ ...f, bytes: f.bytes.slice().buffer })) };
186
+ const registered = await call("registerFonts", args, { transfer: args.fonts.map((f) => f.bytes), signal: opts?.signal });
187
+ fonts.push(...kept);
188
+ return registered;
189
+ },
190
+ restart: () => reset("restart"),
191
+ onReset(cb) {
192
+ listeners.add(cb);
193
+ return () => void listeners.delete(cb);
194
+ },
195
+ async dispose() {
196
+ if (!disposed)
197
+ shutdown();
198
+ },
199
+ };
200
+ }
@@ -0,0 +1,100 @@
1
+ import type { Capabilities } from "./generated/Capabilities.js";
2
+ import type { ChangeResult } from "./generated/ChangeResult.js";
3
+ import type { ChangeSet } from "./generated/ChangeSet.js";
4
+ import type { DocumentInfo } from "./generated/DocumentInfo.js";
5
+ import type { ExportMode } from "./generated/ExportMode.js";
6
+ import type { ExportPlan } from "./generated/ExportPlan.js";
7
+ import type { ExportPolicy } from "./generated/ExportPolicy.js";
8
+ import type { EditPreview } from "./generated/EditPreview.js";
9
+ import type { ExtractOptions } from "./generated/ExtractOptions.js";
10
+ import type { Hit } from "./generated/Hit.js";
11
+ import type { OpName } from "./generated/OpName.js";
12
+ import type { PageGeometry } from "./generated/PageGeometry.js";
13
+ import type { ParagraphInfo } from "./generated/ParagraphInfo.js";
14
+ import type { Point } from "./generated/Point.js";
15
+ import type { Rect } from "./generated/Rect.js";
16
+ import type { RenderWarning } from "./generated/RenderWarning.js";
17
+ import type { SearchHit } from "./generated/SearchHit.js";
18
+ import type { SearchOptions as SearchWire } from "./generated/SearchOptions.js";
19
+ import type { TextPage } from "./generated/TextPage.js";
20
+ import type { TextRange } from "./generated/TextRange.js";
21
+ export interface Signal {
22
+ signal?: AbortSignal;
23
+ }
24
+ export type ExtractTextOptions = ExtractOptions & Signal;
25
+ export type SearchOptions = SearchWire & Signal;
26
+ export interface RenderOptions extends Signal {
27
+ /** Pixels per point (1). */
28
+ scale?: number;
29
+ /** Display-space rect to render (the whole page). */
30
+ clip?: Rect;
31
+ /** Draw annotation appearances (true). */
32
+ annotations?: boolean;
33
+ /** Straight-alpha sRGB, each 0..1 (opaque white). */
34
+ background?: [number, number, number, number];
35
+ }
36
+ export interface RenderedPage {
37
+ width: number;
38
+ height: number;
39
+ /** RGBA8 straight alpha sRGB, ImageData-compatible. */
40
+ data: Uint8ClampedArray;
41
+ scale: number;
42
+ clip: Rect;
43
+ /** False iff `warnings` is not empty. */
44
+ complete: boolean;
45
+ warnings: RenderWarning[];
46
+ }
47
+ export interface ExportOptions extends Signal {
48
+ mode: ExportMode;
49
+ policy?: Partial<ExportPolicy>;
50
+ }
51
+ export interface DocumentHandle {
52
+ readonly id: string;
53
+ readonly generation: number;
54
+ /** Starts at 0; +1 per accepted `applyChanges`. */
55
+ readonly revision: number;
56
+ info(): Promise<DocumentInfo>;
57
+ pages(): Promise<PageGeometry[]>;
58
+ capabilities(o?: {
59
+ deep?: boolean;
60
+ } & Signal): Promise<Capabilities>;
61
+ extractText(page: number, o?: ExtractTextOptions): Promise<TextPage>;
62
+ hitTest(page: number, p: Point, o?: {
63
+ tolerance?: number;
64
+ }): Promise<Hit | null>;
65
+ select(page: number, from: Point, to: Point): Promise<TextRange | null>;
66
+ quadsFor(page: number, start: number, end: number): Promise<TextRange>;
67
+ search(query: string, o?: SearchOptions): Promise<SearchHit[]>;
68
+ renderPage(page: number, o?: RenderOptions): Promise<RenderedPage>;
69
+ prepareParagraph(page: number, rects: Rect[], o?: {
70
+ font?: string;
71
+ editorFace?: boolean;
72
+ }): Promise<ParagraphInfo>;
73
+ /**
74
+ * ADR 0004: the layout `applyChanges` would commit for one edit, nothing committed. Cheap enough for every
75
+ * keystroke. Rejects as `applyChanges` would (EDIT_*), except that overflow is `fits: false`.
76
+ */
77
+ layoutEdit(page: number, rects: Rect[], text: string, o?: {
78
+ font?: string;
79
+ glyphs?: boolean;
80
+ }): Promise<EditPreview>;
81
+ applyChanges(cs: ChangeSet, o?: Signal): Promise<ChangeResult>;
82
+ prepareExport(o: ExportOptions): Promise<ExportPlan>;
83
+ /** Single-use byte handoff: the plan is freed. */
84
+ export(plan: ExportPlan): Promise<Uint8Array>;
85
+ /** Idempotent; frees the document, its plans and caches. */
86
+ close(): Promise<void>;
87
+ }
88
+ /** What a handle needs from the client. */
89
+ export interface Link {
90
+ readonly generation: number;
91
+ readonly disposed: boolean;
92
+ /** Register what the handle holds so reset and dispose release it (see lifecycle.ts); returns the early release. */
93
+ own(release: () => void): () => void;
94
+ call<R>(op: OpName, args: object, o?: {
95
+ doc?: string;
96
+ transfer?: ArrayBuffer[];
97
+ signal?: AbortSignal;
98
+ }): Promise<R>;
99
+ }
100
+ export declare function makeHandle(link: Link, id: string, info: DocumentInfo): DocumentHandle;
@@ -0,0 +1,108 @@
1
+ import { FoliarkError } from "./protocol.js";
2
+ const invalid = (message) => new FoliarkError("INVALID_ARGUMENT", message);
3
+ const isIndex = (n) => Number.isInteger(n) && n >= 0 && n <= 0xffff_ffff;
4
+ const isPoint = (p) => !!p && Number.isFinite(p.x) && Number.isFinite(p.y);
5
+ export function makeHandle(link, id, info) {
6
+ const generation = link.generation;
7
+ let revision = 0;
8
+ let closed = false;
9
+ let pages;
10
+ /** Gone: closed, or its worker was replaced or disposed. Drops what the handle caches. */
11
+ const release = link.own(() => {
12
+ closed = true;
13
+ pages = undefined;
14
+ });
15
+ /** One validated call. A closed document, or one from before a reset, is gone. */
16
+ const call = async (op, args, signal, transfer) => {
17
+ try {
18
+ if (link.disposed)
19
+ throw new FoliarkError("CLIENT_DISPOSED", "client disposed");
20
+ if (closed || link.generation !== generation)
21
+ throw new FoliarkError("DOCUMENT_GONE", "document is closed or from a previous worker");
22
+ return await link.call(op, args, { doc: id, signal, transfer });
23
+ }
24
+ catch (e) {
25
+ if (e instanceof FoliarkError) {
26
+ e.docId = id;
27
+ e.revision = revision;
28
+ }
29
+ throw e;
30
+ }
31
+ };
32
+ const page = (n) => {
33
+ if (!isIndex(n))
34
+ throw invalid("page must be a non-negative integer");
35
+ return n;
36
+ };
37
+ return {
38
+ id,
39
+ generation,
40
+ get revision() {
41
+ return revision;
42
+ },
43
+ info: async () => info,
44
+ async pages() {
45
+ return (pages ??= await call("pages", {}));
46
+ },
47
+ capabilities: (o) => call("capabilities", { deep: o?.deep }, o?.signal),
48
+ async extractText(p, o) {
49
+ return call("extractText", { page: page(p), chars: o?.chars, includeOcgHidden: o?.includeOcgHidden }, o?.signal);
50
+ },
51
+ async hitTest(p, point, o) {
52
+ if (!isPoint(point) || (o?.tolerance !== undefined && !(o.tolerance >= 0)))
53
+ throw invalid("point must be finite and tolerance >= 0");
54
+ return call("hitTest", { page: page(p), point, tolerance: o?.tolerance });
55
+ },
56
+ async select(p, from, to) {
57
+ if (!isPoint(from) || !isPoint(to))
58
+ throw invalid("points must be finite");
59
+ return call("select", { page: page(p), from, to });
60
+ },
61
+ async quadsFor(p, start, end) {
62
+ if (!isIndex(start) || !isIndex(end) || start > end)
63
+ throw invalid("start and end must be offsets with start <= end");
64
+ return call("quadsFor", { page: page(p), start, end });
65
+ },
66
+ async search(query, o) {
67
+ if (typeof query !== "string")
68
+ throw invalid("query must be a string");
69
+ const { signal, ...options } = o ?? {};
70
+ return call("search", { query, ...options }, signal);
71
+ },
72
+ async renderPage(p, o) {
73
+ const { signal, ...options } = o ?? {};
74
+ const r = await call("renderPage", { page: page(p), ...options }, signal);
75
+ return { ...r, data: new Uint8ClampedArray(r.data) };
76
+ },
77
+ async prepareParagraph(p, rects, o) {
78
+ const r = await call("prepareParagraph", { page: page(p), rects, font: o?.font, editorFace: o?.editorFace });
79
+ // The face crosses the worker boundary as a transferred ArrayBuffer.
80
+ if (r.editorFace)
81
+ r.editorFace.bytes = new Uint8Array(r.editorFace.bytes);
82
+ return r;
83
+ },
84
+ async layoutEdit(p, rects, text, o) {
85
+ if (typeof text !== "string")
86
+ throw invalid("text must be a string");
87
+ return call("layoutEdit", { page: page(p), rects, text, font: o?.font, glyphs: o?.glyphs });
88
+ },
89
+ async applyChanges(changes, o) {
90
+ const r = await call("applyChanges", { changes }, o?.signal);
91
+ if (r.accepted)
92
+ revision = r.revision;
93
+ return r;
94
+ },
95
+ prepareExport: (o) => call("prepareExport", { mode: o.mode, policy: o.policy }, o.signal),
96
+ async export(plan) {
97
+ return new Uint8Array(await call("export", { planId: plan.planId }));
98
+ },
99
+ async close() {
100
+ if (closed)
101
+ return;
102
+ if (link.disposed || link.generation !== generation)
103
+ return release(); // its worker is gone, nothing left to free
104
+ await call("close", {});
105
+ release();
106
+ },
107
+ };
108
+ }
@@ -0,0 +1 @@
1
+ export type AnnotationPolicy = "flatten" | "remove";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Capability } from "./Capability";
2
+ export type Capabilities = {
3
+ extract: Capability;
4
+ render: Capability;
5
+ edit: Capability;
6
+ redact: Capability;
7
+ exportNative: Capability;
8
+ exportRaster: Capability;
9
+ };
@@ -0,0 +1 @@
1
+ export {};