@a3s-lab/office 0.2.2 → 0.4.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 (277) hide show
  1. package/COLLABORATION_ROADMAP.md +426 -0
  2. package/README.md +649 -10
  3. package/dist/0~1403.js +1 -1
  4. package/dist/0~2805.js +1279 -0
  5. package/dist/{0~use-office-draft.js → 0~345.js} +30 -1
  6. package/dist/0~3539.js +1 -1
  7. package/dist/0~3557.js +1 -1
  8. package/dist/0~3635.js +1 -1
  9. package/dist/0~4595.js +123 -12
  10. package/dist/0~4980.js +154 -0
  11. package/dist/0~5050.js +124 -113
  12. package/dist/{0~9512.js → 0~6090.js} +540 -3
  13. package/dist/0~7048.js +92 -66
  14. package/dist/0~7614.js +2 -1
  15. package/dist/0~7754.js +5653 -0
  16. package/dist/0~9445.js +1 -1
  17. package/dist/0~document-editor.js +4992 -3323
  18. package/dist/0~markdown-editor.js +250 -44
  19. package/dist/0~pdf-viewer.js +1016 -24
  20. package/dist/0~presentation-editor.js +179 -8
  21. package/dist/0~spreadsheet-editor.js +3371 -578
  22. package/dist/0~work-docx-export.js +6801 -658
  23. package/dist/0~work-docx-import.js +1388 -795
  24. package/dist/0~work-office-diagnostics.js +524 -30
  25. package/dist/0~work-pptx-export.js +2 -1
  26. package/dist/0~work-pptx-import.js +1 -2
  27. package/dist/0~work-presentation-charts.js +1 -1
  28. package/dist/2591.js +197 -0
  29. package/dist/3818.js +1090 -0
  30. package/dist/4104.js +970 -60
  31. package/dist/432.js +171 -14
  32. package/dist/4476.js +2008 -0
  33. package/dist/4560.js +674 -0
  34. package/dist/4650.js +70 -0
  35. package/dist/{1134.js → 5184.js} +183 -1
  36. package/dist/6489.js +18 -18
  37. package/dist/7060.js +132 -0
  38. package/dist/8715.js +2 -136
  39. package/dist/8928.js +16778 -0
  40. package/dist/9787.js +209 -0
  41. package/dist/core.d.ts +29 -9
  42. package/dist/core.js +10 -2
  43. package/dist/index.js +13 -3
  44. package/dist/internal/collaboration/office-collaboration-flat-json.d.ts +13 -0
  45. package/dist/internal/collaboration/office-collaboration-json.d.ts +4 -0
  46. package/dist/internal/collaboration/office-collaboration-presence.d.ts +86 -0
  47. package/dist/internal/collaboration/office-collaboration-transport.d.ts +42 -0
  48. package/dist/internal/collaboration/office-collaboration.d.ts +85 -0
  49. package/dist/internal/collaboration/office-document-collaboration-bibliography.d.ts +7 -0
  50. package/dist/internal/collaboration/office-document-collaboration-claims.d.ts +9 -0
  51. package/dist/internal/collaboration/office-document-collaboration-comments.d.ts +7 -0
  52. package/dist/internal/collaboration/office-document-collaboration-sidecar-utils.d.ts +27 -0
  53. package/dist/internal/collaboration/office-document-collaboration-sidecars.d.ts +16 -0
  54. package/dist/internal/collaboration/office-document-collaboration.d.ts +45 -0
  55. package/dist/internal/collaboration/office-markdown-collaboration.d.ts +31 -0
  56. package/dist/internal/collaboration/office-pdf-collaboration-claims.d.ts +4 -0
  57. package/dist/internal/collaboration/office-pdf-collaboration-conflicts.d.ts +2 -0
  58. package/dist/internal/collaboration/office-pdf-collaboration-model.d.ts +26 -0
  59. package/dist/internal/collaboration/office-pdf-collaboration-records.d.ts +21 -0
  60. package/dist/internal/collaboration/office-pdf-collaboration-types.d.ts +91 -0
  61. package/dist/internal/collaboration/office-pdf-collaboration-validation.d.ts +4 -0
  62. package/dist/internal/collaboration/office-pdf-collaboration.d.ts +35 -0
  63. package/dist/internal/collaboration/office-presentation-collaboration-model.d.ts +25 -0
  64. package/dist/internal/collaboration/office-presentation-collaboration-records.d.ts +22 -0
  65. package/dist/internal/collaboration/office-presentation-collaboration-validation.d.ts +4 -0
  66. package/dist/internal/collaboration/office-presentation-collaboration.d.ts +32 -0
  67. package/dist/internal/collaboration/office-spreadsheet-collaboration-cells.d.ts +13 -0
  68. package/dist/internal/collaboration/office-spreadsheet-collaboration-claims.d.ts +4 -0
  69. package/dist/internal/collaboration/office-spreadsheet-collaboration-conflicts.d.ts +2 -0
  70. package/dist/internal/collaboration/office-spreadsheet-collaboration-flat-json.d.ts +10 -0
  71. package/dist/internal/collaboration/office-spreadsheet-collaboration-model.d.ts +31 -0
  72. package/dist/internal/collaboration/office-spreadsheet-collaboration-records.d.ts +17 -0
  73. package/dist/internal/collaboration/office-spreadsheet-collaboration-validation.d.ts +4 -0
  74. package/dist/internal/collaboration/office-spreadsheet-collaboration.d.ts +32 -0
  75. package/dist/internal/design-system/primitives/navigation/tabs.d.ts +3 -1
  76. package/dist/internal/features/work/components/work-document-page-border.d.ts +6 -0
  77. package/dist/internal/features/work/editors/document-command-catalog.d.ts +536 -0
  78. package/dist/internal/features/work/editors/document-editor-focus.d.ts +1 -1
  79. package/dist/internal/features/work/editors/document-editor-support.d.ts +7 -3
  80. package/dist/internal/features/work/editors/document-editor.d.ts +8 -2
  81. package/dist/internal/features/work/editors/document-external-content.d.ts +14 -0
  82. package/dist/internal/features/work/editors/document-format-clipboard.d.ts +6 -0
  83. package/dist/internal/features/work/editors/document-format-tools.d.ts +4 -0
  84. package/dist/internal/features/work/editors/document-layout-panel.d.ts +4 -1
  85. package/dist/internal/features/work/editors/document-page-chrome-wps-shortcuts.d.ts +2 -0
  86. package/dist/internal/features/work/editors/document-page-layout-ribbon.d.ts +14 -0
  87. package/dist/internal/features/work/editors/document-page-stack.d.ts +10 -1
  88. package/dist/internal/features/work/editors/document-page-thumbnail.d.ts +2 -0
  89. package/dist/internal/features/work/editors/document-pagination-run-coordinator.d.ts +26 -0
  90. package/dist/internal/features/work/editors/document-picture-properties-dialog-model.d.ts +20 -1
  91. package/dist/internal/features/work/editors/document-review-navigation.d.ts +9 -0
  92. package/dist/internal/features/work/editors/document-statistics-dialog.d.ts +7 -0
  93. package/dist/internal/features/work/editors/document-status-bar.d.ts +2 -1
  94. package/dist/internal/features/work/editors/document-table-properties-dialog-model.d.ts +4 -1
  95. package/dist/internal/features/work/editors/document-toolbar.d.ts +19 -42
  96. package/dist/internal/features/work/editors/document-wps-shortcuts.d.ts +12 -0
  97. package/dist/internal/features/work/editors/document-zoom.d.ts +17 -0
  98. package/dist/internal/features/work/editors/markdown-editor-focus.d.ts +1 -1
  99. package/dist/internal/features/work/editors/markdown-editor.d.ts +5 -1
  100. package/dist/internal/features/work/editors/markdown-toolbar.d.ts +2 -1
  101. package/dist/internal/features/work/editors/office-collaboration-participants.d.ts +3 -0
  102. package/dist/internal/features/work/editors/office-collaboration-presence-context.d.ts +17 -0
  103. package/dist/internal/features/work/editors/office-collaboration-presence-ui.d.ts +25 -0
  104. package/dist/internal/features/work/editors/office-editor-focus-handoff.d.ts +27 -0
  105. package/dist/internal/features/work/editors/pdf-annotation-controller.d.ts +5 -0
  106. package/dist/internal/features/work/editors/pdf-collaboration-presence.d.ts +3 -0
  107. package/dist/internal/features/work/editors/pdf-collaboration-projection.d.ts +10 -0
  108. package/dist/internal/features/work/editors/pdf-evidence-contract.d.ts +36 -0
  109. package/dist/internal/features/work/editors/pdf-evidence-overlay.d.ts +37 -0
  110. package/dist/internal/features/work/editors/pdf-toolbar.d.ts +2 -1
  111. package/dist/internal/features/work/editors/pdf-viewer-controller.d.ts +7 -1
  112. package/dist/internal/features/work/editors/pdf-viewer.d.ts +11 -1
  113. package/dist/internal/features/work/editors/presentation-collaboration-presence.d.ts +5 -0
  114. package/dist/internal/features/work/editors/presentation-editor-focus.d.ts +3 -2
  115. package/dist/internal/features/work/editors/presentation-editor-types.d.ts +3 -0
  116. package/dist/internal/features/work/editors/presentation-editor.d.ts +1 -1
  117. package/dist/internal/features/work/editors/spreadsheet-auto-filter.d.ts +9 -0
  118. package/dist/internal/features/work/editors/spreadsheet-cell-clear.d.ts +3 -0
  119. package/dist/internal/features/work/editors/spreadsheet-cell-merge.d.ts +12 -0
  120. package/dist/internal/features/work/editors/spreadsheet-clipboard-shortcuts.d.ts +3 -7
  121. package/dist/internal/features/work/editors/spreadsheet-collaboration-presence.d.ts +9 -0
  122. package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +464 -0
  123. package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +45 -9
  124. package/dist/internal/features/work/editors/spreadsheet-context-menu.d.ts +2 -0
  125. package/dist/internal/features/work/editors/spreadsheet-editor-ribbon.d.ts +9 -28
  126. package/dist/internal/features/work/editors/spreadsheet-editor.d.ts +8 -2
  127. package/dist/internal/features/work/editors/spreadsheet-format-painter.d.ts +27 -0
  128. package/dist/internal/features/work/editors/spreadsheet-freeze-panes.d.ts +14 -0
  129. package/dist/internal/features/work/editors/use-document-insert-commands.d.ts +3 -2
  130. package/dist/internal/features/work/editors/use-document-pagination.d.ts +6 -1
  131. package/dist/internal/features/work/editors/use-document-review-conflicts.d.ts +28 -0
  132. package/dist/internal/features/work/editors/use-spreadsheet-auto-filter.d.ts +21 -0
  133. package/dist/internal/features/work/editors/use-spreadsheet-collaboration.d.ts +27 -0
  134. package/dist/internal/features/work/editors/use-spreadsheet-format-painter.d.ts +18 -0
  135. package/dist/internal/features/work/editors/work-office-chrome.d.ts +22 -3
  136. package/dist/internal/features/work/editors/work-office-ribbon-overflow.d.ts +2 -0
  137. package/dist/internal/features/work/work-document-bookmark-references.d.ts +37 -0
  138. package/dist/internal/features/work/work-document-bookmarks.d.ts +29 -0
  139. package/dist/internal/features/work/work-document-caption-nodes.d.ts +4 -1
  140. package/dist/internal/features/work/work-document-comments.d.ts +1 -1
  141. package/dist/internal/features/work/work-document-equations.d.ts +513 -0
  142. package/dist/internal/features/work/work-document-extensions.d.ts +1 -0
  143. package/dist/internal/features/work/work-document-field-identity.d.ts +2 -0
  144. package/dist/internal/features/work/work-document-field-node.d.ts +2 -2
  145. package/dist/internal/features/work/work-document-fields.d.ts +7 -0
  146. package/dist/internal/features/work/work-document-image-identity.d.ts +30 -0
  147. package/dist/internal/features/work/work-document-image-layout.d.ts +46 -1
  148. package/dist/internal/features/work/work-document-image-wrap-contour.d.ts +16 -0
  149. package/dist/internal/features/work/work-document-incremental-layout.d.ts +2 -2
  150. package/dist/internal/features/work/work-document-model-codec.d.ts +4 -1
  151. package/dist/internal/features/work/work-document-note-integrity.d.ts +2 -0
  152. package/dist/internal/features/work/work-document-page-borders.d.ts +25 -0
  153. package/dist/internal/features/work/work-document-page-capture.d.ts +8 -0
  154. package/dist/internal/features/work/work-document-page-frames.d.ts +15 -0
  155. package/dist/internal/features/work/work-document-page-margins.d.ts +56 -0
  156. package/dist/internal/features/work/work-document-page-size.d.ts +47 -0
  157. package/dist/internal/features/work/work-document-pagination-measurement.d.ts +1 -2
  158. package/dist/internal/features/work/work-document-pagination-types.d.ts +7 -2
  159. package/dist/internal/features/work/work-document-pagination.d.ts +2 -2
  160. package/dist/internal/features/work/work-document-paragraph-borders.d.ts +32 -0
  161. package/dist/internal/features/work/work-document-paragraph-identity.d.ts +26 -0
  162. package/dist/internal/features/work/work-document-paragraph-shading.d.ts +18 -0
  163. package/dist/internal/features/work/work-document-review-conflicts.d.ts +35 -0
  164. package/dist/internal/features/work/work-document-section.d.ts +4 -0
  165. package/dist/internal/features/work/work-document-snapshot.d.ts +19 -0
  166. package/dist/internal/features/work/work-document-source.d.ts +23 -0
  167. package/dist/internal/features/work/work-document-table-column-widths.d.ts +7 -0
  168. package/dist/internal/features/work/work-document-table-property-changes.d.ts +3 -0
  169. package/dist/internal/features/work/work-document-table-row-identity.d.ts +15 -0
  170. package/dist/internal/features/work/work-document-table-sizing.d.ts +3 -0
  171. package/dist/internal/features/work/work-document-text-layout.d.ts +3 -1
  172. package/dist/internal/features/work/work-document-word-line-metrics.d.ts +2 -0
  173. package/dist/internal/features/work/work-docx-bookmark-diagnostics.d.ts +3 -0
  174. package/dist/internal/features/work/work-docx-bookmark-import.d.ts +24 -0
  175. package/dist/internal/features/work/work-docx-bookmarks.d.ts +17 -0
  176. package/dist/internal/features/work/work-docx-comment-durable-id-preservation.d.ts +2 -0
  177. package/dist/internal/features/work/work-docx-comment-export.d.ts +3 -0
  178. package/dist/internal/features/work/work-docx-comment-metadata.d.ts +2 -0
  179. package/dist/internal/features/work/work-docx-drawing-extension-preservation.d.ts +4 -0
  180. package/dist/internal/features/work/work-docx-equation-diagnostics.d.ts +3 -0
  181. package/dist/internal/features/work/work-docx-equation-export.d.ts +14 -0
  182. package/dist/internal/features/work/work-docx-equation-import.d.ts +30 -0
  183. package/dist/internal/features/work/work-docx-equation-story.d.ts +9 -0
  184. package/dist/internal/features/work/work-docx-export-formatting.d.ts +3 -1
  185. package/dist/internal/features/work/work-docx-export-image.d.ts +5 -1
  186. package/dist/internal/features/work/work-docx-export.d.ts +1 -1
  187. package/dist/internal/features/work/work-docx-field-instructions.d.ts +8 -0
  188. package/dist/internal/features/work/work-docx-font-table-preservation.d.ts +3 -0
  189. package/dist/internal/features/work/work-docx-ignorable-extension-preservation.d.ts +15 -0
  190. package/dist/internal/features/work/work-docx-image-crop.d.ts +12 -0
  191. package/dist/internal/features/work/work-docx-image-identity.d.ts +17 -0
  192. package/dist/internal/features/work/work-docx-image-layer.d.ts +12 -0
  193. package/dist/internal/features/work/work-docx-image-layout-import.d.ts +14 -2
  194. package/dist/internal/features/work/work-docx-image-wrap.d.ts +15 -0
  195. package/dist/internal/features/work/work-docx-import.d.ts +13 -3
  196. package/dist/internal/features/work/work-docx-list-export.d.ts +18 -0
  197. package/dist/internal/features/work/work-docx-list-import.d.ts +14 -0
  198. package/dist/internal/features/work/work-docx-note-comment-content-control-block-preservation.d.ts +18 -0
  199. package/dist/internal/features/work/work-docx-note-comment-content-control-model.d.ts +47 -0
  200. package/dist/internal/features/work/work-docx-note-comment-content-control-preservation.d.ts +4 -0
  201. package/dist/internal/features/work/work-docx-note-comment-content-control-properties.d.ts +17 -0
  202. package/dist/internal/features/work/work-docx-note-comment-content-control-table-model.d.ts +17 -0
  203. package/dist/internal/features/work/work-docx-note-comment-content-control-xml.d.ts +14 -0
  204. package/dist/internal/features/work/work-docx-note-comment-extension-preservation.d.ts +2 -0
  205. package/dist/internal/features/work/work-docx-note-comment-hyperlink-content.d.ts +40 -0
  206. package/dist/internal/features/work/work-docx-note-comment-hyperlink-preservation.d.ts +5 -0
  207. package/dist/internal/features/work/work-docx-note-comment-hyperlink-relationships.d.ts +35 -0
  208. package/dist/internal/features/work/work-docx-note-comment-identity.d.ts +15 -0
  209. package/dist/internal/features/work/work-docx-note-comment-run-preservation.d.ts +4 -0
  210. package/dist/internal/features/work/work-docx-note-comment-run-properties.d.ts +2 -0
  211. package/dist/internal/features/work/work-docx-note-image-import.d.ts +12 -0
  212. package/dist/internal/features/work/work-docx-note-image-relationships.d.ts +1 -0
  213. package/dist/internal/features/work/work-docx-numbering-extension-preservation.d.ts +6 -0
  214. package/dist/internal/features/work/work-docx-numbering.d.ts +1 -0
  215. package/dist/internal/features/work/work-docx-page-borders-diagnostics.d.ts +3 -0
  216. package/dist/internal/features/work/work-docx-page-borders-import.d.ts +10 -0
  217. package/dist/internal/features/work/work-docx-page-margins-diagnostics.d.ts +3 -0
  218. package/dist/internal/features/work/work-docx-page-margins-import.d.ts +18 -0
  219. package/dist/internal/features/work/work-docx-page-size-diagnostics.d.ts +2 -0
  220. package/dist/internal/features/work/work-docx-page-size-import.d.ts +17 -0
  221. package/dist/internal/features/work/work-docx-paragraph-borders-diagnostics.d.ts +3 -0
  222. package/dist/internal/features/work/work-docx-paragraph-borders-export.d.ts +18 -0
  223. package/dist/internal/features/work/work-docx-paragraph-borders-import.d.ts +24 -0
  224. package/dist/internal/features/work/work-docx-paragraph-default-collapsed.d.ts +19 -0
  225. package/dist/internal/features/work/work-docx-paragraph-extension-preservation.d.ts +2 -0
  226. package/dist/internal/features/work/work-docx-paragraph-identity-import.d.ts +10 -0
  227. package/dist/internal/features/work/work-docx-paragraph-identity.d.ts +18 -0
  228. package/dist/internal/features/work/work-docx-paragraph-pagination-import.d.ts +6 -1
  229. package/dist/internal/features/work/work-docx-paragraph-shading-diagnostics.d.ts +3 -0
  230. package/dist/internal/features/work/work-docx-paragraph-shading-export.d.ts +5 -0
  231. package/dist/internal/features/work/work-docx-paragraph-shading-import.d.ts +18 -0
  232. package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +3 -0
  233. package/dist/internal/features/work/work-docx-settings-preservation.d.ts +10 -0
  234. package/dist/internal/features/work/work-docx-settings-xml.d.ts +16 -0
  235. package/dist/internal/features/work/work-docx-style-extension-preservation.d.ts +2 -0
  236. package/dist/internal/features/work/work-docx-table-cell-export.d.ts +2 -1
  237. package/dist/internal/features/work/work-docx-table-cell-import.d.ts +3 -0
  238. package/dist/internal/features/work/work-docx-table-extension-preservation.d.ts +2 -0
  239. package/dist/internal/features/work/work-docx-table-row-import.d.ts +2 -0
  240. package/dist/internal/features/work/work-docx-table-sizing-import.d.ts +1 -0
  241. package/dist/internal/features/work/work-docx-theme-reference.d.ts +23 -0
  242. package/dist/internal/features/work/work-docx-theme.d.ts +4 -1
  243. package/dist/internal/features/work/work-docx-twips.d.ts +12 -0
  244. package/dist/internal/features/work/work-file-contract.d.ts +1 -0
  245. package/dist/internal/features/work/work-file-io.d.ts +1 -1
  246. package/dist/internal/features/work/work-markdown-extensions.d.ts +4 -1
  247. package/dist/internal/features/work/work-ooxml-package-preservation.d.ts +12 -0
  248. package/dist/internal/features/work/work-ooxml-package-security.d.ts +6 -0
  249. package/dist/internal/features/work/work-ooxml-relationship-preservation.d.ts +10 -0
  250. package/dist/internal/features/work/work-ooxml-xml.d.ts +2 -0
  251. package/dist/internal/features/work/work-pdf-export.d.ts +10 -0
  252. package/dist/internal/features/work/work-repository.d.ts +2 -0
  253. package/dist/internal/features/work/work-types.d.ts +15 -2
  254. package/dist/internal/kernel/office-kernel-client-types.d.ts +1 -0
  255. package/dist/internal/kernel/office-kernel-protocol.d.ts +7 -0
  256. package/dist/internal/kernel/office-kernel-version.d.ts +1 -1
  257. package/dist/office-kernel.wasm +0 -0
  258. package/dist/office-kernel.worker.js +93 -41
  259. package/dist/react.d.ts +18 -12
  260. package/dist/react.js +1 -1
  261. package/dist/styles.css +1367 -16
  262. package/dist/vue.d.ts +48 -5
  263. package/dist/vue.js +42 -3
  264. package/dist/web-component.d.ts +24 -2
  265. package/dist/web-component.js +101 -2
  266. package/docs/latest/en/browser-editor-architecture.md +262 -47
  267. package/package.json +29 -4
  268. package/dist/0~152.js +0 -94
  269. package/dist/0~2582.js +0 -485
  270. package/dist/0~4750.js +0 -939
  271. package/dist/0~5861.js +0 -596
  272. package/dist/0~work-document-extensions.js +0 -3045
  273. package/dist/0~work-document-model-codec.js +0 -42
  274. package/dist/0~work-docx-bibliography.js +0 -347
  275. package/dist/0~work-docx-page-color.js +0 -42
  276. package/dist/2881.js +0 -1455
  277. package/dist/8728.js +0 -723
