ooxml-core 0.9.0 → 0.10.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 (286) hide show
  1. package/README.md +14 -13
  2. package/dist/crypto/aes-ecb.d.ts +13 -0
  3. package/dist/crypto/aes-ecb.d.ts.map +1 -0
  4. package/dist/crypto/decrypt.d.ts +63 -0
  5. package/dist/crypto/decrypt.d.ts.map +1 -0
  6. package/dist/crypto/detect.d.ts +56 -0
  7. package/dist/crypto/detect.d.ts.map +1 -0
  8. package/dist/crypto/encrypt.d.ts +27 -0
  9. package/dist/crypto/encrypt.d.ts.map +1 -0
  10. package/dist/crypto/encryption-info-write.d.ts +46 -0
  11. package/dist/crypto/encryption-info-write.d.ts.map +1 -0
  12. package/dist/crypto/encryption-info.d.ts +22 -0
  13. package/dist/crypto/encryption-info.d.ts.map +1 -0
  14. package/dist/crypto/errors.d.ts +39 -0
  15. package/dist/crypto/errors.d.ts.map +1 -0
  16. package/dist/crypto/index.cjs +1805 -0
  17. package/dist/crypto/index.d.ts +26 -0
  18. package/dist/crypto/index.d.ts.map +1 -0
  19. package/dist/crypto/index.mjs +1774 -0
  20. package/dist/crypto/key-derivation.d.ts +73 -0
  21. package/dist/crypto/key-derivation.d.ts.map +1 -0
  22. package/dist/crypto/types.d.ts +104 -0
  23. package/dist/crypto/types.d.ts.map +1 -0
  24. package/dist/docx/embedded.cjs +2 -0
  25. package/dist/docx/embedded.mjs +2 -0
  26. package/dist/docx/index.cjs +2 -0
  27. package/dist/docx/index.mjs +2 -0
  28. package/dist/docx/load/detect.d.ts +14 -2
  29. package/dist/docx/load/detect.d.ts.map +1 -1
  30. package/dist/docx/load/index.cjs +8995 -7728
  31. package/dist/docx/load/index.d.ts +3 -1
  32. package/dist/docx/load/index.d.ts.map +1 -1
  33. package/dist/docx/load/index.mjs +8990 -7729
  34. package/dist/docx/load/legacy-doc.d.ts.map +1 -1
  35. package/dist/index.cjs +749 -19
  36. package/dist/index.mjs +749 -19
  37. package/dist/opc/index.cjs +797 -1
  38. package/dist/opc/index.d.ts +2 -0
  39. package/dist/opc/index.d.ts.map +1 -1
  40. package/dist/opc/index.mjs +784 -3
  41. package/dist/opc/properties/app.d.ts +10 -0
  42. package/dist/opc/properties/app.d.ts.map +1 -0
  43. package/dist/opc/properties/core.d.ts +13 -0
  44. package/dist/opc/properties/core.d.ts.map +1 -0
  45. package/dist/opc/properties/custom.d.ts +15 -0
  46. package/dist/opc/properties/custom.d.ts.map +1 -0
  47. package/dist/opc/properties/index.d.ts +5 -0
  48. package/dist/opc/properties/index.d.ts.map +1 -0
  49. package/dist/opc/properties/types.d.ts +114 -0
  50. package/dist/opc/properties/types.d.ts.map +1 -0
  51. package/dist/opc/relationship-types.d.ts +1 -0
  52. package/dist/opc/relationship-types.d.ts.map +1 -1
  53. package/dist/opc/safe-href.d.ts +34 -0
  54. package/dist/opc/safe-href.d.ts.map +1 -1
  55. package/dist/opc/signature/constants.d.ts +42 -0
  56. package/dist/opc/signature/constants.d.ts.map +1 -0
  57. package/dist/opc/signature/detection.d.ts +97 -0
  58. package/dist/opc/signature/detection.d.ts.map +1 -0
  59. package/dist/opc/signature/digest.d.ts +16 -0
  60. package/dist/opc/signature/digest.d.ts.map +1 -0
  61. package/dist/opc/signature/index.d.ts +8 -0
  62. package/dist/opc/signature/index.d.ts.map +1 -0
  63. package/dist/opc/signature/inspection-status.d.ts +24 -0
  64. package/dist/opc/signature/inspection-status.d.ts.map +1 -0
  65. package/dist/opc/signature/reference-utils.d.ts +12 -0
  66. package/dist/opc/signature/reference-utils.d.ts.map +1 -0
  67. package/dist/opc/signature/types.d.ts +90 -0
  68. package/dist/opc/signature/types.d.ts.map +1 -0
  69. package/dist/opc/signature/xml-utils.d.ts +35 -0
  70. package/dist/opc/signature/xml-utils.d.ts.map +1 -0
  71. package/dist/pptx/chunks/{index-CojJtI77.d.ts → index-BWUBPGgv.d.ts} +9 -11
  72. package/dist/pptx/chunks/index-BWUBPGgv.d.ts.map +1 -0
  73. package/dist/pptx/chunks/{signature-inspection-status-Bh2oap7B.d.ts → inspection-status-B2E-jSpG.d.ts} +8 -8
  74. package/dist/pptx/chunks/inspection-status-B2E-jSpG.d.ts.map +1 -0
  75. package/dist/pptx/cli/index.cjs +1409 -895
  76. package/dist/pptx/cli/index.mjs +1409 -895
  77. package/dist/pptx/converter/index.d.ts +1 -1
  78. package/dist/pptx/index.cjs +1933 -1391
  79. package/dist/pptx/index.d.ts +20 -67
  80. package/dist/pptx/index.d.ts.map +1 -1
  81. package/dist/pptx/index.mjs +1933 -1391
  82. package/dist/pptx/signature-node/index.cjs +5 -5
  83. package/dist/pptx/signature-node/index.d.ts +1 -1
  84. package/dist/pptx/signature-node/index.mjs +5 -5
  85. package/dist/visio/edit-master-index.d.ts +10 -0
  86. package/dist/visio/edit-master-index.d.ts.map +1 -0
  87. package/dist/visio/edit-master-scope.d.ts +7 -0
  88. package/dist/visio/edit-master-scope.d.ts.map +1 -0
  89. package/dist/visio/edit-scope.d.ts.map +1 -1
  90. package/dist/visio/formula-arithmetic.d.ts +8 -0
  91. package/dist/visio/formula-arithmetic.d.ts.map +1 -0
  92. package/dist/visio/formula-evaluate.d.ts.map +1 -1
  93. package/dist/visio/formula-master.d.ts +13 -0
  94. package/dist/visio/formula-master.d.ts.map +1 -0
  95. package/dist/visio/formula-numeric-functions.d.ts +8 -0
  96. package/dist/visio/formula-numeric-functions.d.ts.map +1 -0
  97. package/dist/visio/formula.d.ts +1 -1
  98. package/dist/visio/formula.d.ts.map +1 -1
  99. package/dist/visio/index.cjs +540 -61
  100. package/dist/visio/index.mjs +540 -61
  101. package/dist/xlsx/edit/annotations.d.ts +5 -1
  102. package/dist/xlsx/edit/annotations.d.ts.map +1 -1
  103. package/dist/xlsx/edit/cell-values.d.ts +7 -2
  104. package/dist/xlsx/edit/cell-values.d.ts.map +1 -1
  105. package/dist/xlsx/edit/clipboard.d.ts.map +1 -1
  106. package/dist/xlsx/edit/doc-properties.d.ts +14 -0
  107. package/dist/xlsx/edit/doc-properties.d.ts.map +1 -0
  108. package/dist/xlsx/edit/fill-series.d.ts.map +1 -1
  109. package/dist/xlsx/edit/find.d.ts +2 -1
  110. package/dist/xlsx/edit/find.d.ts.map +1 -1
  111. package/dist/xlsx/edit/format-lines.d.ts +22 -0
  112. package/dist/xlsx/edit/format-lines.d.ts.map +1 -0
  113. package/dist/xlsx/edit/format.d.ts +2 -1
  114. package/dist/xlsx/edit/format.d.ts.map +1 -1
  115. package/dist/xlsx/edit/history-refs.d.ts +51 -0
  116. package/dist/xlsx/edit/history-refs.d.ts.map +1 -0
  117. package/dist/xlsx/edit/history.d.ts +40 -5
  118. package/dist/xlsx/edit/history.d.ts.map +1 -1
  119. package/dist/xlsx/edit/index.d.ts +3 -0
  120. package/dist/xlsx/edit/index.d.ts.map +1 -1
  121. package/dist/xlsx/edit/input-text.d.ts +13 -0
  122. package/dist/xlsx/edit/input-text.d.ts.map +1 -0
  123. package/dist/xlsx/edit/merge.d.ts +10 -2
  124. package/dist/xlsx/edit/merge.d.ts.map +1 -1
  125. package/dist/xlsx/edit/session.d.ts.map +1 -1
  126. package/dist/xlsx/edit/sheets.d.ts.map +1 -1
  127. package/dist/xlsx/edit/shift-formulas.d.ts +2 -1
  128. package/dist/xlsx/edit/shift-formulas.d.ts.map +1 -1
  129. package/dist/xlsx/edit/shift-preserved.d.ts +17 -0
  130. package/dist/xlsx/edit/shift-preserved.d.ts.map +1 -0
  131. package/dist/xlsx/edit/shift-sheet.d.ts +2 -2
  132. package/dist/xlsx/edit/shift-sheet.d.ts.map +1 -1
  133. package/dist/xlsx/edit/structure.d.ts.map +1 -1
  134. package/dist/xlsx/edit/types.d.ts +7 -0
  135. package/dist/xlsx/edit/types.d.ts.map +1 -1
  136. package/dist/xlsx/edit/validation-list.d.ts +24 -0
  137. package/dist/xlsx/edit/validation-list.d.ts.map +1 -0
  138. package/dist/xlsx/edit/validation.d.ts +2 -1
  139. package/dist/xlsx/edit/validation.d.ts.map +1 -1
  140. package/dist/xlsx/formula/area-index.d.ts +18 -0
  141. package/dist/xlsx/formula/area-index.d.ts.map +1 -0
  142. package/dist/xlsx/formula/array-context.d.ts.map +1 -1
  143. package/dist/xlsx/formula/ast.d.ts +5 -1
  144. package/dist/xlsx/formula/ast.d.ts.map +1 -1
  145. package/dist/xlsx/formula/call.d.ts.map +1 -1
  146. package/dist/xlsx/formula/coerce.d.ts.map +1 -1
  147. package/dist/xlsx/formula/context.d.ts +5 -0
  148. package/dist/xlsx/formula/context.d.ts.map +1 -1
  149. package/dist/xlsx/formula/date-serial.d.ts +11 -4
  150. package/dist/xlsx/formula/date-serial.d.ts.map +1 -1
  151. package/dist/xlsx/formula/engine-core.d.ts +6 -0
  152. package/dist/xlsx/formula/engine-core.d.ts.map +1 -1
  153. package/dist/xlsx/formula/engine-host.d.ts +35 -3
  154. package/dist/xlsx/formula/engine-host.d.ts.map +1 -1
  155. package/dist/xlsx/formula/engine-util.d.ts.map +1 -1
  156. package/dist/xlsx/formula/engine.d.ts.map +1 -1
  157. package/dist/xlsx/formula/evaluator.d.ts.map +1 -1
  158. package/dist/xlsx/formula/functions/array-shape.d.ts.map +1 -1
  159. package/dist/xlsx/formula/functions/array.d.ts.map +1 -1
  160. package/dist/xlsx/formula/functions/criteria-index.d.ts +12 -0
  161. package/dist/xlsx/formula/functions/criteria-index.d.ts.map +1 -0
  162. package/dist/xlsx/formula/functions/criteria.d.ts +24 -16
  163. package/dist/xlsx/formula/functions/criteria.d.ts.map +1 -1
  164. package/dist/xlsx/formula/functions/date-calc.d.ts +4 -0
  165. package/dist/xlsx/formula/functions/date-calc.d.ts.map +1 -1
  166. package/dist/xlsx/formula/functions/depreciation.d.ts.map +1 -1
  167. package/dist/xlsx/formula/functions/financial.d.ts.map +1 -1
  168. package/dist/xlsx/formula/functions/helpers.d.ts.map +1 -1
  169. package/dist/xlsx/formula/functions/logical.d.ts.map +1 -1
  170. package/dist/xlsx/formula/functions/lookup-core.d.ts +14 -2
  171. package/dist/xlsx/formula/functions/lookup-core.d.ts.map +1 -1
  172. package/dist/xlsx/formula/functions/lookup.d.ts.map +1 -1
  173. package/dist/xlsx/formula/functions/math-mod.d.ts +8 -0
  174. package/dist/xlsx/formula/functions/math-mod.d.ts.map +1 -0
  175. package/dist/xlsx/formula/functions/math-sum.d.ts.map +1 -1
  176. package/dist/xlsx/formula/functions/math.d.ts.map +1 -1
  177. package/dist/xlsx/formula/functions/statistical-count.d.ts.map +1 -1
  178. package/dist/xlsx/formula/functions/statistical.d.ts.map +1 -1
  179. package/dist/xlsx/formula/functions/stats-core.d.ts +6 -0
  180. package/dist/xlsx/formula/functions/stats-core.d.ts.map +1 -1
  181. package/dist/xlsx/formula/functions/text-case.d.ts +14 -0
  182. package/dist/xlsx/formula/functions/text-case.d.ts.map +1 -0
  183. package/dist/xlsx/formula/functions/text.d.ts.map +1 -1
  184. package/dist/xlsx/formula/functions/workdays.d.ts.map +1 -1
  185. package/dist/xlsx/formula/graph-index.d.ts +15 -0
  186. package/dist/xlsx/formula/graph-index.d.ts.map +1 -0
  187. package/dist/xlsx/formula/graph.d.ts +13 -18
  188. package/dist/xlsx/formula/graph.d.ts.map +1 -1
  189. package/dist/xlsx/formula/operators.d.ts +9 -0
  190. package/dist/xlsx/formula/operators.d.ts.map +1 -1
  191. package/dist/xlsx/formula/parser.d.ts +2 -0
  192. package/dist/xlsx/formula/parser.d.ts.map +1 -1
  193. package/dist/xlsx/formula/references.d.ts +4 -1
  194. package/dist/xlsx/formula/references.d.ts.map +1 -1
  195. package/dist/xlsx/formula/text-number.d.ts.map +1 -1
  196. package/dist/xlsx/formula/transform.d.ts.map +1 -1
  197. package/dist/xlsx/formula/values.d.ts +44 -3
  198. package/dist/xlsx/formula/values.d.ts.map +1 -1
  199. package/dist/xlsx/index.cjs +4698 -1322
  200. package/dist/xlsx/index.mjs +4688 -1323
  201. package/dist/xlsx/layout/anchors.d.ts +47 -0
  202. package/dist/xlsx/layout/anchors.d.ts.map +1 -0
  203. package/dist/xlsx/layout/cf-evaluator.d.ts +1 -2
  204. package/dist/xlsx/layout/cf-evaluator.d.ts.map +1 -1
  205. package/dist/xlsx/layout/cf-helpers.d.ts +8 -1
  206. package/dist/xlsx/layout/cf-helpers.d.ts.map +1 -1
  207. package/dist/xlsx/layout/index.d.ts +1 -0
  208. package/dist/xlsx/layout/index.d.ts.map +1 -1
  209. package/dist/xlsx/load/csv.d.ts +24 -3
  210. package/dist/xlsx/load/csv.d.ts.map +1 -1
  211. package/dist/xlsx/load/detect.d.ts +39 -7
  212. package/dist/xlsx/load/detect.d.ts.map +1 -1
  213. package/dist/xlsx/load/errors.d.ts +10 -0
  214. package/dist/xlsx/load/errors.d.ts.map +1 -0
  215. package/dist/xlsx/load/index.cjs +16220 -12163
  216. package/dist/xlsx/load/index.d.ts +5 -2
  217. package/dist/xlsx/load/index.d.ts.map +1 -1
  218. package/dist/xlsx/load/index.mjs +16213 -12164
  219. package/dist/xlsx/load/text-decode.d.ts +7 -0
  220. package/dist/xlsx/load/text-decode.d.ts.map +1 -0
  221. package/dist/xlsx/model.d.ts +121 -17
  222. package/dist/xlsx/model.d.ts.map +1 -1
  223. package/dist/xlsx/numfmt/date.d.ts +7 -0
  224. package/dist/xlsx/numfmt/date.d.ts.map +1 -1
  225. package/dist/xlsx/numfmt/format.d.ts.map +1 -1
  226. package/dist/xlsx/numfmt/fraction.d.ts +5 -1
  227. package/dist/xlsx/numfmt/fraction.d.ts.map +1 -1
  228. package/dist/xlsx/numfmt/input-date.d.ts.map +1 -1
  229. package/dist/xlsx/numfmt/input.d.ts.map +1 -1
  230. package/dist/xlsx/numfmt/number.d.ts.map +1 -1
  231. package/dist/xlsx/read/conditional.d.ts.map +1 -1
  232. package/dist/xlsx/read/drawing.d.ts +2 -2
  233. package/dist/xlsx/read/drawing.d.ts.map +1 -1
  234. package/dist/xlsx/read/load.d.ts.map +1 -1
  235. package/dist/xlsx/read/package.d.ts +18 -2
  236. package/dist/xlsx/read/package.d.ts.map +1 -1
  237. package/dist/xlsx/read/sheet-data.d.ts.map +1 -1
  238. package/dist/xlsx/read/sheet-props.d.ts +15 -1
  239. package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
  240. package/dist/xlsx/read/smart-art.d.ts +12 -0
  241. package/dist/xlsx/read/smart-art.d.ts.map +1 -0
  242. package/dist/xlsx/read/styles.d.ts.map +1 -1
  243. package/dist/xlsx/read/workbook-part.d.ts +5 -2
  244. package/dist/xlsx/read/workbook-part.d.ts.map +1 -1
  245. package/dist/xlsx/read/worksheet.d.ts.map +1 -1
  246. package/dist/xlsx/write/attr-merge.d.ts +10 -0
  247. package/dist/xlsx/write/attr-merge.d.ts.map +1 -0
  248. package/dist/xlsx/write/carried-refs.d.ts +61 -0
  249. package/dist/xlsx/write/carried-refs.d.ts.map +1 -0
  250. package/dist/xlsx/write/comments.d.ts +12 -2
  251. package/dist/xlsx/write/comments.d.ts.map +1 -1
  252. package/dist/xlsx/write/conditional.d.ts.map +1 -1
  253. package/dist/xlsx/write/doc-props.d.ts +30 -0
  254. package/dist/xlsx/write/doc-props.d.ts.map +1 -0
  255. package/dist/xlsx/write/drawing.d.ts +5 -0
  256. package/dist/xlsx/write/drawing.d.ts.map +1 -1
  257. package/dist/xlsx/write/metadata.d.ts +23 -0
  258. package/dist/xlsx/write/metadata.d.ts.map +1 -0
  259. package/dist/xlsx/write/package-writer.d.ts +6 -0
  260. package/dist/xlsx/write/package-writer.d.ts.map +1 -1
  261. package/dist/xlsx/write/page-setup.d.ts +8 -0
  262. package/dist/xlsx/write/page-setup.d.ts.map +1 -0
  263. package/dist/xlsx/write/save.d.ts.map +1 -1
  264. package/dist/xlsx/write/sheet-data.d.ts +8 -0
  265. package/dist/xlsx/write/sheet-data.d.ts.map +1 -1
  266. package/dist/xlsx/write/sheet-parts.d.ts +6 -0
  267. package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
  268. package/dist/xlsx/write/sheet-props.d.ts +0 -6
  269. package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
  270. package/dist/xlsx/write/styles.d.ts.map +1 -1
  271. package/dist/xlsx/write/table-patch.d.ts +12 -0
  272. package/dist/xlsx/write/table-patch.d.ts.map +1 -0
  273. package/dist/xlsx/write/tables.d.ts +9 -0
  274. package/dist/xlsx/write/tables.d.ts.map +1 -1
  275. package/dist/xlsx/write/vml-ids.d.ts +29 -0
  276. package/dist/xlsx/write/vml-ids.d.ts.map +1 -0
  277. package/dist/xlsx/write/workbook-part.d.ts +1 -4
  278. package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
  279. package/dist/xlsx/write/worksheet.d.ts.map +1 -1
  280. package/dist/xml/index.cjs +4 -0
  281. package/dist/xml/index.mjs +4 -0
  282. package/dist/xml/namespaces.d.ts +4 -0
  283. package/dist/xml/namespaces.d.ts.map +1 -1
  284. package/package.json +6 -1
  285. package/dist/pptx/chunks/index-CojJtI77.d.ts.map +0 -1
  286. package/dist/pptx/chunks/signature-inspection-status-Bh2oap7B.d.ts.map +0 -1
