@arbidocs/blocks 0.4.100 → 0.4.102

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 (225) hide show
  1. package/dist/agents/index.cjs +207 -207
  2. package/dist/agents/index.js +2 -2
  3. package/dist/{chunk-NJX774HB.js → chunk-5NQIBJPP.js} +3 -3
  4. package/dist/{chunk-NJX774HB.js.map → chunk-5NQIBJPP.js.map} +1 -1
  5. package/dist/chunk-6MG62I5B.cjs +272 -0
  6. package/dist/chunk-6MG62I5B.cjs.map +1 -0
  7. package/dist/{chunk-NW3LFDZL.cjs → chunk-DDYXFALG.cjs} +3 -3
  8. package/dist/{chunk-NW3LFDZL.cjs.map → chunk-DDYXFALG.cjs.map} +1 -1
  9. package/dist/chunk-EQB3WELX.js +269 -0
  10. package/dist/chunk-EQB3WELX.js.map +1 -0
  11. package/dist/{chunk-B7P73VHX.cjs → chunk-FAGQTB3D.cjs} +30 -214
  12. package/dist/chunk-FAGQTB3D.cjs.map +1 -0
  13. package/dist/{chunk-6HZNFOHW.js → chunk-G5JH2YMQ.js} +3 -3
  14. package/dist/{chunk-6HZNFOHW.js.map → chunk-G5JH2YMQ.js.map} +1 -1
  15. package/dist/{chunk-72PQ42YI.js → chunk-MYALCKDR.js} +34 -217
  16. package/dist/chunk-MYALCKDR.js.map +1 -0
  17. package/dist/{chunk-O24WPHLD.cjs → chunk-Y5XW57U4.cjs} +5 -5
  18. package/dist/{chunk-O24WPHLD.cjs.map → chunk-Y5XW57U4.cjs.map} +1 -1
  19. package/dist/{chunk-E2QWWLK5.js → chunk-YGREW5TZ.js} +3 -3
  20. package/dist/{chunk-E2QWWLK5.js.map → chunk-YGREW5TZ.js.map} +1 -1
  21. package/dist/{chunk-IE55TWIG.cjs → chunk-ZT2EBBSC.cjs} +5 -5
  22. package/dist/{chunk-IE55TWIG.cjs.map → chunk-ZT2EBBSC.cjs.map} +1 -1
  23. package/dist/connect/docx.cjs +6 -6
  24. package/dist/connect/docx.js +4 -4
  25. package/dist/connect/index.cjs +3 -3
  26. package/dist/connect/index.js +2 -2
  27. package/dist/document-tools/AdoptSignatureDialog.d.ts +25 -0
  28. package/dist/document-tools/DocumentToolButtons.d.ts +2 -0
  29. package/dist/document-tools/SignatureRequestBanner.d.ts +18 -0
  30. package/dist/document-tools/index.cjs +175 -0
  31. package/dist/document-tools/index.cjs.map +1 -1
  32. package/dist/document-tools/index.d.ts +3 -1
  33. package/dist/document-tools/index.js +168 -3
  34. package/dist/document-tools/index.js.map +1 -1
  35. package/dist/document-tools/viewer/GuidedSigningViewer.d.ts +26 -0
  36. package/dist/document-tools/viewer/SignatureFieldsOverlay.d.ts +41 -0
  37. package/dist/document-tools/viewer/SignatureRequestEditor.d.ts +26 -0
  38. package/dist/document-tools/viewer/index.cjs +983 -0
  39. package/dist/document-tools/viewer/index.cjs.map +1 -1
  40. package/dist/document-tools/viewer/index.d.ts +3 -0
  41. package/dist/document-tools/viewer/index.js +983 -5
  42. package/dist/document-tools/viewer/index.js.map +1 -1
  43. package/dist/docx/NativeDocxEditor.d.ts +1 -1
  44. package/dist/docx/definitions/DefinedTerms.d.ts +1 -12
  45. package/dist/docx/definitions/commands.d.ts +3 -27
  46. package/dist/docx/index.cjs +35 -39
  47. package/dist/docx/index.d.ts +1 -1
  48. package/dist/docx/index.js +3 -3
  49. package/dist/facts/index.cjs +1 -1
  50. package/dist/facts/index.js +1 -1
  51. package/dist/files/index.cjs +1 -1
  52. package/dist/files/index.js +1 -1
  53. package/dist/home/index.cjs +1 -1
  54. package/dist/home/index.js +1 -1
  55. package/dist/index.cjs +253 -253
  56. package/dist/index.js +3 -3
  57. package/dist/shell/index.cjs +1 -1
  58. package/dist/shell/index.js +1 -1
  59. package/dist/studio/index.cjs +1 -1
  60. package/dist/studio/index.js +1 -1
  61. package/dist/workflow-canvas/index.cjs +9 -9
  62. package/dist/workflow-canvas/index.js +2 -2
  63. package/node_modules/@arbidocs/coedit/LICENSE +21 -0
  64. package/node_modules/@arbidocs/coedit/dist/encoding.cjs +751 -0
  65. package/node_modules/@arbidocs/coedit/dist/encoding.cjs.map +1 -0
  66. package/node_modules/@arbidocs/coedit/dist/encoding.d.cts +192 -0
  67. package/node_modules/@arbidocs/coedit/dist/encoding.d.ts +192 -0
  68. package/node_modules/@arbidocs/coedit/dist/encoding.js +716 -0
  69. package/node_modules/@arbidocs/coedit/dist/encoding.js.map +1 -0
  70. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +1759 -0
  71. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -0
  72. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.cts +39 -0
  73. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.ts +39 -0
  74. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +1736 -0
  75. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -0
  76. package/node_modules/@arbidocs/coedit/dist/index.cjs +1692 -0
  77. package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -0
  78. package/node_modules/@arbidocs/coedit/dist/index.d.cts +16 -0
  79. package/node_modules/@arbidocs/coedit/dist/index.d.ts +16 -0
  80. package/node_modules/@arbidocs/coedit/dist/index.js +1664 -0
  81. package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -0
  82. package/node_modules/@arbidocs/coedit/dist/server.cjs +1852 -0
  83. package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -0
  84. package/node_modules/@arbidocs/coedit/dist/server.d.cts +43 -0
  85. package/node_modules/@arbidocs/coedit/dist/server.d.ts +43 -0
  86. package/node_modules/@arbidocs/coedit/dist/server.js +1822 -0
  87. package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -0
  88. package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.cts +82 -0
  89. package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.ts +82 -0
  90. package/node_modules/@arbidocs/coedit/dist/template.cjs +1627 -0
  91. package/node_modules/@arbidocs/coedit/dist/template.cjs.map +1 -0
  92. package/node_modules/@arbidocs/coedit/dist/template.d.cts +125 -0
  93. package/node_modules/@arbidocs/coedit/dist/template.d.ts +125 -0
  94. package/node_modules/@arbidocs/coedit/dist/template.js +1612 -0
  95. package/node_modules/@arbidocs/coedit/dist/template.js.map +1 -0
  96. package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.cts +8 -0
  97. package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.ts +8 -0
  98. package/node_modules/@arbidocs/coedit/package.json +68 -0
  99. package/node_modules/@docx-editor.dev/core/LICENSE +201 -0
  100. package/node_modules/@docx-editor.dev/core/README.md +125 -0
  101. package/node_modules/@docx-editor.dev/core/THIRD_PARTY_NOTICES.md +56 -0
  102. package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -0
  103. package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +162 -0
  104. package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -0
  105. package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -0
  106. package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +164 -0
  107. package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -0
  108. package/node_modules/@docx-editor.dev/core/dist/chunk-2GO5T2JU.cjs +1 -0
  109. package/node_modules/@docx-editor.dev/core/dist/chunk-2RC2EPND.js +3 -0
  110. package/node_modules/@docx-editor.dev/core/dist/chunk-4GBTELJV.cjs +28 -0
  111. package/node_modules/@docx-editor.dev/core/dist/chunk-4R3TEXMN.js +18 -0
  112. package/node_modules/@docx-editor.dev/core/dist/chunk-5CSUYANV.js +1 -0
  113. package/node_modules/@docx-editor.dev/core/dist/chunk-6APGXLBB.cjs +3 -0
  114. package/node_modules/@docx-editor.dev/core/dist/chunk-6AWEKBLB.cjs +1 -0
  115. package/node_modules/@docx-editor.dev/core/dist/chunk-6EYYL7FL.js +1 -0
  116. package/node_modules/@docx-editor.dev/core/dist/chunk-6JIJOZDW.js +1 -0
  117. package/node_modules/@docx-editor.dev/core/dist/chunk-BTQKU64Q.cjs +1 -0
  118. package/node_modules/@docx-editor.dev/core/dist/chunk-E7BQA6UP.js +2 -0
  119. package/node_modules/@docx-editor.dev/core/dist/chunk-EO4C5QJW.cjs +2 -0
  120. package/node_modules/@docx-editor.dev/core/dist/chunk-ETTO6GK3.js +1 -0
  121. package/node_modules/@docx-editor.dev/core/dist/chunk-FIJZIQXA.cjs +18 -0
  122. package/node_modules/@docx-editor.dev/core/dist/chunk-FRXAOVTB.js +28 -0
  123. package/node_modules/@docx-editor.dev/core/dist/chunk-J6BVWIDB.js +2 -0
  124. package/node_modules/@docx-editor.dev/core/dist/chunk-JGNVNT2A.cjs +2 -0
  125. package/node_modules/@docx-editor.dev/core/dist/chunk-K5U2PLDP.cjs +2 -0
  126. package/node_modules/@docx-editor.dev/core/dist/chunk-KKIJG3C6.js +2 -0
  127. package/node_modules/@docx-editor.dev/core/dist/chunk-LWDSDCMO.js +27 -0
  128. package/node_modules/@docx-editor.dev/core/dist/chunk-NBCVVZOM.cjs +1 -0
  129. package/node_modules/@docx-editor.dev/core/dist/chunk-O2AL2HSJ.cjs +1 -0
  130. package/node_modules/@docx-editor.dev/core/dist/chunk-O5INAWZQ.js +1 -0
  131. package/node_modules/@docx-editor.dev/core/dist/chunk-QMLCVPCD.cjs +1 -0
  132. package/node_modules/@docx-editor.dev/core/dist/chunk-RCHS4ZEH.cjs +27 -0
  133. package/node_modules/@docx-editor.dev/core/dist/chunk-RIYSCEFQ.js +2 -0
  134. package/node_modules/@docx-editor.dev/core/dist/chunk-S6J4O5XP.js +1 -0
  135. package/node_modules/@docx-editor.dev/core/dist/chunk-SRPILEWV.cjs +5 -0
  136. package/node_modules/@docx-editor.dev/core/dist/chunk-TSLBZ26X.js +1 -0
  137. package/node_modules/@docx-editor.dev/core/dist/chunk-UKVVUHZL.cjs +1 -0
  138. package/node_modules/@docx-editor.dev/core/dist/chunk-VDNNLG6X.js +2 -0
  139. package/node_modules/@docx-editor.dev/core/dist/chunk-VHAVHCQY.js +7 -0
  140. package/node_modules/@docx-editor.dev/core/dist/chunk-VX43VBAX.cjs +7 -0
  141. package/node_modules/@docx-editor.dev/core/dist/chunk-Z6WBFXJU.js +5 -0
  142. package/node_modules/@docx-editor.dev/core/dist/chunk-ZUHOMK52.cjs +2 -0
  143. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -0
  144. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +270 -0
  145. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -0
  146. package/node_modules/@docx-editor.dev/core/dist/collaboration.cjs +1 -0
  147. package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +269 -0
  148. package/node_modules/@docx-editor.dev/core/dist/collaboration.js +1 -0
  149. package/node_modules/@docx-editor.dev/core/dist/contracts/document.cjs +1 -0
  150. package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +290 -0
  151. package/node_modules/@docx-editor.dev/core/dist/contracts/document.js +0 -0
  152. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.cjs +1 -0
  153. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +22 -0
  154. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.js +1 -0
  155. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.cjs +1 -0
  156. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +103 -0
  157. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.js +0 -0
  158. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.cjs +1 -0
  159. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +143 -0
  160. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.js +1 -0
  161. package/node_modules/@docx-editor.dev/core/dist/contracts/types.cjs +1 -0
  162. package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +11 -0
  163. package/node_modules/@docx-editor.dev/core/dist/contracts/types.js +0 -0
  164. package/node_modules/@docx-editor.dev/core/dist/custom-node-writes-cvL5rhcD.d.ts +323 -0
  165. package/node_modules/@docx-editor.dev/core/dist/dist-PKZR6RSH.js +2 -0
  166. package/node_modules/@docx-editor.dev/core/dist/document-protection-BAGVGqaP.d.ts +20 -0
  167. package/node_modules/@docx-editor.dev/core/dist/editor-Ci7IZGmG.d.ts +2448 -0
  168. package/node_modules/@docx-editor.dev/core/dist/editor-scope-OHPwVQ5l.d.ts +84 -0
  169. package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -0
  170. package/node_modules/@docx-editor.dev/core/dist/editor.css +15 -0
  171. package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +1394 -0
  172. package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -0
  173. package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -0
  174. package/node_modules/@docx-editor.dev/core/dist/export.d.ts +391 -0
  175. package/node_modules/@docx-editor.dev/core/dist/export.js +2 -0
  176. package/node_modules/@docx-editor.dev/core/dist/failure-NS2lsya4.d.ts +115 -0
  177. package/node_modules/@docx-editor.dev/core/dist/font-resolver-BVQB14qT.d.ts +256 -0
  178. package/node_modules/@docx-editor.dev/core/dist/harfbuzz.wasm +0 -0
  179. package/node_modules/@docx-editor.dev/core/dist/headless-document-view-qH331moE.d.ts +143 -0
  180. package/node_modules/@docx-editor.dev/core/dist/image-resources-BN-hUgCn.d.ts +211 -0
  181. package/node_modules/@docx-editor.dev/core/dist/index-Bsg7oIKP.d.ts +3869 -0
  182. package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -0
  183. package/node_modules/@docx-editor.dev/core/dist/index.d.ts +53 -0
  184. package/node_modules/@docx-editor.dev/core/dist/index.js +1 -0
  185. package/node_modules/@docx-editor.dev/core/dist/layout-shaping-BEyuiQOk.d.ts +246 -0
  186. package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -0
  187. package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +3151 -0
  188. package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -0
  189. package/node_modules/@docx-editor.dev/core/dist/node-module-shim-TTKTT66I.js +1 -0
  190. package/node_modules/@docx-editor.dev/core/dist/note-properties-4Y9o6Gyk.d.ts +68 -0
  191. package/node_modules/@docx-editor.dev/core/dist/omml-equation-CuzBL5DD.d.ts +85 -0
  192. package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -0
  193. package/node_modules/@docx-editor.dev/core/dist/output.d.ts +97 -0
  194. package/node_modules/@docx-editor.dev/core/dist/output.js +1 -0
  195. package/node_modules/@docx-editor.dev/core/dist/protocol-Bqk4Izjc.d.ts +1651 -0
  196. package/node_modules/@docx-editor.dev/core/dist/review-pane-D9jm8DcY.d.ts +128 -0
  197. package/node_modules/@docx-editor.dev/core/dist/review-paragraph-order-DT-n6ouC.d.ts +85 -0
  198. package/node_modules/@docx-editor.dev/core/dist/revision-projection-DZ4kKVev.d.ts +242 -0
  199. package/node_modules/@docx-editor.dev/core/dist/semantic-cell-selection-D9D1KSXq.d.ts +464 -0
  200. package/node_modules/@docx-editor.dev/core/dist/semantic-interaction-CIC-PooQ.d.ts +135 -0
  201. package/node_modules/@docx-editor.dev/core/dist/semantic-paint-BME37OMv.d.ts +326 -0
  202. package/node_modules/@docx-editor.dev/core/dist/semantic-record-queries-CBlZqZNa.d.ts +177 -0
  203. package/node_modules/@docx-editor.dev/core/dist/semantic-records-4B3WwFAi.d.ts +3532 -0
  204. package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -0
  205. package/node_modules/@docx-editor.dev/core/dist/store.d.ts +2706 -0
  206. package/node_modules/@docx-editor.dev/core/dist/store.js +1 -0
  207. package/node_modules/@docx-editor.dev/core/dist/tree-package-fragment-BeeKxDw8.d.ts +1201 -0
  208. package/node_modules/@docx-editor.dev/core/dist/tree-session-contract-CVbmlMlq.d.ts +664 -0
  209. package/node_modules/@docx-editor.dev/core/dist/types-barrel-D3xCgQX6.d.ts +4269 -0
  210. package/node_modules/@docx-editor.dev/core/licenses/HarfBuzz-COPYING.txt +42 -0
  211. package/node_modules/@docx-editor.dev/core/package.json +140 -0
  212. package/node_modules/@docx-editor.dev/react/LICENSE +201 -0
  213. package/node_modules/@docx-editor.dev/react/README.md +141 -0
  214. package/node_modules/@docx-editor.dev/react/THIRD_PARTY_NOTICES.md +18 -0
  215. package/node_modules/@docx-editor.dev/react/dist/index.d.mts +4928 -0
  216. package/node_modules/@docx-editor.dev/react/dist/index.d.ts +4928 -0
  217. package/node_modules/@docx-editor.dev/react/dist/index.js +4 -0
  218. package/node_modules/@docx-editor.dev/react/dist/index.mjs +4 -0
  219. package/node_modules/@docx-editor.dev/react/package.json +74 -0
  220. package/node_modules/@docx-editor.dev/react/src/styles/editor.css +6 -0
  221. package/node_modules/@docx-editor.dev/react/src/styles/zIndex.ts +28 -0
  222. package/package.json +26 -15
  223. package/src/docx/README.md +2 -3
  224. package/dist/chunk-72PQ42YI.js.map +0 -1
  225. package/dist/chunk-B7P73VHX.cjs.map +0 -1