@@ -0,0 +1,15 @@
1
+ import { type WorkDocumentNote, type WorkDocumentNoteKind } from './work-document-notes';
2
+ import type { WorkDocumentComment, WorkDocumentCommentReply } from './work-types';
3
+ export interface AssignedDocxCommentReply {
4
+ id: number;
5
+ reply: WorkDocumentCommentReply;
6
+ }
7
+ export interface AssignedDocxCommentThread {
8
+ comment: WorkDocumentComment;
9
+ id: number;
10
+ replies: AssignedDocxCommentReply[];
11
+ }
12
+ export declare function importedDocumentNoteId(kind: WorkDocumentNoteKind, target: string): string | null;
13
+ export declare function assignDocxNoteIds(notes: readonly WorkDocumentNote[]): Map<string, number>;
14
+ export declare function assignDocxCommentThreads(comments: readonly WorkDocumentComment[]): AssignedDocxCommentThread[];
15
+ export declare function normalizeDocxCommentId(value: string | null | undefined): number | null;
@@ -0,0 +1,4 @@
1
+ import { type DocxIgnorableExtensionPair } from './work-docx-ignorable-extension-preservation';
2
+ type NoteCommentContentKind = 'comment' | 'note';
3
+ export declare function preserveDocxNoteCommentRunContent(generatedDocument: Document, sourceDocument: Document, scopes: readonly DocxIgnorableExtensionPair[], kind: NoteCommentContentKind): void;
4
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function preserveDocxNoteCommentRunProperties(generatedDocument: Document, generatedRun: Element, sourceRun: Element, kind: 'comment' | 'note'): void;
2
+ export declare function cloneDocxNoteCommentRunProperties(document: Document, sourceProperties: Element, targetContext: Element, kind: 'comment' | 'note'): Element | null;
@@ -0,0 +1,12 @@
1
+ import { type ImportedDocxImageLayoutMarkerState, type ImportedDocxImageLayoutMarkers } from './work-docx-image-layout-import';
2
+ import type { OoxmlPackage } from './work-ooxml-package';
3
+ interface MarkedNoteImagePart {
4
+ document: Document;
5
+ path: string;
6
+ }
7
+ export interface ImportedDocxNoteImageMarkers {
8
+ markers: ImportedDocxImageLayoutMarkers;
9
+ parts: MarkedNoteImagePart[];
10
+ }
11
+ export declare function markDocxNoteImageLayouts(archive: OoxmlPackage, state: ImportedDocxImageLayoutMarkerState): Promise<ImportedDocxNoteImageMarkers>;
12
+ export {};
@@ -0,0 +1 @@
1
+ export declare function patchDocxNoteImageRelationships(buffer: ArrayBuffer): Promise<ArrayBuffer>;
@@ -0,0 +1,6 @@
1
+ import type JSZip from 'jszip';
2
+ export interface DocxSourceNumberingIdentity {
3
+ numId: number;
4
+ abstractNumId?: number;
5
+ }
6
+ export declare function preserveDocxNumberingExtensions(generated: JSZip, source: JSZip, sourceIdentities: readonly (DocxSourceNumberingIdentity | null)[], generatedPath?: string, sourcePath?: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function patchDocxNumberingRestartRules(buffer: ArrayBuffer, rules: ReadonlyArray<ReadonlyMap<number, number>>): Promise<ArrayBuffer>;
@@ -0,0 +1,3 @@
1
+ import type { OoxmlPackage } from './work-ooxml-package';
2
+ import type { WorkCompatibilityIssue } from './work-types';
3
+ export declare function diagnoseDocxPageBorders(archive: OoxmlPackage, document: Document): Promise<WorkCompatibilityIssue[]>;
@@ -0,0 +1,10 @@
1
+ import { type WorkDocumentPageBorders } from './work-document-page-borders';
2
+ import { type DocxThemeSource } from './work-docx-theme';
3
+ export interface InspectedDocxPageBorders {
4
+ status: 'absent' | 'valid' | 'invalid';
5
+ pageBorders?: WorkDocumentPageBorders;
6
+ invalidCount: number;
7
+ spoofedCount: number;
8
+ }
9
+ export declare function inspectDocxPageBorders(sectionProperties: Element, themeSource?: DocxThemeSource): InspectedDocxPageBorders;
10
+ export declare function parseDocxPageBorders(sectionProperties: Element, themeSource?: DocxThemeSource): WorkDocumentPageBorders | null | undefined;
@@ -0,0 +1,3 @@
1
+ import type { OoxmlPackage } from './work-ooxml-package';
2
+ import type { WorkCompatibilityIssue } from './work-types';
3
+ export declare function diagnoseDocxPageMargins(archive: OoxmlPackage, document: Document): Promise<WorkCompatibilityIssue[]>;
@@ -0,0 +1,18 @@
1
+ import { type WorkDocumentPageMargins } from './work-document-page-margins';
2
+ export interface InspectedDocxPageMarginSettings {
3
+ mirrorMargins?: boolean;
4
+ gutterAtTop?: boolean;
5
+ invalidCount: number;
6
+ spoofedCount: number;
7
+ incompatible: string[];
8
+ }
9
+ export interface InspectedDocxPageMargins {
10
+ status: 'absent' | 'valid' | 'invalid';
11
+ pageMargins?: WorkDocumentPageMargins;
12
+ gutterOnRight?: boolean;
13
+ invalidCount: number;
14
+ spoofedCount: number;
15
+ }
16
+ export declare function inspectDocxPageMarginSettings(settings: Document | null | undefined): InspectedDocxPageMarginSettings;
17
+ export declare function inspectDocxPageMargins(sectionProperties: Element, settings?: InspectedDocxPageMarginSettings): InspectedDocxPageMargins;
18
+ export declare function parseDocxPageMargins(sectionProperties: Element, settings: InspectedDocxPageMarginSettings, fallback?: WorkDocumentPageMargins): WorkDocumentPageMargins | null | undefined;
@@ -0,0 +1,2 @@
1
+ import type { WorkCompatibilityIssue } from './work-types';
2
+ export declare function diagnoseDocxPageSize(document: Document): WorkCompatibilityIssue[];
@@ -0,0 +1,17 @@
1
+ import { type WorkDocumentPageGeometry, type WorkDocumentPaperSource } from './work-document-page-size';
2
+ export interface InspectedDocxPageSize {
3
+ status: 'absent' | 'valid' | 'invalid';
4
+ pageGeometry?: WorkDocumentPageGeometry;
5
+ invalidCount: number;
6
+ spoofedCount: number;
7
+ }
8
+ export interface InspectedDocxPaperSource {
9
+ status: 'absent' | 'valid' | 'invalid';
10
+ paperSource?: WorkDocumentPaperSource;
11
+ invalidCount: number;
12
+ spoofedCount: number;
13
+ }
14
+ export declare function inspectDocxPageSize(sectionProperties: Element): InspectedDocxPageSize;
15
+ export declare function inspectDocxPaperSource(sectionProperties: Element): InspectedDocxPaperSource;
16
+ export declare function parseDocxPageGeometry(sectionProperties: Element, fallback?: WorkDocumentPageGeometry): WorkDocumentPageGeometry | null | undefined;
17
+ export declare function parseDocxPaperSource(sectionProperties: Element, fallback?: WorkDocumentPaperSource): WorkDocumentPaperSource | null | undefined;
@@ -0,0 +1,3 @@
1
+ import type { OoxmlPackage } from './work-ooxml-package';
2
+ import type { WorkCompatibilityIssue } from './work-types';
3
+ export declare function diagnoseDocxParagraphBorders(archive: OoxmlPackage, document: Document): Promise<WorkCompatibilityIssue[]>;
@@ -0,0 +1,18 @@
1
+ import type { IParagraphPropertiesOptions } from 'docx';
2
+ import { type DocumentParagraphBorder, type DocumentParagraphBorders } from './work-document-paragraph-borders';
3
+ type ParagraphBorderOptions = Partial<Pick<IParagraphPropertiesOptions, 'border'>>;
4
+ interface DocxParagraphBorderPatch {
5
+ marker: string;
6
+ borders: DocumentParagraphBorders;
7
+ }
8
+ export declare class DocxParagraphBorderPatchCollector {
9
+ readonly patches: DocxParagraphBorderPatch[];
10
+ private nextMarker;
11
+ private readonly usedColors;
12
+ constructor(sourceHtml: string);
13
+ marker(source: unknown): string | null;
14
+ }
15
+ export declare function documentParagraphBordersDocxOptions(element: HTMLElement, collector?: DocxParagraphBorderPatchCollector): ParagraphBorderOptions;
16
+ export declare function patchDocxParagraphBorders(buffer: ArrayBuffer, patches: readonly DocxParagraphBorderPatch[]): Promise<ArrayBuffer>;
17
+ export declare function setDocxBorderAttributes(document: Document, element: Element, border: DocumentParagraphBorder): void;
18
+ export {};
@@ -0,0 +1,24 @@
1
+ import { type DocumentParagraphBorder, type DocumentParagraphBorders } from './work-document-paragraph-borders';
2
+ import { type DocxParagraphStyleSource } from './work-docx-paragraph-styles';
3
+ import { type DocxTableStyleSource } from './work-docx-table-styles';
4
+ import { type DocxThemeResolver, type DocxThemeSource } from './work-docx-theme';
5
+ export interface ImportedDocxParagraphBorderMarker {
6
+ marker: string;
7
+ borders: DocumentParagraphBorders;
8
+ }
9
+ export interface ImportedDocxParagraphBorderMarkers {
10
+ paragraphs: ImportedDocxParagraphBorderMarker[];
11
+ invalidCount: number;
12
+ spoofedCount: number;
13
+ }
14
+ export interface ResolvedDocxParagraphBorders {
15
+ borders: DocumentParagraphBorders | null;
16
+ invalidCount: number;
17
+ spoofedCount: number;
18
+ }
19
+ export declare function markDocxParagraphBorders(document: Document, styleSource?: DocxParagraphStyleSource, themeSource?: DocxThemeSource, tableStyleSource?: DocxTableStyleSource): ImportedDocxParagraphBorderMarkers;
20
+ export declare function resolveDocxParagraphBordersForParagraph(paragraph: Element, styleSource?: DocxParagraphStyleSource, themeSource?: DocxThemeSource, tableStyleSource?: DocxTableStyleSource): ResolvedDocxParagraphBorders;
21
+ export declare function applyImportedDocxParagraphBorderMarkers(document: Document, markers: ImportedDocxParagraphBorderMarkers): void;
22
+ export declare function hasImportedDocxParagraphBorderMarkers(markers: ImportedDocxParagraphBorderMarkers): boolean;
23
+ export declare function parseDirectDocxParagraphBorders(properties: Element, themeSource?: DocxThemeSource): DocumentParagraphBorders | null | undefined;
24
+ export declare function parseDocxBorderElement(element: Element, theme: DocxThemeResolver): DocumentParagraphBorder | null;
@@ -0,0 +1,19 @@
1
+ export type ParsedDocxParagraphDefaultCollapsed = {
2
+ status: 'absent';
3
+ } | {
4
+ status: 'invalid';
5
+ } | {
6
+ status: 'valid';
7
+ value: boolean;
8
+ };
9
+ interface DocxParagraphDefaultCollapsedPatch {
10
+ marker: string;
11
+ value: boolean;
12
+ }
13
+ export declare class DocxParagraphDefaultCollapsedPatchCollector {
14
+ readonly patches: DocxParagraphDefaultCollapsedPatch[];
15
+ register(marker: string, element: HTMLElement): void;
16
+ }
17
+ export declare function parseDocxParagraphDefaultCollapsed(properties: Element): ParsedDocxParagraphDefaultCollapsed;
18
+ export declare function patchDocxParagraphDefaultCollapsed(buffer: ArrayBuffer, patches: readonly DocxParagraphDefaultCollapsedPatch[]): Promise<ArrayBuffer>;
19
+ export {};
@@ -0,0 +1,2 @@
1
+ import type JSZip from 'jszip';
2
+ export declare function preserveDocxParagraphExtensions(generated: JSZip, source: JSZip, generatedPaths: readonly string[], sourcePaths: readonly string[]): Promise<void>;
@@ -0,0 +1,10 @@
1
+ import { type WorkDocumentParagraphIdentity } from './work-document-paragraph-identity';
2
+ export interface ImportedDocxParagraphIdentityMarker extends WorkDocumentParagraphIdentity {
3
+ marker: string;
4
+ }
5
+ export interface ImportedDocxParagraphIdentityMarkers {
6
+ paragraphs: ImportedDocxParagraphIdentityMarker[];
7
+ }
8
+ export declare function markDocxParagraphIdentities(document: Document): ImportedDocxParagraphIdentityMarkers;
9
+ export declare function applyImportedDocxParagraphIdentityMarkers(document: Document, markers: ImportedDocxParagraphIdentityMarkers): void;
10
+ export declare function hasImportedDocxParagraphIdentityMarkers(markers: ImportedDocxParagraphIdentityMarkers): boolean;
@@ -0,0 +1,18 @@
1
+ import { type WorkDocumentParagraphIdentity } from './work-document-paragraph-identity';
2
+ interface DocxParagraphIdentityPatch {
3
+ marker: string;
4
+ identity: WorkDocumentParagraphIdentity;
5
+ target: 'paragraph' | 'tableRow';
6
+ }
7
+ export declare class DocxParagraphIdentityPatchCollector {
8
+ private readonly source;
9
+ readonly patches: DocxParagraphIdentityPatch[];
10
+ private readonly registry;
11
+ private nextMarker;
12
+ constructor(source: string);
13
+ marker(element: HTMLElement): string;
14
+ rowMarker(element: HTMLTableRowElement): string;
15
+ private registerPatch;
16
+ }
17
+ export declare function patchDocxParagraphIdentities(buffer: ArrayBuffer, patches: readonly DocxParagraphIdentityPatch[]): Promise<ArrayBuffer>;
18
+ export {};
@@ -3,8 +3,13 @@ import { type DocxParagraphStyleSource } from './work-docx-paragraph-styles';
3
3
  import { type DocxTableStyleSource } from './work-docx-table-styles';
4
4
  export interface ImportedDocxParagraphPaginationMarker {
5
5
  marker: string;
6
- pagination: Partial<DocumentParagraphPagination>;
6
+ pagination: ImportedDocxParagraphPagination;
7
7
  }
8
+ export type ImportedDocxParagraphPagination = Partial<DocumentParagraphPagination> & {
9
+ contextualSpacing?: boolean;
10
+ defaultCollapsed?: boolean;
11
+ outlineLevel?: number;
12
+ };
8
13
  export interface ImportedDocxParagraphPaginationMarkers {
9
14
  paragraphs: ImportedDocxParagraphPaginationMarker[];
10
15
  }
@@ -0,0 +1,3 @@
1
+ import type { OoxmlPackage } from './work-ooxml-package';
2
+ import type { WorkCompatibilityIssue } from './work-types';
3
+ export declare function diagnoseDocxParagraphShading(archive: OoxmlPackage, document: Document): Promise<WorkCompatibilityIssue[]>;
@@ -0,0 +1,5 @@
1
+ import type { IParagraphPropertiesOptions } from 'docx';
2
+ import type { DocxThemePatchCollector } from './work-docx-theme-reference';
3
+ type ParagraphShadingOptions = Partial<Pick<IParagraphPropertiesOptions, 'shading'>>;
4
+ export declare function documentParagraphShadingDocxOptions(element: HTMLElement, themePatches?: DocxThemePatchCollector): ParagraphShadingOptions;
5
+ export {};
@@ -0,0 +1,18 @@
1
+ import { type DocumentParagraphShading } from './work-document-paragraph-shading';
2
+ import { type DocxParagraphStyleSource } from './work-docx-paragraph-styles';
3
+ import { type DocxTableStyleSource } from './work-docx-table-styles';
4
+ import { type DocxThemeSource } from './work-docx-theme';
5
+ export interface ImportedDocxParagraphShadingMarker {
6
+ marker: string;
7
+ shading: DocumentParagraphShading;
8
+ }
9
+ export interface ImportedDocxParagraphShadingMarkers {
10
+ paragraphs: ImportedDocxParagraphShadingMarker[];
11
+ invalidCount: number;
12
+ spoofedCount: number;
13
+ }
14
+ export declare function markDocxParagraphShading(document: Document, styleSource?: DocxParagraphStyleSource, themeSource?: DocxThemeSource, tableStyleSource?: DocxTableStyleSource): ImportedDocxParagraphShadingMarkers;
15
+ export declare function applyImportedDocxParagraphShadingMarkers(document: Document, markers: ImportedDocxParagraphShadingMarkers): void;
16
+ export declare function hasImportedDocxParagraphShadingMarkers(markers: ImportedDocxParagraphShadingMarkers): boolean;
17
+ export declare function parseDocxParagraphShadingElement(element: Element, themeSource?: DocxThemeSource): DocumentParagraphShading | null;
18
+ export declare function parseDirectDocxParagraphShading(properties: Element, themeSource?: DocxThemeSource): DocumentParagraphShading | null | undefined;
@@ -1,6 +1,7 @@
1
1
  import { type DocxParagraphStyleSource } from './work-docx-paragraph-styles';
2
2
  import { type DocxThemeSource } from './work-docx-theme';
3
3
  import { type DocxTableStyleSource } from './work-docx-table-styles';
4
+ import { type DocxThemeColorReference } from './work-docx-theme-reference';
4
5
  export interface ImportedDocxRunFormatting {
5
6
  bold?: boolean;
6
7
  italic?: boolean;
@@ -12,6 +13,8 @@ export interface ImportedDocxRunFormatting {
12
13
  fontSize?: number;
13
14
  color?: string;
14
15
  backgroundColor?: string;
16
+ themeColor?: DocxThemeColorReference;
17
+ themeFill?: DocxThemeColorReference;
15
18
  }
16
19
  export interface ImportedDocxRunFormattingMarker {
17
20
  startMarker: string;
@@ -0,0 +1,10 @@
1
+ import type JSZip from 'jszip';
2
+ /**
3
+ * Merges passive extension markup from source settings into generated settings.
4
+ *
5
+ * WordprocessingML settings and relationship-bound markup remain generated-only.
6
+ * The source contribution is limited to ignorable extension attributes/elements
7
+ * and structurally valid, non-conflicting mc:AlternateContent blocks, plus a
8
+ * strictly validated color-scheme mapping required by preserved theme colors.
9
+ */
10
+ export declare function preserveDocxSettingsExtensions(generated: JSZip, source: JSZip, generatedPath?: string, sourcePath?: string): Promise<void>;
@@ -0,0 +1,16 @@
1
+ export declare const XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
2
+ export declare const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
3
+ export declare function declareInheritedNamespaces(importedRoot: Element, sourceRoot: Element): void;
4
+ export declare function collectRetainedNamespaces(root: Element, retained: Set<string>): void;
5
+ /** Clones XML without relying on DOM importNode prefix preservation. */
6
+ export declare function cloneXmlElement(document: Document, source: Element): Element;
7
+ export declare function xmlNamespaceUri(element: Element, prefix: string): string | null;
8
+ export declare function xmlDeclaredPrefix(root: Element, namespace: string): string | null;
9
+ export declare function xmlAttributeNamespace(element: Element, item: Attr): string | null;
10
+ export declare function xmlAttributePrefix(item: Attr): string | null;
11
+ export declare function xmlAttributeLocalName(item: Attr): string;
12
+ export declare function hasXmlAttribute(element: Element, namespace: string, localName: string): boolean;
13
+ export declare function hasUnexpectedXmlAttributes(element: Element, allowedUnqualified: ReadonlySet<string>): boolean;
14
+ export declare function hasNonWhitespaceXmlText(element: Element): boolean;
15
+ export declare function isStructurallyValidAlternateContent(element: Element): boolean;
16
+ export declare function assertXmlRoot(root: Element, localName: string, namespaces: ReadonlySet<string>, message: string): void;
@@ -0,0 +1,2 @@
1
+ import type JSZip from 'jszip';
2
+ export declare function preserveDocxStyleExtensions(generated: JSZip, source: JSZip, generatedPath?: string, sourcePath?: string): Promise<void>;
@@ -1,4 +1,5 @@
1
1
  import type { ITableCellOptions } from 'docx';
2
+ import { type DocxThemePatchCollector } from './work-docx-theme-reference';
2
3
  type TableCellPresentationOptions = Partial<Pick<ITableCellOptions, 'borders' | 'margins' | 'shading' | 'verticalAlign'>>;
3
- export declare function documentTableCellDocxOptions(cell: HTMLTableCellElement, docx: typeof import('docx')): TableCellPresentationOptions;
4
+ export declare function documentTableCellDocxOptions(cell: HTMLTableCellElement, docx: typeof import('docx'), themePatches?: DocxThemePatchCollector): TableCellPresentationOptions;
4
5
  export {};
@@ -2,11 +2,13 @@ import { type DocumentTableBorderEdge } from './work-document-table-borders';
2
2
  import { type DocxThemeSource } from './work-docx-theme';
3
3
  import { type DocxTableStyleSource } from './work-docx-table-styles';
4
4
  import { type DocumentTableCellMarginOverrides } from './work-document-table-geometry';
5
+ import { type DocxThemeColorReference } from './work-docx-theme-reference';
5
6
  export type ImportedDocxTableCellVerticalAlign = 'top' | 'middle' | 'bottom';
6
7
  export type ImportedDocxTableCellBorderStyle = 'solid' | 'dashed' | 'dotted' | 'double' | 'none';
7
8
  export interface ImportedDocxTableCellMarker {
8
9
  marker: string;
9
10
  backgroundColor?: string;
11
+ themeFill?: DocxThemeColorReference;
10
12
  verticalAlign?: ImportedDocxTableCellVerticalAlign;
11
13
  borders?: ImportedDocxTableCellBorders;
12
14
  margins?: DocumentTableCellMarginOverrides;
@@ -18,6 +20,7 @@ interface ImportedDocxCellBorder {
18
20
  color: string;
19
21
  style: ImportedDocxTableCellBorderStyle;
20
22
  width: number;
23
+ theme?: DocxThemeColorReference;
21
24
  }
22
25
  type ImportedDocxTableCellBorders = Partial<Record<DocumentTableBorderEdge, ImportedDocxCellBorder>>;
23
26
  export declare function markDocxTableCells(document: Document, themeSource?: DocxThemeSource, tableStyleSource?: DocxTableStyleSource): ImportedDocxTableCellMarkers;
@@ -0,0 +1,2 @@
1
+ import type JSZip from 'jszip';
2
+ export declare function preserveDocxTableExtensions(generated: JSZip, source: JSZip, generatedPaths: readonly string[], sourcePaths: readonly string[]): Promise<void>;
@@ -2,8 +2,10 @@ export interface ImportedDocxTableRowMarker {
2
2
  marker: string;
3
3
  cantSplit?: boolean;
4
4
  repeatHeader?: boolean;
5
+ rowId?: string;
5
6
  rowHeight?: number;
6
7
  rowHeightRule?: 'atLeast' | 'exact';
8
+ rowTextId?: string;
7
9
  }
8
10
  export interface ImportedDocxTableRowMarkers {
9
11
  rows: ImportedDocxTableRowMarker[];
@@ -4,6 +4,7 @@ export interface ImportedDocxTableSizingMarker {
4
4
  marker: string;
5
5
  geometry: DocumentTableGeometry;
6
6
  columnWidths: number[];
7
+ columnPercentages: number[];
7
8
  }
8
9
  export interface ImportedDocxTableSizingMarkers {
9
10
  tables: ImportedDocxTableSizingMarker[];
@@ -0,0 +1,23 @@
1
+ export interface DocxThemeColorReference {
2
+ theme: string;
3
+ resolved: string;
4
+ tint?: string;
5
+ shade?: string;
6
+ }
7
+ type DocxThemePatchKind = 'color' | 'fill' | 'border' | 'shadingColor';
8
+ interface DocxThemePatch {
9
+ kind: DocxThemePatchKind;
10
+ marker: string;
11
+ reference: DocxThemeColorReference;
12
+ }
13
+ export declare class DocxThemePatchCollector {
14
+ readonly patches: DocxThemePatch[];
15
+ private nextMarker;
16
+ private readonly usedColors;
17
+ constructor(sourceHtml: string);
18
+ marker(kind: DocxThemePatchKind, reference: DocxThemeColorReference | null, currentColor: string | null): string | null;
19
+ }
20
+ export declare function serializeDocxThemeReference(reference: DocxThemeColorReference | null): string | undefined;
21
+ export declare function parseDocxThemeReference(value: string | null | undefined): DocxThemeColorReference | null;
22
+ export declare function patchDocxThemeReferences(buffer: ArrayBuffer, patches: readonly DocxThemePatch[]): Promise<ArrayBuffer>;
23
+ export {};
@@ -1,9 +1,12 @@
1
1
  export interface DocxThemeResolver {
2
2
  colors: ReadonlyMap<string, string>;
3
+ colorMapping?: ReadonlyMap<string, string>;
3
4
  fonts: ReadonlyMap<string, string>;
4
5
  }
5
6
  export type DocxThemeSource = Document | DocxThemeResolver | null | undefined;
6
- export declare function createDocxThemeResolver(themeDocument?: Document | null): DocxThemeResolver;
7
+ export declare const DOCX_COLOR_SCHEME_MAPPING_ATTRIBUTES: Map<string, string>;
8
+ export declare function createDocxThemeResolver(themeDocument?: Document | null, settingsDocument?: Document | null): DocxThemeResolver;
7
9
  export declare function resolveDocxThemeResolver(source: DocxThemeSource): DocxThemeResolver;
8
10
  export declare function docxThemeFont(resolver: DocxThemeResolver, key: string | null): string | undefined;
9
11
  export declare function docxThemeColor(resolver: DocxThemeResolver, key: string | null, tint?: string | null, shade?: string | null): string | undefined;
12
+ export declare function parseDocxColorSchemeMappingElement(element: Element | undefined): ReadonlyMap<string, string> | null;
@@ -0,0 +1,12 @@
1
+ export declare const STRICT_WORDPROCESSING_NAMESPACE = "http://purl.oclc.org/ooxml/wordprocessingml/main";
2
+ export declare function parseDocxTwipsMeasure(source: string, options: {
3
+ minimum: number;
4
+ maximum: number;
5
+ signed: boolean;
6
+ strict: boolean;
7
+ }): number | null;
8
+ export declare function parseBoundedDocxInteger(source: string, options: {
9
+ minimum: number;
10
+ maximum: number;
11
+ signed?: boolean;
12
+ }): number | null;
@@ -0,0 +1 @@
1
+ export declare const WORK_IMPORT_ACCEPT: string;
@@ -1,6 +1,6 @@
1
+ export { WORK_IMPORT_ACCEPT } from './work-file-contract';
1
2
  import { type WorkPresentationExportOptions } from './work-presentation-file-io';
2
3
  import { type WorkArtifact, type WorkArtifactKind } from './work-types';
3
- export declare const WORK_IMPORT_ACCEPT: string;
4
4
  export type WorkArtifactExportOptions = WorkPresentationExportOptions;
5
5
  export declare function importWorkFile(file: File): Promise<WorkArtifact>;
6
6
  export declare function exportWorkArtifact(artifact: WorkArtifact, options?: WorkArtifactExportOptions): Promise<void>;
@@ -10,7 +10,10 @@ declare module '@tiptap/core' {
10
10
  }
11
11
  }
12
12
  export declare const WorkMarkdown: Extension<any, any>;
13
- export declare function createWorkMarkdownExtensions(): Extensions;
13
+ export interface WorkMarkdownExtensionOptions {
14
+ collaborative?: boolean;
15
+ }
16
+ export declare function createWorkMarkdownExtensions(options?: WorkMarkdownExtensionOptions): Extensions;
14
17
  export declare function markdownTaskCheckboxLabel(node: {
15
18
  attrs: {
16
19
  checked?: boolean;
@@ -0,0 +1,12 @@
1
+ import { type DocxSourceNumberingIdentity } from './work-docx-numbering-extension-preservation';
2
+ export interface DocxSourcePackagePreservationOptions {
3
+ numberingIdentities?: readonly (DocxSourceNumberingIdentity | null)[];
4
+ }
5
+ /**
6
+ * Copies safe source-only DOCX parts into a newly generated package.
7
+ *
8
+ * Generated parts remain authoritative. Digital signatures are invalid after
9
+ * an edit, and macro, ActiveX, and custom-ribbon parts are intentionally not
10
+ * propagated into a macro-free DOCX export.
11
+ */
12
+ export declare function preserveDocxSourcePackage(generatedBuffer: ArrayBuffer, sourceBuffer: ArrayBuffer, options?: DocxSourcePackagePreservationOptions): Promise<ArrayBuffer>;
@@ -0,0 +1,6 @@
1
+ export declare function isSafeOpcPartPath(path: string): boolean;
2
+ export declare function isExcludedDocxPart(path: string): boolean;
3
+ export declare function isRegeneratedDocxNoteCommentPart(path: string): boolean;
4
+ export declare function isRegeneratedDocxNoteCommentContentType(type: string | undefined): boolean;
5
+ export declare function isExcludedRelationshipType(type: string): boolean;
6
+ export declare function isExcludedDocxContentType(type: string | undefined): boolean;
@@ -0,0 +1,10 @@
1
+ import type JSZip from 'jszip';
2
+ export interface PreservedRelationshipReference {
3
+ id: string;
4
+ target: string;
5
+ targetMode?: string;
6
+ type: string;
7
+ }
8
+ export type PreservedRelationshipReferences = Map<string, Map<string, PreservedRelationshipReference>>;
9
+ export declare function preserveDocxRelationships(generated: JSZip, source: JSZip, sourcePaths: readonly string[], finalPartPaths: ReadonlySet<string>, generatedPartPaths: ReadonlySet<string>, generatedByLower: Map<string, string>): Promise<PreservedRelationshipReferences>;
10
+ export declare function isRelationshipsPart(path: string): boolean;
@@ -0,0 +1,2 @@
1
+ export declare function decodeXmlBytes(bytes: Uint8Array, label: string): string;
2
+ export declare function serializeUtf8Xml(document: Document): string;
@@ -1,16 +1,26 @@
1
1
  import type { WorkArtifact, WorkSpreadsheetPaperSize } from './work-types';
2
+ import { type WorkLiveDocumentCapturePage } from './work-document-page-capture';
2
3
  type PdfPageSize = WorkSpreadsheetPaperSize;
3
4
  export interface WorkPdfExportOptions {
4
5
  pageIndexes?: number[];
5
6
  }
7
+ export interface WorkLiveDocumentPdfPage extends WorkLiveDocumentCapturePage {
8
+ orientation: 'portrait' | 'landscape';
9
+ pageHeightPoints: number;
10
+ pageSize: PdfPageSize;
11
+ pageWidthPoints: number;
12
+ }
6
13
  export interface WorkLiveDocumentPdfSurface {
7
14
  element: HTMLElement;
8
15
  orientation: 'portrait' | 'landscape';
9
16
  pageCount: number;
10
17
  pageGap: number;
11
18
  pageHeight: number;
19
+ pageHeightPoints: number;
12
20
  pageSize: PdfPageSize;
13
21
  pageWidth: number;
22
+ pageWidthPoints: number;
23
+ pages: WorkLiveDocumentPdfPage[];
14
24
  }
15
25
  export declare function exportWorkArtifactPdf(artifact: WorkArtifact, options?: WorkPdfExportOptions): Promise<void>;
16
26
  export declare function workLiveDocumentPdfSurfaceForExport(artifactId: string): WorkLiveDocumentPdfSurface | null;
@@ -2,3 +2,5 @@ import type { WorkArtifact } from './work-types';
2
2
  export declare function rememberWorkSourceBlob(artifactId: string, source: Blob): void;
3
3
  export declare function forgetWorkSourceBlob(artifactId: string): void;
4
4
  export declare function readWorkSourceBlob(artifact: WorkArtifact): Promise<Blob>;
5
+ export declare function readVerifiedWorkSourceBytes(artifact: WorkArtifact): Promise<ArrayBuffer>;
6
+ export declare function workSourceFingerprint(bytes: ArrayBuffer): Promise<string>;
@@ -1,4 +1,7 @@
1
1
  import type { Sheet } from '@fortune-sheet/core';
2
+ import type { WorkDocumentPageBorders } from './work-document-page-borders';
3
+ import type { WorkDocumentPageMargins } from './work-document-page-margins';
4
+ import type { WorkDocumentPageGeometry, WorkDocumentPaperSource } from './work-document-page-size';
2
5
  import type { WorkSpreadsheetChartLayout } from './work-spreadsheet-chart-layout';
3
6
  import type { WorkSpreadsheetChart, WorkSpreadsheetChartAxes, WorkSpreadsheetChartAxis, WorkSpreadsheetChartSeriesStyle, WorkSpreadsheetErrorBars, WorkSpreadsheetImage, WorkSpreadsheetTrendline } from './work-spreadsheet-chart-types';
4
7
  export * from './work-spreadsheet-chart-types';
@@ -41,8 +44,9 @@ export interface WorkDocumentGrid {
41
44
  type: WorkDocumentGridType;
42
45
  linePitch: number;
43
46
  }
47
+ export type WorkDocumentPaperSize = 'a3' | 'a4' | 'a5' | 'letter' | 'legal' | 'tabloid' | 'custom';
44
48
  export interface WorkDocumentSectionLayout {
45
- pageSize: 'a4' | 'letter';
49
+ pageSize: WorkDocumentPaperSize;
46
50
  orientation: 'portrait' | 'landscape';
47
51
  margins: WorkDocumentMargins;
48
52
  columns: WorkDocumentColumns;
@@ -53,6 +57,10 @@ export interface WorkDocumentSectionLayout {
53
57
  pageNumberStart?: number;
54
58
  pageChrome?: WorkDocumentPageChrome;
55
59
  documentGrid?: WorkDocumentGrid;
60
+ pageBorders?: WorkDocumentPageBorders;
61
+ pageMargins?: WorkDocumentPageMargins;
62
+ pageGeometry?: WorkDocumentPageGeometry;
63
+ paperSource?: WorkDocumentPaperSource;
56
64
  }
57
65
  export type WorkDocumentAttributeValue = string | number | boolean | null | WorkDocumentAttributeValue[] | {
58
66
  [key: string]: WorkDocumentAttributeValue;
@@ -79,7 +87,7 @@ export interface WorkDocumentContent {
79
87
  type: 'document';
80
88
  html: string;
81
89
  model?: WorkDocumentModel;
82
- pageSize: 'a4' | 'letter';
90
+ pageSize: WorkDocumentPaperSize;
83
91
  pageColor?: string;
84
92
  orientation?: 'portrait' | 'landscape';
85
93
  margins?: WorkDocumentMargins;
@@ -89,6 +97,10 @@ export interface WorkDocumentContent {
89
97
  showPageNumbers?: boolean;
90
98
  pageNumberStart?: number;
91
99
  pageChrome?: WorkDocumentPageChrome;
100
+ pageBorders?: WorkDocumentPageBorders;
101
+ pageMargins?: WorkDocumentPageMargins;
102
+ pageGeometry?: WorkDocumentPageGeometry;
103
+ paperSource?: WorkDocumentPaperSource;
92
104
  trackChanges?: boolean;
93
105
  comments?: WorkDocumentComment[];
94
106
  bibliography?: WorkDocumentBibliography;
@@ -481,6 +493,7 @@ export interface WorkSourceFile {
481
493
  contentType: string;
482
494
  size: number;
483
495
  updatedAt: number;
496
+ fingerprint?: string;
484
497
  }
485
498
  export interface WorkFolder {
486
499
  id: string;
@@ -4,6 +4,7 @@ export interface OfficeKernelLayoutInput {
4
4
  documentRevision: number;
5
5
  startPageIndex?: number;
6
6
  page: OfficeKernelLayoutRequest['page'];
7
+ pageStyles?: OfficeKernelLayoutRequest['pageStyles'];
7
8
  blocks: OfficeKernelLayoutRequest['blocks'];
8
9
  }
9
10
  export interface OfficeKernelPresentationGeometryInput {