package/README.md CHANGED
@@ -35,19 +35,20 @@ import { parseXml } from 'ooxml-core/xml'; // one area
35
35
  import { xml, opc } from 'ooxml-core'; // or by namespace (shared building blocks)
36
36
  ```
37
37
 
38
- | Area | What it is |
39
- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
40
- | `xml` | The shared XML model: strict DOM parsing and serialization, namespaces, namespace-aware helpers. |
41
- | `opc` | Open Packaging Conventions: relationships, content types, part paths, zip helpers, safe hyperlinks. |
42
- | `units` | Branded EMU, twip and point types, constants and conversions. |
43
- | `color` | Hex, RGB, HSL and linear colour primitives, OOXML percent and angle parsing. |
44
- | `geometry` | DrawingML preset shapes, connection sites, clip paths, callouts and boolean shape operations. |
45
- | `diagram` | SmartArt (DiagramML), format-neutral: data model, layout/colour/quick-style parts, the cached `dsp:drawing` shape tree, relationship resolution and a loader. Used by `docx`; `pptx` re-imports its parsers. |
46
- | `digest` | Synchronous pure-TypeScript SHA-1, SHA-256, SHA-384 and SHA-512, ECMA-376 digest name normalisation (`SHA-512`, `SHA512`, `sha_512`, ...) and the agile password hash Office protection elements store (`hashPassword`, `verifyPasswordHash`). No Web Crypto, so it works on `http://`. Used by `xlsx` sheet and workbook protection. |
47
- | `collab` | Format-neutral real-time collaboration on Yjs: session and provider lifecycle, awareness/presence, transport-neutral sync (WebSocket, in-memory, any byte channel), update codecs, ordering helpers, asset sync and the product adapter seam. See `docs/collab-area.md`. |
48
- | `docx` | WordprocessingML: model, parser, preserving serializer, editing, validation. Also `/docx/embedded`. `/docx/layout` is the DOM-free pagination engine (an approximation of Word, not parity) and `/docx/load` detects and loads DOCX and legacy .doc (ole2 inlined). |
49
- | `pptx` | PresentationML: model, parser, serializer, editing, charts, SmartArt, converters, CLI, signatures. Subpaths `/pptx/converter`, `/pptx/cli`, `/pptx/signature-node`. |
50
- | `xlsx` | SpreadsheetML: workbook model, `.xlsx`/`.xlsm` reader and preserving writer, formula engine (dependency graph, dynamic arrays, 380+ functions), Excel number formats, editing commands with undo, and the DOM-free grid layout (sizes, colours, conditional formats, charts as SVG). `/xlsx/load` detects and loads `.xlsx`, `.xlsm`, legacy `.xls` (ole2 inlined) and CSV. An approximation of Excel, not parity. |
38
+ | Area | What it is |
39
+ | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
+ | `xml` | The shared XML model: strict DOM parsing and serialization, namespaces, namespace-aware helpers. |
41
+ | `opc` | Open Packaging Conventions: relationships, content types, part paths, zip helpers, the hyperlink safety policy (`hyperlinkPolicy`) and document properties (core, app and custom, `opc/properties`) and digital signatures (`signature`: detection, the parts a writer strips, XML-DSig parsing and digest checks; the Node verifier is `/pptx/signature-node`). |
42
+ | `units` | Branded EMU, twip and point types, constants and conversions. |
43
+ | `color` | Hex, RGB, HSL and linear colour primitives, OOXML percent and angle parsing. |
44
+ | `geometry` | DrawingML preset shapes, connection sites, clip paths, callouts and boolean shape operations. |
45
+ | `diagram` | SmartArt (DiagramML), format-neutral: data model, layout/colour/quick-style parts, the cached `dsp:drawing` shape tree, relationship resolution and a loader. Used by `docx`; `pptx` re-imports its parsers. |
46
+ | `digest` | Synchronous pure-TypeScript SHA-1, SHA-256, SHA-384 and SHA-512, ECMA-376 digest name normalisation (`SHA-512`, `SHA512`, `sha_512`, ...) and the agile password hash Office protection elements store (`hashPassword`, `verifyPasswordHash`). No Web Crypto, so it works on `http://`. Used by `xlsx` sheet and workbook protection. |
47
+ | `crypto` | ECMA-376 package encryption ([MS-OFFCRYPTO]) for every format: `decryptOoxmlPackage`, `encryptOoxmlPackage` (agile AES-256/SHA-512 by default, or Standard), `isEncryptedOoxmlPackage`, and typed errors with a `code` (`password-required`, `incorrect-password`, `data-integrity`). The compound-file container comes from ole2 (inlined); not in the root entry. |
48
+ | `collab` | Format-neutral real-time collaboration on Yjs: session and provider lifecycle, awareness/presence, transport-neutral sync (WebSocket, in-memory, any byte channel), update codecs, ordering helpers, asset sync and the product adapter seam. See `docs/collab-area.md`. |
49
+ | `docx` | WordprocessingML: model, parser, preserving serializer, editing, validation. Also `/docx/embedded`. `/docx/layout` is the DOM-free pagination engine (an approximation of Word, not parity) and `/docx/load` detects and loads DOCX (also password-protected, `{ password }`) and legacy .doc (ole2 inlined). |
50
+ | `pptx` | PresentationML: model, parser, serializer, editing, charts, SmartArt, converters, CLI, signatures. Subpaths `/pptx/converter`, `/pptx/cli`, `/pptx/signature-node`. |
51
+ | `xlsx` | SpreadsheetML: workbook model, `.xlsx`/`.xlsm` reader and preserving writer, formula engine (dependency graph, dynamic arrays, 380+ functions), Excel number formats, editing commands with undo, and the DOM-free grid layout (sizes, colours, conditional formats, charts as SVG, drawing anchors). SmartArt is shown from the cached drawing (not re-laid out) and kept verbatim on save. `/xlsx/load` detects and loads `.xlsx`, `.xlsm` (also password-protected: `loadWorkbook(bytes, { password })`, `saveWorkbook(workbook, 'xlsx', { password })`), legacy `.xls` (ole2 inlined) and CSV, and refuses `.xlsb` with a typed error. Digital signatures are detected and reported, never kept on save. An approximation of Excel, not parity. |
51
52
 