@@ -0,0 +1,211 @@
1
+ import { a0 as DrawingProjection, Q as OoxmlPackage } from './types-barrel-D3xCgQX6.js';
2
+
3
+ /** Opaque handle — bytes are reachable only through {@link mintValidatedImageBytes}. */
4
+ interface ValidatedImageBytesHandle {
5
+ readonly registryId: number;
6
+ readonly resourceKey: string;
7
+ readonly contentId: string;
8
+ readonly generation: number;
9
+ }
10
+
11
+ /**
12
+ * The engine's trust-boundary caps: recursion depth, element counts, and the rest.
13
+ *
14
+ * A caller may LOWER any of these but never raise or disable one — an override of `Infinity`,
15
+ * zero, a negative or `NaN` clamps into `(0, ceiling]` rather than turning the limit off. These
16
+ * are security ceilings, not performance budgets.
17
+ */
18
+ interface ResourceLimits {
19
+ /** Max nested-structure recursion (tables/shapes/SDT/groups). */
20
+ readonly maxRecursionDepth: number;
21
+ /** Max total parsed element count. */
22
+ readonly maxElementCount: number;
23
+ /** Max package part count. */
24
+ readonly maxPartCount: number;
25
+ /** Max total decompressed bytes (zip-bomb guard). */
26
+ readonly maxDecompressedBytes: number;
27
+ /** Max total compressed input bytes. */
28
+ readonly maxCompressedBytes: number;
29
+ /** Max decompressed:compressed ratio per entry. */
30
+ readonly maxCompressionRatio: number;
31
+ /** In-memory chunk budget for streaming/spooling. */
32
+ readonly maxChunkBytes: number;
33
+ /** Max pagination passes before non-convergence is declared. */
34
+ readonly maxPaginationPasses: number;
35
+ /** Max queued items in any bounded work queue. */
36
+ readonly maxQueueDepth: number;
37
+ }
38
+ /** Non-disableable hard ceilings: no resolved limit may exceed these. */
39
+ declare const HARD_CEILINGS: ResourceLimits;
40
+ /** Finite defaults, all <= their hard ceiling. */
41
+ declare const DEFAULT_LIMITS: ResourceLimits;
42
+ /**
43
+ * Resolve caller overrides into a frozen, always-finite limit set. Each value is
44
+ * `min(override>0 ? override : default, ceiling)`. Infinity/0/negative/NaN can
45
+ * never disable a limit — the hard ceiling always wins.
46
+ */
47
+ declare function resolveLimits(overrides?: Partial<ResourceLimits>): ResourceLimits;
48
+ /** Bounded image decode limits (typed-drawings-and-images task 4). */
49
+ /** Trust-boundary caps specific to image decoding and embedding. */
50
+ interface ImageResourceLimits {
51
+ readonly maxEncodedBytes: number;
52
+ readonly maxDecodedBytes: number;
53
+ readonly maxPixels: number;
54
+ readonly maxDimension: number;
55
+ readonly maxPolygonPoints: number;
56
+ readonly maxExternalRedirects: number;
57
+ }
58
+ /** Image caps nothing can raise past. A caller's override clamps into these. */
59
+ declare const IMAGE_RESOURCE_HARD_CEILINGS: ImageResourceLimits;
60
+ /** The image caps in force when a host configures none. Conservative and finite. */
61
+ declare const DEFAULT_IMAGE_RESOURCE_LIMITS: ImageResourceLimits;
62
+ /** Resolve caller overrides into frozen image limits; hard ceilings cannot be raised. */
63
+ declare function resolveImageResourceLimits(overrides?: Partial<ImageResourceLimits>): ImageResourceLimits;
64
+
65
+ /**
66
+ * Raster media the decode port measures and any authoring path may write.
67
+ *
68
+ * BMP and WebP are here for the same reason the other three are: an `<img>` decodes them
69
+ * natively, so they need a signature and a structural header and nothing else. BMP is what
70
+ * older documents carry; WebP is what current Word writes.
71
+ */
72
+ type SupportedImageMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/bmp' | 'image/webp';
73
+ /**
74
+ * Vector media painted straight from validated bytes. An `<img>` renders SVG in the
75
+ * browser's secure static mode — no script, no external subresource loads — so there is
76
+ * no decode step and no raster buffer sized by a file-supplied number.
77
+ */
78
+ type VectorImageMime = 'image/svg+xml';
79
+ /** Every mime the painter can hand to an `<img>`. */
80
+ type RenderableImageMime = SupportedImageMime | VectorImageMime;
81
+ /**
82
+ * Media kept in the package byte-for-byte that the painter cannot hand to an `<img>`.
83
+ * A decode port may rasterize it; without one it paints as a labelled placeholder.
84
+ */
85
+ type PreservedImageMime = 'image/tiff' | 'image/x-emf' | 'image/x-wmf';
86
+ /**
87
+ * What is known about one embedded image: validated, refused, or still decoding.
88
+ *
89
+ * Content type is a CLAIM. Signature sniffing, structural header validation and the decode port
90
+ * are authoritative, and bytes that fail them never enter public state.
91
+ */
92
+ type ImageResourceState = {
93
+ readonly kind: 'ready';
94
+ readonly partName: string;
95
+ readonly contentId: string;
96
+ readonly resourceKey: string;
97
+ readonly validatedHandle: ValidatedImageBytesHandle;
98
+ readonly mime: RenderableImageMime;
99
+ readonly pixelWidth: number;
100
+ readonly pixelHeight: number;
101
+ readonly dpiX: number;
102
+ readonly dpiY: number;
103
+ } | {
104
+ readonly kind: 'unrenderable';
105
+ readonly partName: string | null;
106
+ readonly mime: RenderableImageMime | PreservedImageMime | 'unknown';
107
+ readonly reason: 'unsupported-format' | 'non-picture-graphic' | 'signature-mismatch' | 'decode-failed' | 'resource-limit';
108
+ } | {
109
+ readonly kind: 'external';
110
+ readonly relationshipId: string;
111
+ readonly sinkSafe: boolean;
112
+ } | {
113
+ readonly kind: 'missing';
114
+ readonly relationshipId: string;
115
+ } | {
116
+ readonly kind: 'pending';
117
+ readonly resourceKey: string;
118
+ };
119
+ /**
120
+ * The injected image decoder.
121
+ *
122
+ * A port rather than a direct `Image`/`createImageBitmap` call, so a worker or server runtime
123
+ * supplies its own and the engine never reaches for a browser global.
124
+ */
125
+ interface ImageDecodePort {
126
+ decode(bytes: Uint8Array, mime: SupportedImageMime, limits: ImageResourceLimits,
127
+ /** Aborted when the owning lookup/session is disposed. */
128
+ signal?: AbortSignal): Promise<Readonly<{
129
+ pixelWidth: number;
130
+ pixelHeight: number;
131
+ dpiX: number;
132
+ dpiY: number;
133
+ }>>;
134
+ /**
135
+ * Optional conversion of media an `<img>` cannot render (EMF/WMF metafiles, TIFF) into a
136
+ * renderable raster. The returned bytes are untrusted and re-enter the full raster
137
+ * validation path (sniff, header, pixel caps, decode) before they can become a ready
138
+ * resource. A null return declines the format and keeps the labelled placeholder; so does
139
+ * a throw, as `decode-failed`.
140
+ */
141
+ convertPreserved?(bytes: Uint8Array, mime: PreservedImageMime, limits: ImageResourceLimits,
142
+ /** Aborted when the owning lookup/session is disposed. */
143
+ signal?: AbortSignal): Promise<Readonly<{
144
+ bytes: Uint8Array;
145
+ mime: SupportedImageMime;
146
+ }> | null>;
147
+ }
148
+ /** Resolves a relationship id to a validated image resource, or reports why it could not. */
149
+ interface ImageResourceLookup {
150
+ readonly resolveEmbedded: (ownerPartName: string, relationshipId: string) => Promise<ImageResourceState>;
151
+ readonly resolveLinked: (ownerPartName: string, relationshipId: string) => ImageResourceState;
152
+ readonly resolveForProjection: (projection: DrawingProjection) => Promise<ImageResourceState>;
153
+ readonly liveReferenceCount: (partName: string) => number;
154
+ readonly dispose: () => void;
155
+ }
156
+ /** Maximum prefix inspected for SVG root detection (exported for bounded-scan tests). */
157
+ declare const MAX_SVG_SNIFF_BYTES = 512;
158
+ /** A raster header that passed structural validation: its real MIME type and pixel extent. */
159
+ interface ValidatedRasterHeader {
160
+ readonly pixelWidth: number;
161
+ readonly pixelHeight: number;
162
+ /** Horizontal physical density when bounded header metadata supplies it. */
163
+ readonly dpiX?: number;
164
+ /** Vertical physical density when bounded header metadata supplies it. */
165
+ readonly dpiY?: number;
166
+ }
167
+ /** Bounded scan for an `<svg` document root (optional `<?xml` prolog only). */
168
+ declare function hasBoundedSvgRoot(bytes: Uint8Array): boolean;
169
+ /** Signature sniffing — authoritative over declared content type. */
170
+ declare function sniffImageMime(bytes: Uint8Array): RenderableImageMime | PreservedImageMime | 'unknown';
171
+ /** Structural PNG IHDR validation before decode. */
172
+ declare function validatePngHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
173
+ /** Structural GIF logical screen descriptor validation before decode. */
174
+ declare function validateGifHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
175
+ /** Bounded JPEG marker scan through the first supported SOF marker. */
176
+ declare function validateJpegHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
177
+ /**
178
+ * Intrinsic size of an SVG, resolved the way a browser sizes one: absolute `width`/`height`
179
+ * first, then `viewBox` for the missing axis or ratio, then the CSS 300x150 default.
180
+ *
181
+ * This is metadata for insert and reset-to-natural-size only. Layout uses the authored
182
+ * `wp:extent` and the browser rasterizes into that box, so nothing here sizes an allocation
183
+ * and an out-of-range value is clamped rather than refused.
184
+ */
185
+ declare function resolveSvgIntrinsicSize(bytes: Uint8Array, limits: ImageResourceLimits): ValidatedRasterHeader | null;
186
+ /**
187
+ * Validate a raster image's header structurally and report its real MIME type and extent.
188
+ *
189
+ * Content type is a CLAIM; this is what makes it a fact. A file declaring `image/png` over JPEG
190
+ * bytes is caught here rather than at decode.
191
+ */
192
+ declare function validateRasterHeader(bytes: Uint8Array, mime: SupportedImageMime): ValidatedRasterHeader | null;
193
+ /** Package-wide live drawing references to a media part name. */
194
+ declare function liveDrawingReferenceCount(pkg: OoxmlPackage, partName: string): number;
195
+ /** How the image cache decodes, and what it will spend doing so. */
196
+ interface CreateImageResourceCacheOptions {
197
+ readonly limits?: Partial<ImageResourceLimits>;
198
+ readonly decodePort: ImageDecodePort;
199
+ }
200
+ /**
201
+ * Derived cache for one immutable package snapshot. Registry identity is
202
+ * `(package snapshot, decodePort object, normalized limits)` — the first caller
203
+ * never imposes its decoder or limits on later callers with different options.
204
+ */
205
+ declare function imageResourceLookupFor(pkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
206
+ /** @deprecated Prefer {@link imageResourceLookupFor} — registry binds cache to package identity. */
207
+ /** Build the per-document image cache. Validated bytes only; refusals are remembered too. */
208
+ declare function createImageResourceCache(initialPkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
209
+
210
+ export { DEFAULT_IMAGE_RESOURCE_LIMITS as D, HARD_CEILINGS as H, MAX_SVG_SNIFF_BYTES as M, resolveSvgIntrinsicSize as d, DEFAULT_LIMITS as f, IMAGE_RESOURCE_HARD_CEILINGS as g, createImageResourceCache as j, hasBoundedSvgRoot as k, imageResourceLookupFor as l, liveDrawingReferenceCount as m, resolveLimits as n, validateGifHeader as o, validateJpegHeader as p, validatePngHeader as q, resolveImageResourceLimits as r, sniffImageMime as s, validateRasterHeader as v };
211
+ export type { CreateImageResourceCacheOptions as C, ImageResourceLimits as I, PreservedImageMime as P, RenderableImageMime as R, SupportedImageMime as S, ValidatedImageBytesHandle as V, ImageDecodePort as a, ImageResourceState as b, VectorImageMime as c, ResourceLimits as e, ImageResourceLookup as h, ValidatedRasterHeader as i };