52
53
  Legacy binary formats (`.doc`, `.xls`, `.ppt`) and the compound-file container live in the sibling package [`ole2`](https://github.com/ChristopherVR/ole2); this package never contains binary codecs, and `ole2` never contains modern OOXML.
53
54
 
@@ -0,0 +1,13 @@
1
+ /**
2
+ * AES-ECB over Web Crypto, which only offers CBC: the ECMA-376 Standard scheme ([MS-OFFCRYPTO]
3
+ * 2.3.4.7-2.3.4.9) encrypts the password verifier and the package with AES in ECB mode.
4
+ *
5
+ * Decryption runs one CBC pass with a zero IV and then undoes the chaining (block i was XORed
6
+ * with ciphertext block i - 1). Encryption encrypts each block on its own (CBC with a zero IV over
7
+ * one block is ECB), in parallel batches.
8
+ */
9
+ /** AES-ECB decryption of block-aligned `data` (a trailing partial block is zero-padded). */
10
+ export declare function aesEcbDecrypt(key: Uint8Array, data: Uint8Array): Promise<Uint8Array>;
11
+ /** AES-ECB encryption of `data`, zero-padded to the block size. */
12
+ export declare function aesEcbEncrypt(key: Uint8Array, data: Uint8Array): Promise<Uint8Array>;
13
+ //# sourceMappingURL=aes-ecb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aes-ecb.d.ts","sourceRoot":"","sources":["../../src/crypto/aes-ecb.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,4FAA4F;AAC5F,wBAAsB,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAM1F;AAED,mEAAmE;AACnE,wBAAsB,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAwB1F"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * OOXML package decryption: password verification and package decryption for the agile
3
+ * (Office 2010+) and Standard (Office 2007) encryption schemes.
4
+ *
5
+ * Moved from `src/pptx/core/utils/ooxml-crypto-decrypt.ts` (see PROVENANCE.md).
6
+ */
7
+ import type { EncryptionInfo, StandardEncryptionInfo } from './types.js';
8
+ /**
9
+ * Verify the password against agile encryption info and return the
10
+ * decryption key if valid.
11
+ *
12
+ * @param info - Parsed agile encryption info.
13
+ * @param password - The password to verify.
14
+ * @returns The document encryption key, or null if the password is wrong.
15
+ */
16
+ export declare function verifyAgilePassword(info: EncryptionInfo, password: string): Promise<Uint8Array | null>;
17
+ /**
18
+ * Verify the password against standard encryption info and return the
19
+ * decryption key if valid.
20
+ *
21
+ * @param info - Parsed standard encryption info.
22
+ * @param password - The password to verify.
23
+ * @returns The encryption key, or null if the password is wrong.
24
+ */
25
+ export declare function verifyStandardPassword(info: StandardEncryptionInfo, password: string): Promise<Uint8Array | null>;
26
+ /**
27
+ * Verify the data integrity HMAC of an agile-encrypted package.
28
+ *
29
+ * [MS-OFFCRYPTO] 2.3.7.1 -- The data integrity is verified by:
30
+ * 1. Decrypting the HMAC key from dataIntegrity.encryptedHmacKey
31
+ * 2. Decrypting the HMAC value from dataIntegrity.encryptedHmacValue
32
+ * 3. Computing HMAC of the encrypted package data (after the 8-byte size prefix)
33
+ * 4. Comparing the computed HMAC with the decrypted HMAC value
34
+ *
35
+ * @param info - Parsed agile encryption info.
36
+ * @param key - The document encryption key.
37
+ * @param encryptedPackage - Raw bytes of the EncryptedPackage stream.
38
+ * @throws DataIntegrityError if the data integrity check fails.
39
+ */
40
+ export declare function verifyAgileDataIntegrity(info: EncryptionInfo, key: Uint8Array, encryptedPackage: Uint8Array): Promise<void>;
41
+ /**
42
+ * Decrypt the EncryptedPackage stream using the agile encryption key.
43
+ *
44
+ * The encrypted package uses segment-based encryption:
45
+ * each 4096-byte segment is encrypted separately with a unique IV.
46
+ *
47
+ * @param encryptedPackage - Raw bytes of the EncryptedPackage stream.
48
+ * @param key - The document encryption key.
49
+ * @param info - Parsed agile encryption info.
50
+ * @returns The decrypted package as an ArrayBuffer.
51
+ */
52
+ export declare function decryptAgilePackage(encryptedPackage: Uint8Array, key: Uint8Array, info: EncryptionInfo): Promise<ArrayBuffer>;
53
+ /**
54
+ * Decrypt the EncryptedPackage stream using standard encryption key.
55
+ *
56
+ * Standard encryption uses AES-ECB over the whole package ([MS-OFFCRYPTO] 2.3.4.15).
57
+ *
58
+ * @param encryptedPackage - Raw bytes of the EncryptedPackage stream.
59
+ * @param key - The encryption key.
60
+ * @returns The decrypted package as an ArrayBuffer.
61
+ */
62
+ export declare function decryptStandardPackage(encryptedPackage: Uint8Array, key: Uint8Array): Promise<ArrayBuffer>;
63
+ //# sourceMappingURL=decrypt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../../src/crypto/decrypt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAMzE;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAgC5B;AAMD;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC3C,IAAI,EAAE,sBAAsB,EAC5B,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA6B5B;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,CAC7C,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,UAAU,EACf,gBAAgB,EAAE,UAAU,GAC1B,OAAO,CAAC,IAAI,CAAC,CA0Df;AAMD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACxC,gBAAgB,EAAE,UAAU,EAC5B,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,cAAc,GAClB,OAAO,CAAC,WAAW,CAAC,CAqCtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC3C,gBAAgB,EAAE,UAAU,EAC5B,GAAG,EAAE,UAAU,GACb,OAAO,CAAC,WAAW,CAAC,CAatB"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Recognises an encrypted OOXML package: a compound file (CFB, magic D0 CF 11 E0 A1 B1 1A E1)
3
+ * holding `EncryptionInfo` and `EncryptedPackage` streams, as opposed to a plain OOXML zip or a
4
+ * legacy binary document (.xls, .doc, .ppt), which is a compound file too.
5
+ *
6
+ * Moved from `src/pptx/core/utils/encryption-detection.ts` (see PROVENANCE.md);
7
+ * {@link isEncryptedOoxmlPackage} and {@link openEncryptedPackage} are new.
8
+ */
9
+ /** Bytes as a Uint8Array (no copy). */
10
+ export declare const toBytes: (input: Uint8Array | ArrayBuffer) => Uint8Array;
11
+ /** An ArrayBuffer holding exactly `bytes` (copied only when it is a view of a larger buffer). */
12
+ export declare function toArrayBuffer(bytes: Uint8Array): ArrayBuffer;
13
+ /** Whether the bytes start with the compound-file magic. */
14
+ export declare function isCompoundFile(input: Uint8Array | ArrayBuffer): boolean;
15
+ /** The two streams of an encrypted package. */
16
+ export interface EncryptedPackageStreams {
17
+ encryptionInfo: Uint8Array;
18
+ encryptedPackage: Uint8Array;
19
+ }
20
+ /**
21
+ * The `EncryptionInfo` and `EncryptedPackage` streams of an encrypted OOXML package, or
22
+ * `undefined` when the bytes are not a compound file or lack either stream (a legacy binary
23
+ * document). Never throws.
24
+ */
25
+ export declare function openEncryptedPackage(input: Uint8Array | ArrayBuffer): EncryptedPackageStreams | undefined;
26
+ /**
27
+ * Whether the bytes are an encrypted OOXML package (.xlsx, .docx, .pptx and their macro and
28
+ * template variants saved with a password to open). A legacy .xls/.doc/.ppt is `false`.
29
+ */
30
+ export declare function isEncryptedOoxmlPackage(input: Uint8Array | ArrayBuffer): boolean;
31
+ /** A coarse container sniff: zip, compound file (possibly an encrypted package) or unknown. */
32
+ export type FileFormatDetection = {
33
+ format: 'zip';
34
+ encrypted: false;
35
+ } | {
36
+ format: 'ole';
37
+ encrypted: true;
38
+ } | {
39
+ format: 'unknown';
40
+ encrypted: false;
41
+ };
42
+ /**
43
+ * Detect the container format from the magic bytes. A compound file is reported as
44
+ * `encrypted` without opening it (use {@link isEncryptedOoxmlPackage} to tell an encrypted
45
+ * package from a legacy binary document). Must be called before parsing as a zip.
46
+ */
47
+ export declare function detectFileFormat(data: ArrayBuffer | Uint8Array): FileFormatDetection;
48
+ /**
49
+ * Thrown when an encrypted file is detected where a plain package was expected. Callers can
50
+ * check `isEncrypted` (or `instanceof`) to tell it from generic parse failures.
51
+ */
52
+ export declare class EncryptedFileError extends Error {
53
+ readonly isEncrypted = true;
54
+ constructor(message: string);
55
+ }
56
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/crypto/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,uCAAuC;AACvC,eAAO,MAAM,OAAO,GAAI,OAAO,UAAU,GAAG,WAAW,KAAG,UACE,CAAC;AAE7D,iGAAiG;AACjG,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAK5D;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAGvE;AAED,+CAA+C;AAC/C,MAAM,WAAW,uBAAuB;IACvC,cAAc,EAAE,UAAU,CAAC;IAC3B,gBAAgB,EAAE,UAAU,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,UAAU,GAAG,WAAW,GAC7B,uBAAuB,GAAG,SAAS,CAarC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAShF;AAED,+FAA+F;AAC/F,MAAM,MAAM,mBAAmB,GAC5B;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,KAAK,CAAA;CAAE,GACnC;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,IAAI,CAAA;CAAE,GAClC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,KAAK,CAAA;CAAE,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,mBAAmB,CAMpF;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,SAAgB,WAAW,QAAQ;gBAEhB,OAAO,EAAE,MAAM;CAIlC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * OOXML package encryption: the agile scheme (Office 2010+, the default) and the ECMA-376
3
+ * Standard scheme (Office 2007), each producing a compound file with `EncryptionInfo` and
4
+ * `EncryptedPackage` streams.
5
+ *
6
+ * Moved from `src/pptx/core/utils/ooxml-crypto-encrypt.ts` and the agile half of
7
+ * `ooxml-crypto.ts` (see PROVENANCE.md).
8
+ */
9
+ import type { EncryptionInfo, EncryptionOptions } from './types.js';
10
+ /**
11
+ * Encrypt a package with the agile scheme: each 4096-byte segment is encrypted separately with
12
+ * an IV derived from the segment index. Returns the bytes with the 8-byte size prefix.
13
+ */
14
+ export declare function encryptAgilePackage(packageData: Uint8Array, key: Uint8Array, info: EncryptionInfo): Promise<Uint8Array>;
15
+ /**
16
+ * Encrypt a package with the ECMA-376 Standard scheme: AES-ECB under the password-derived key
17
+ * ([MS-OFFCRYPTO] 2.3.4.15). Returns the bytes with the 8-byte size prefix.
18
+ */
19
+ export declare function encryptStandardPackage(packageData: Uint8Array, key: Uint8Array): Promise<Uint8Array>;
20
+ /** The agile scheme (AES-CBC, SHA-512, 100,000 spins by default) as a compound file. */
21
+ export declare function encryptAgile(packageData: Uint8Array, password: string, options?: EncryptionOptions): Promise<Uint8Array>;
22
+ /**
23
+ * The ECMA-376 Standard scheme (Office 2007-compatible) as a compound file. There is no
24
+ * separate document key: the password-derived key encrypts the whole package (AES-ECB).
25
+ */
26
+ export declare function encryptStandard(packageData: Uint8Array, password: string, options?: EncryptionOptions): Promise<Uint8Array>;
27
+ //# sourceMappingURL=encrypt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encrypt.d.ts","sourceRoot":"","sources":["../../src/crypto/encrypt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAwBH,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAoCpE;;;GAGG;AACH,wBAAsB,mBAAmB,CACxC,WAAW,EAAE,UAAU,EACvB,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,cAAc,GAClB,OAAO,CAAC,UAAU,CAAC,CAerB;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC3C,WAAW,EAAE,UAAU,EACvB,GAAG,EAAE,UAAU,GACb,OAAO,CAAC,UAAU,CAAC,CAGrB;AAED,wFAAwF;AACxF,wBAAsB,YAAY,CACjC,WAAW,EAAE,UAAU,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAgErB;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACpC,WAAW,EAAE,UAAU,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAgBrB"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * EncryptionInfo stream writers for the agile ([MS-OFFCRYPTO] 2.3.4.10) and Standard (2.3.4.5)
3
+ * schemes.
4
+ *
5
+ * Moved from `src/pptx/core/utils/ooxml-crypto-encrypt.ts` (see PROVENANCE.md).
6
+ */
7
+ import type { EncryptionInfo } from './types.js';
8
+ /**
9
+ * Generate EncryptionInfo XML for agile encryption.
10
+ *
11
+ * Builds the XML document that describes the encryption parameters,
12
+ * key data, data integrity values, and password key encryptor.
13
+ *
14
+ * @param keyData - Key data parameters.
15
+ * @param pke - Password key encryptor parameters.
16
+ * @param dataIntegrity - Data integrity HMAC values.
17
+ * @returns Serialized XML string.
18
+ */
19
+ export declare function buildAgileEncryptionInfoXml(keyData: EncryptionInfo['keyData'], pke: EncryptionInfo['passwordKeyEncryptor'], dataIntegrity: NonNullable<EncryptionInfo['dataIntegrity']>): string;
20
+ /**
21
+ * Build the EncryptionInfo stream bytes for agile encryption.
22
+ *
23
+ * Prepends the 8-byte header (version 4.4 + reserved flag) to the
24
+ * XML content.
25
+ *
26
+ * @param xmlString - The agile encryption info XML string.
27
+ * @returns Raw bytes of the EncryptionInfo stream.
28
+ */
29
+ export declare function buildEncryptionInfoStream(xmlString: string): Uint8Array;
30
+ /** AlgIDHash value for SHA-1, the only hash the Standard scheme uses. */
31
+ export declare const STANDARD_ALG_ID_HASH_SHA1 = 32772;
32
+ /**
33
+ * Build the binary EncryptionInfo stream for the ECMA-376 Standard scheme.
34
+ *
35
+ * Layout per [MS-OFFCRYPTO] 2.3.4.5-2.3.4.7: version + flags + header size,
36
+ * followed by the EncryptionHeader (algorithm/provider) and the
37
+ * EncryptionVerifier (salt + encrypted verifier + encrypted verifier hash).
38
+ *
39
+ * @param keyBits - Key size in bits (128, 192, or 256).
40
+ * @param salt - 16-byte verifier salt.
41
+ * @param encryptedVerifier - 16-byte AES-CBC encrypted random verifier.
42
+ * @param encryptedVerifierHash - 32-byte AES-CBC encrypted (padded) SHA-1 hash of the verifier.
43
+ * @returns Raw bytes of the EncryptionInfo stream.
44
+ */
45
+ export declare function buildStandardEncryptionInfoStream(keyBits: number, salt: Uint8Array, encryptedVerifier: Uint8Array, encryptedVerifierHash: Uint8Array): Uint8Array;
46
+ //# sourceMappingURL=encryption-info-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption-info-write.d.ts","sourceRoot":"","sources":["../../src/crypto/encryption-info-write.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,EAClC,GAAG,EAAE,cAAc,CAAC,sBAAsB,CAAC,EAC3C,aAAa,EAAE,WAAW,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,GACzD,MAAM,CAoCR;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAavE;AASD,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,QAAa,CAAC;AAWpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iCAAiC,CAChD,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,iBAAiB,EAAE,UAAU,EAC7B,qBAAqB,EAAE,UAAU,GAC/B,UAAU,CAgDZ"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * EncryptionInfo stream parsing ([MS-OFFCRYPTO] 2.3.4.5 Standard, 2.3.4.10 agile).
3
+ *
4
+ * Moved from `src/pptx/core/utils/ooxml-crypto-key-derivation.ts` (see PROVENANCE.md).
5
+ */
6
+ import type { EncryptionInfo, StandardEncryptionInfo } from './types.js';
7
+ /**
8
+ * Algorithm ID for RC4 in the [MS-OFFCRYPTO] EncryptionHeader `algId` field.
9
+ *
10
+ * RC4 is a stream cipher, so its encrypted verifier hash is stored at exactly
11
+ * `verifierHashSize` bytes with no block-alignment padding, unlike AES (a block cipher, padded
12
+ * up to a 16-byte boundary).
13
+ */
14
+ export declare const RC4_ALG_ID = 26625;
15
+ /**
16
+ * Parse the EncryptionInfo stream of an encrypted OOXML file: agile (version 4.4) or Standard
17
+ * (versions 2.2, 3.2 and 4.2).
18
+ *
19
+ * @throws Error if the encryption version is unsupported.
20
+ */
21
+ export declare function parseEncryptionInfo(data: Uint8Array): EncryptionInfo | StandardEncryptionInfo;
22
+ //# sourceMappingURL=encryption-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption-info.d.ts","sourceRoot":"","sources":["../../src/crypto/encryption-info.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,QAAS,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,GAAG,sBAAsB,CAa7F"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Errors of OOXML package encryption. Each carries a stable `code`: every subpath bundle
3
+ * (`ooxml-core/crypto`, `/xlsx/load`, `/docx/load`, `/pptx`) inlines its own copy of these
4
+ * classes, so a UI should test `error.code` (or `name`) rather than `instanceof` across entries.
5
+ *
6
+ * Moved from `src/pptx/core/utils/ooxml-crypto-errors.ts` (see PROVENANCE.md); `code` and
7
+ * {@link PasswordRequiredError} are new.
8
+ */
9
+ /** The stable codes of the package encryption errors. */
10
+ export type OoxmlCryptoErrorCode = 'password-required' | 'incorrect-password' | 'data-integrity';
11
+ /**
12
+ * The file is an encrypted OOXML package (a compound file holding `EncryptionInfo` and
13
+ * `EncryptedPackage`) and no password was supplied.
14
+ */
15
+ export declare class PasswordRequiredError extends Error {
16
+ readonly code: "password-required";
17
+ constructor(message?: string);
18
+ }
19
+ /**
20
+ * The supplied password did not match the password verifier stored in the encrypted file's
21
+ * EncryptionInfo stream.
22
+ */
23
+ export declare class IncorrectPasswordError extends Error {
24
+ readonly code: "incorrect-password";
25
+ constructor(message?: string);
26
+ }
27
+ /**
28
+ * The HMAC computed over the encrypted package did not match the one stored in the
29
+ * EncryptionInfo stream: the file may be corrupted or tampered with.
30
+ */
31
+ export declare class DataIntegrityError extends Error {
32
+ readonly code: "data-integrity";
33
+ constructor(message?: string);
34
+ }
35
+ /** Whether `error` is one of the package encryption errors (by `code`, across bundles). */
36
+ export declare function isOoxmlCryptoError(error: unknown): error is Error & {
37
+ readonly code: OoxmlCryptoErrorCode;
38
+ };
39
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/crypto/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,yDAAyD;AACzD,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG,oBAAoB,GAAG,gBAAgB,CAAC;AAEjG;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC/C,SAAgB,IAAI,EAAG,mBAAmB,CAAU;gBAEjC,OAAO,SAAoE;CAI9F;AAED;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAChD,SAAgB,IAAI,EAAG,oBAAoB,CAAU;gBAElC,OAAO,SAA+B;CAIzD;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,SAAgB,IAAI,EAAG,gBAAgB,CAAU;gBAGhD,OAAO,SAAuF;CAK/F;AAED,2FAA2F;AAC3F,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,KAAK,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAI1D"}