@gct-paas/word 0.1.14 → 0.1.16

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 (259) hide show
  1. package/README.md +274 -15
  2. package/dist/base/avatar/index.d.ts +1 -0
  3. package/dist/base/avatar/src/Avatar.vue.d.ts +9 -0
  4. package/dist/base/avatar/src/utils/useFile.d.ts +3 -0
  5. package/dist/base/breadcrumb/src/breadcrumb-item.vue.d.ts +1 -1
  6. package/dist/base/color-picker/index.d.ts +1 -0
  7. package/dist/base/color-picker/src/ColorPicker.vue.d.ts +88 -0
  8. package/dist/base/color-picker/src/constant/index.d.ts +6 -0
  9. package/dist/base/divider/index.d.ts +1 -0
  10. package/dist/base/divider/src/divider.d.ts +7 -0
  11. package/dist/base/divider/src/divider.vue.d.ts +19 -0
  12. package/dist/base/dropdown/src/dropdown-basic-select.vue.d.ts +2 -2
  13. package/dist/base/empty/index.d.ts +1 -0
  14. package/dist/base/empty/src/empty.d.ts +8 -0
  15. package/dist/base/empty/src/empty.vue.d.ts +9 -0
  16. package/dist/base/index.d.ts +5 -0
  17. package/dist/base/input/index.d.ts +1 -0
  18. package/dist/base/input/src/input-number.vue.d.ts +24 -2
  19. package/dist/base/input/src/input.vue.d.ts +7 -7
  20. package/dist/base/input/src/text-area.vue.d.ts +65 -0
  21. package/dist/base/modal/src/ModalRoot.vue.d.ts +1 -1
  22. package/dist/base/select/src/basic-select.vue.d.ts +4 -3
  23. package/dist/base/slider/index.d.ts +1 -0
  24. package/dist/base/slider/src/slider.vue.d.ts +22 -0
  25. package/dist/base/tree-select/src/tree-select.vue.d.ts +2 -2
  26. package/dist/base/utils/asset-helper-util.d.ts +23 -2
  27. package/dist/capabilities/panel/config/types.d.ts +2 -1
  28. package/dist/capabilities/paper-widget-manifest/types.d.ts +13 -2
  29. package/dist/core/command/base/SetStyleBase.d.ts +4 -0
  30. package/dist/core/command/commands/Delete2DTable.d.ts +12 -0
  31. package/dist/core/command/commands/DeleteCheckTable.d.ts +12 -0
  32. package/dist/core/command/commands/DeleteDataGroup2D.d.ts +12 -0
  33. package/dist/core/command/commands/DeleteTableHeader.d.ts +12 -0
  34. package/dist/core/command/commands/InsertFloatingOverlay.d.ts +9 -0
  35. package/dist/core/command/commands/InsertPaperWidget.d.ts +2 -42
  36. package/dist/core/command/commands/ResizeOverlayLayout.d.ts +7 -0
  37. package/dist/core/command/commands/Set2DTable.d.ts +7 -0
  38. package/dist/core/command/commands/SetCheckTable.d.ts +7 -0
  39. package/dist/core/command/commands/SetDataGroup2D.d.ts +25 -0
  40. package/dist/core/command/commands/SetHeaderFooterConfig.d.ts +11 -0
  41. package/dist/core/command/commands/SetSubTableHeader.d.ts +8 -0
  42. package/dist/core/command/commands/SetTableHeader.d.ts +7 -0
  43. package/dist/core/command/types.d.ts +68 -3
  44. package/dist/core/constants/index.d.ts +7 -0
  45. package/dist/core/cursor/CursorController.d.ts +15 -0
  46. package/dist/core/cursor/hit/OverlayLayoutHitHandler.d.ts +9 -0
  47. package/dist/core/cursor/hit/types.d.ts +17 -0
  48. package/dist/core/cursor/layout/baseMeta.d.ts +1 -1
  49. package/dist/core/data/DataManager.d.ts +5 -0
  50. package/dist/core/event/DocumentEventBridge.d.ts +5 -1
  51. package/dist/core/event/EventManager.d.ts +1 -1
  52. package/dist/core/event/handlers/InteractionHandler.d.ts +3 -0
  53. package/dist/core/event/handlers/KonvaHandler.d.ts +3 -0
  54. package/dist/core/index.d.ts +8 -4
  55. package/dist/core/interaction/InteractionController.d.ts +8 -1
  56. package/dist/core/interaction/InteractionPolicy.d.ts +2 -0
  57. package/dist/core/interaction/types.d.ts +8 -0
  58. package/dist/core/interaction/useInteraction.d.ts +7 -3
  59. package/dist/core/layout/LayoutContext.d.ts +13 -3
  60. package/dist/core/layout/LayoutManager.d.ts +14 -0
  61. package/dist/core/layout/LayoutMapper.d.ts +0 -2
  62. package/dist/core/layout/handlers/PageWidgetHandler.d.ts +5 -0
  63. package/dist/core/layout/handlers/TextHandler.d.ts +11 -0
  64. package/dist/core/layout/handlers/base/BaseHandler.d.ts +26 -0
  65. package/dist/core/layout/handlers/fields/{ImgHandler.d.ts → ImageHandler.d.ts} +1 -1
  66. package/dist/core/layout/handlers/fields/index.d.ts +1 -1
  67. package/dist/core/layout/handlers/index.d.ts +1 -0
  68. package/dist/core/layout/handlers/pageWidgets/BarcodeHandler.d.ts +11 -0
  69. package/dist/core/layout/handlers/pageWidgets/DefaultHandler.d.ts +4 -0
  70. package/dist/core/layout/handlers/pageWidgets/DiagonalHandler.d.ts +4 -0
  71. package/dist/core/layout/handlers/pageWidgets/ImageHandler.d.ts +4 -0
  72. package/dist/core/layout/handlers/pageWidgets/LineHandler.d.ts +4 -0
  73. package/dist/core/layout/handlers/pageWidgets/PaginationHandler.d.ts +7 -0
  74. package/dist/core/layout/handlers/pageWidgets/QrCodeHandler.d.ts +4 -0
  75. package/dist/core/layout/handlers/pageWidgets/SerialNumberHandler.d.ts +4 -0
  76. package/dist/core/layout/handlers/pageWidgets/index.d.ts +8 -0
  77. package/dist/core/layout/logic/LayoutBuilder.d.ts +7 -3
  78. package/dist/core/layout/logic/ModelBuilder.d.ts +2 -1
  79. package/dist/core/layout/providers/TableInfoProvider.d.ts +8 -2
  80. package/dist/core/layout/types/index.d.ts +7 -0
  81. package/dist/core/model/DocModel.d.ts +20 -0
  82. package/dist/core/model/base/ModelNode.d.ts +4 -0
  83. package/dist/core/model/base/RefManager.d.ts +50 -0
  84. package/dist/core/model/base/index.d.ts +1 -0
  85. package/dist/core/model/document/Wbackground.d.ts +22 -0
  86. package/dist/core/model/document/Wdocument.d.ts +7 -1
  87. package/dist/core/model/document/Wp.d.ts +8 -1
  88. package/dist/core/model/document/WrImage.d.ts +2 -0
  89. package/dist/core/model/document/WrPageWidget.d.ts +8 -0
  90. package/dist/core/model/document/WrText.d.ts +9 -2
  91. package/dist/core/model/document/WsecPr.d.ts +66 -1
  92. package/dist/core/model/document/Wtbl/Calculation.d.ts +12 -0
  93. package/dist/core/model/document/Wtbl/RegionManager.d.ts +13 -1
  94. package/dist/core/model/document/Wtbl/RowColumnOps.d.ts +6 -0
  95. package/dist/core/model/document/Wtbl/Serialization.d.ts +12 -0
  96. package/dist/core/model/document/Wtbl.d.ts +22 -1
  97. package/dist/core/model/document/Wtc.d.ts +54 -4
  98. package/dist/core/model/document/WtrPr.d.ts +1 -0
  99. package/dist/core/model/document/index.d.ts +2 -0
  100. package/dist/core/model/footers/Wfooter.d.ts +40 -0
  101. package/dist/core/model/footers/Wfooters.d.ts +42 -0
  102. package/dist/core/model/headers/Wheader.d.ts +40 -0
  103. package/dist/core/model/headers/Wheaders.d.ts +45 -0
  104. package/dist/core/model/logic/CheckTableRegion.d.ts +44 -0
  105. package/dist/core/model/logic/DataGroup2DRegion.d.ts +12 -0
  106. package/dist/core/model/logic/SubTableHeaderRegion.d.ts +22 -0
  107. package/dist/core/model/logic/TableHeaderRegion.d.ts +16 -0
  108. package/dist/core/model/logic/_2DTableRegion.d.ts +44 -0
  109. package/dist/core/model/logic/index.d.ts +14 -1
  110. package/dist/core/model/overlays/Wlayout.d.ts +70 -0
  111. package/dist/core/model/overlays/Woverlay.d.ts +41 -0
  112. package/dist/core/model/overlays/Woverlays.d.ts +45 -0
  113. package/dist/core/model/settings/Wsettings.d.ts +47 -0
  114. package/dist/core/model/templates/footer.template.d.ts +75 -0
  115. package/dist/core/model/templates/header.template.d.ts +75 -0
  116. package/dist/core/model/templates/layout.template.d.ts +66 -0
  117. package/dist/core/model/templates/overlay.template.d.ts +22 -0
  118. package/dist/core/model/templates/paragraph.template.d.ts +46 -0
  119. package/dist/core/model/templates/trPr.template.d.ts +19 -0
  120. package/dist/core/model/types/model.d.ts +3 -0
  121. package/dist/core/model/types/region.d.ts +1 -0
  122. package/dist/core/sdk/DocPubApiContext.d.ts +14 -12
  123. package/dist/core/sdk/createDoc.d.ts +1 -3
  124. package/dist/core/sdk/usePagesToPdf.d.ts +13 -4
  125. package/dist/core/utils/expand.d.ts +29 -4
  126. package/dist/core/utils/index.d.ts +4 -0
  127. package/dist/core/utils/unit-converter-util.d.ts +12 -2
  128. package/dist/core/view/Doc.d.ts +14 -3
  129. package/dist/core/view/Page.d.ts +50 -1
  130. package/dist/core/view/Paragraph.d.ts +2 -0
  131. package/dist/core/view/Section.d.ts +26 -1
  132. package/dist/core/view/Table.d.ts +12 -0
  133. package/dist/core/view/TableCell.d.ts +7 -3
  134. package/dist/core/view/TableRow.d.ts +2 -0
  135. package/dist/core/view/base/BandContainer.d.ts +49 -0
  136. package/dist/core/view/base/LayoutGroup.d.ts +11 -0
  137. package/dist/core/view/base/LayoutNode.d.ts +3 -0
  138. package/dist/core/view/base/OverlayContainer.d.ts +31 -0
  139. package/dist/core/view/base/OverlayLayout.d.ts +19 -0
  140. package/dist/core/view/base/index.d.ts +2 -0
  141. package/dist/core/view/runs/ImageRun.d.ts +9 -0
  142. package/dist/core/view/runs/ImageWidget.d.ts +12 -6
  143. package/dist/core/view/runs/TextRun.d.ts +26 -3
  144. package/dist/core/view/runs/TextWidget.d.ts +14 -7
  145. package/dist/core/view/utils/EventUtil.d.ts +22 -0
  146. package/dist/core/view/utils/TextUtil.d.ts +47 -0
  147. package/dist/core/widget/widget-meta.d.ts +5 -0
  148. package/dist/domain/active/active-types.d.ts +12 -6
  149. package/dist/domain/constants/enum.d.ts +34 -0
  150. package/dist/domain/constants/options.d.ts +4 -0
  151. package/dist/domain/field/field-props-schema-type.d.ts +1 -1
  152. package/dist/domain/paper-widget/paper-widget-props-schema-type.d.ts +2 -0
  153. package/dist/domain/paper-widget/paper-widget-type.d.ts +10 -141
  154. package/dist/domain/paper-widget/widget-binding.d.ts +8 -0
  155. package/dist/domain/widget/component-type.d.ts +6 -2
  156. package/dist/index.d.ts +5 -10
  157. package/dist/index.es.js +57077 -46931
  158. package/dist/runtime/_register_/composables/panel/useActivePanel.d.ts +2 -2
  159. package/dist/runtime/_register_/context/DesignSuiteContext.d.ts +2 -0
  160. package/dist/runtime/canvas/__common__/context-menu/index.vue.d.ts +3 -1
  161. package/dist/runtime/canvas/doc-layout.vue.d.ts +11 -5
  162. package/dist/runtime/canvas/inline-image/resize-box.vue.d.ts +28 -7
  163. package/dist/{suites/edhr/panel-schema/paper-widget/widgets/barcode.vue.d.ts → runtime/canvas/node/overlay-layout.vue.d.ts} +2 -3
  164. package/dist/{suites/edhr/panel-schema/paper-widget/widgets/qrcode.vue.d.ts → runtime/canvas/overlay/page-overlay-group.vue.d.ts} +4 -3
  165. package/dist/{suites/edhr/panel-schema/paper-widget/widgets/diagonal.vue.d.ts → runtime/canvas/paper/header-footer-guides.vue.d.ts} +2 -3
  166. package/dist/runtime/canvas/paper/inner-corner-mark.vue.d.ts +2 -5
  167. package/dist/runtime/canvas/paper/paper-group.vue.d.ts +2 -1
  168. package/dist/{suites/edhr/panel-schema/paper-widget/widgets/serialnumber.vue.d.ts → runtime/canvas/paper/paper-hit-rect.vue.d.ts} +3 -3
  169. package/dist/runtime/canvas/table/design/table-structure-overlay/dynamic-label.vue.d.ts +1 -0
  170. package/dist/runtime/canvas/table/design/table-structure-overlay/placeholder-label.vue.d.ts +1 -0
  171. package/dist/runtime/canvas/table/utils/index.d.ts +21 -3
  172. package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +5 -1
  173. package/dist/runtime/designer/main/editable-canvas.vue.d.ts +6 -3
  174. package/dist/runtime/designer/ribbon/components/set-table-header-form-modal.vue.d.ts +18 -0
  175. package/dist/runtime/designer/ribbon/components/sub-table-form-modal.vue.d.ts +4 -1
  176. package/dist/runtime/factories/usePwRenderData.d.ts +13 -0
  177. package/dist/runtime/factories/useRenderData.d.ts +1 -1
  178. package/dist/runtime/interface/change-diff.d.ts +26 -0
  179. package/dist/runtime/interface/render.d.ts +18 -0
  180. package/dist/runtime/renderer/annotation/annotation-comment-item.vue.d.ts +13 -0
  181. package/dist/runtime/renderer/annotation/annotation-comment-layer.vue.d.ts +2 -0
  182. package/dist/runtime/renderer/dropdowns/components/tables/rdo-table-dropdown.vue.d.ts +16 -16
  183. package/dist/runtime/renderer/dropdowns/components/tables/table-dropdown.vue.d.ts +16 -16
  184. package/dist/runtime/renderer/main/preview-canvas.vue.d.ts +8 -4
  185. package/dist/sdk/doc-runtime/composables/useDocController.d.ts +17 -0
  186. package/dist/sdk/doc-runtime/composables/useDocOperations.d.ts +41 -0
  187. package/dist/sdk/doc-runtime/composables/useDocRuntimeProvider.d.ts +19 -0
  188. package/dist/sdk/doc-runtime/composables/useDocSuite.d.ts +20 -0
  189. package/dist/sdk/doc-runtime/factories/document-initializer.d.ts +10 -0
  190. package/dist/sdk/doc-runtime/factories/document-request-strategy.d.ts +3 -0
  191. package/dist/sdk/doc-runtime/factories/runtime-json-builder.d.ts +17 -0
  192. package/dist/{runtime → sdk/doc-runtime}/factories/useDocumentFactory.d.ts +33 -6
  193. package/dist/sdk/doc-runtime/useWord.d.ts +16 -0
  194. package/dist/sdk/engine/index.d.ts +14 -0
  195. package/dist/sdk/index.d.ts +14 -0
  196. package/dist/sdk/plugins/index.d.ts +15 -0
  197. package/dist/sdk/setup.d.ts +55 -0
  198. package/dist/sdk/types/index.d.ts +154 -0
  199. package/dist/sdk/vue/index.d.ts +7 -0
  200. package/dist/sdk/vue/layouts/doc-design-layout.d.ts +7 -0
  201. package/dist/sdk/vue/layouts/doc-design-layout.vue.d.ts +10 -0
  202. package/dist/{runtime/renderer → sdk/vue/layouts}/doc-render-layout.vue.d.ts +17 -11
  203. package/dist/suites/edhr/field-manifest/_common_/basic.d.ts +6 -0
  204. package/dist/suites/edhr/index.d.ts +3 -2
  205. package/dist/suites/edhr/panel-config/index.d.ts +2 -1
  206. package/dist/suites/edhr/panel-schema/2d-table/2d-table.basic.d.ts +14 -0
  207. package/dist/suites/edhr/panel-schema/{paper-widget/widgets/editors/diagonal-name-editor.vue.d.ts → 2d-table/_2DTablePanel.vue.d.ts} +4 -5
  208. package/dist/suites/edhr/panel-schema/{paper-widget/widgets/image.vue.d.ts → check-table/CheckTablePanel.vue.d.ts} +5 -5
  209. package/dist/suites/edhr/panel-schema/check-table/check-table.basic.d.ts +14 -0
  210. package/dist/suites/edhr/panel-schema/data-group-2d/DataGroup2DPanel.vue.d.ts +8 -0
  211. package/dist/suites/edhr/panel-schema/data-group-2d/data-group-2d.basic.d.ts +14 -0
  212. package/dist/suites/edhr/panel-schema/data-init/utils/index.d.ts +26 -2
  213. package/dist/suites/edhr/panel-schema/data-init/utils/json-schema.d.ts +18 -0
  214. package/dist/suites/edhr/panel-schema/data-load/DataLoadPanel.vue.d.ts +2 -0
  215. package/dist/suites/edhr/panel-schema/data-load/ai-tmpl/ai-tmpl-editor.vue.d.ts +6 -0
  216. package/dist/suites/edhr/panel-schema/data-load/ai-tmpl/identify-param-card.vue.d.ts +14 -0
  217. package/dist/suites/edhr/panel-schema/data-load/common/add-tmpl-btn.vue.d.ts +16 -0
  218. package/dist/suites/edhr/panel-schema/data-load/common/decimal-slider.vue.d.ts +21 -0
  219. package/dist/suites/edhr/panel-schema/data-load/common/form-field-select.vue.d.ts +19 -0
  220. package/dist/suites/edhr/panel-schema/data-load/common/icon-tooltip.vue.d.ts +10 -0
  221. package/dist/suites/edhr/panel-schema/data-load/common/remove-icon.vue.d.ts +7 -0
  222. package/dist/suites/edhr/panel-schema/data-load/common/tmpl-card.vue.d.ts +25 -0
  223. package/dist/suites/edhr/panel-schema/data-load/data-load.basic.d.ts +5 -0
  224. package/dist/suites/edhr/panel-schema/data-load/device-tmpl/device-field-status.vue.d.ts +9 -0
  225. package/dist/suites/edhr/panel-schema/data-load/device-tmpl/device-tmpl-editor.vue.d.ts +6 -0
  226. package/dist/suites/edhr/panel-schema/data-load/device-tmpl/params-item-card.vue.d.ts +30 -0
  227. package/dist/suites/edhr/panel-schema/data-load/hooks/device-link/constant.d.ts +44 -0
  228. package/dist/suites/edhr/panel-schema/data-load/hooks/device-link/controller.d.ts +38 -0
  229. package/dist/suites/edhr/panel-schema/data-load/hooks/device-link/index.d.ts +3 -0
  230. package/dist/suites/edhr/panel-schema/data-load/hooks/device-link/types.d.ts +157 -0
  231. package/dist/suites/edhr/panel-schema/data-load/hooks/form-tmpl-config/form-tmpl-config-controller.d.ts +67 -0
  232. package/dist/suites/edhr/panel-schema/data-load/hooks/form-tmpl-config/index.d.ts +2 -0
  233. package/dist/suites/edhr/panel-schema/data-load/hooks/form-tmpl-config/use-form-tmpl-config.d.ts +10 -0
  234. package/dist/suites/edhr/panel-schema/index.d.ts +70 -1
  235. package/dist/suites/edhr/panel-schema/paper-header-footer/PaperHeaderFooterPanel.vue.d.ts +2 -0
  236. package/dist/suites/edhr/panel-schema/paper-header-footer/paper-header-footer.basic.d.ts +5 -0
  237. package/dist/suites/edhr/panel-schema/paper-widget/PaperWidgetPanel.vue.d.ts +7 -1
  238. package/dist/suites/edhr/panel-schema/paper-widget/paper-widget.basic.d.ts +7 -1
  239. package/dist/suites/edhr/panel-schema/table-header/TableHeaderPanel.vue.d.ts +8 -0
  240. package/dist/suites/edhr/panel-schema/table-header/table-header.basic.d.ts +11 -0
  241. package/dist/suites/edhr/paper-widget-manifest/basic/line-manifest.d.ts +2 -0
  242. package/dist/suites/edhr/paper-widget-manifest/basic/pagination-manifest.d.ts +2 -0
  243. package/dist/suites/{edhr/panel-schema/paper-widget/widgets/editors/align-editor.vue.d.ts → shared/panel/config/editor/FormNumberEditor.vue.d.ts} +6 -8
  244. package/dist/suites/shared/panel/config/editor/single-field-editor/types.d.ts +9 -0
  245. package/dist/suites/{edhr/panel-schema/paper-widget/widgets/editors/size-editor.vue.d.ts → shared/panel/modules/field-formula-module/field-formula-module.vue.d.ts} +8 -8
  246. package/dist/suites/shared/panel/modules/table-setting-module.vue.d.ts +5 -4
  247. package/dist/utils/TriggerUtil.d.ts +1 -1
  248. package/dist/utils/func/dragdrop.d.ts +6 -1
  249. package/dist/utils/func/file.d.ts +1 -1
  250. package/dist/utils/symbol/contextKey.d.ts +7 -1
  251. package/dist/word.css +9288 -8120
  252. package/package.json +4 -1
  253. package/dist/core/sdk/types/public-types.d.ts +0 -78
  254. package/dist/runtime/designer/doc-design-layout.vue.d.ts +0 -6
  255. package/dist/runtime/useDocEngine.d.ts +0 -36
  256. package/dist/setup.d.ts +0 -46
  257. package/dist/suites/edhr/panel-schema/paper-widget/widgets/editors/img-parser.d.ts +0 -9
  258. package/dist/suites/edhr/panel-schema/paper-widget/widgets/editors/value-editor.vue.d.ts +0 -46
  259. /package/dist/suites/edhr/panel-config/{file → field/file}/upload.d.ts +0 -0
@@ -0,0 +1,50 @@
1
+ import { RawElement } from '../types';
2
+ /** slot 类型(页眉页脚专用) */
3
+ export type RefSlotType = 'default' | 'first' | 'even';
4
+ /** 带 slot 的引用 */
5
+ export interface SlotRef {
6
+ type: RefSlotType;
7
+ rId: string;
8
+ }
9
+ /** 普通引用 */
10
+ export interface SimpleRef {
11
+ /** 悬浮类引用 id */
12
+ rId: string;
13
+ /** 章节id */
14
+ secId: string;
15
+ }
16
+ /** 通用 Ref 类型 */
17
+ type AnyRef = SlotRef | SimpleRef;
18
+ interface RefManagerOptions {
19
+ /** XML tag 名 */
20
+ tagName: string;
21
+ /** 是否是 slot 类型 */
22
+ withSlot: boolean;
23
+ /** raw 数据 */
24
+ raw: RawElement;
25
+ }
26
+ export declare class RefManager<T extends AnyRef> {
27
+ private tagName;
28
+ private withSlot;
29
+ private raw;
30
+ refs: T[];
31
+ constructor(options: RefManagerOptions);
32
+ /**
33
+ * 从 JSON 中提取引用
34
+ * @param json 原始JSON数据
35
+ * @param tag 标签名
36
+ * @returns 格式化后的引用列表
37
+ */
38
+ parse(): T[];
39
+ /**
40
+ * 重新计算引用,并写回 raw
41
+ */
42
+ normalize(refs: string[], secIds?: string[]): T[];
43
+ private normalizeSlotRefs;
44
+ private normalizeSimpleRefs;
45
+ /**
46
+ * 将引用写回 raw
47
+ */
48
+ syncToRaw(): void;
49
+ }
50
+ export {};
@@ -1,2 +1,3 @@
1
1
  export { ModelNode, type ModelNodeOptions } from './ModelNode';
2
2
  export { ModelGroup, type ModelGroupOptions } from './ModelGroup';
3
+ export { RefManager, type SimpleRef, type SlotRef, type RefSlotType } from './RefManager';
@@ -0,0 +1,22 @@
1
+ import { RawElement } from '../types/raw';
2
+ import { ModelNode, ModelNodeOptions } from '../base';
3
+ export declare class Wbackground extends ModelNode {
4
+ /** 节点名称 */
5
+ name: 'w:background';
6
+ /** 节点类型 */
7
+ type: "element";
8
+ constructor(options: ModelNodeOptions);
9
+ /**
10
+ * 从原始 XML JSON 转换为 Wbackground 实例
11
+ *
12
+ * @param json - 原始 XML JSON 数据
13
+ * @returns Wbackground 实例
14
+ */
15
+ static fromXmlJson(json: RawElement): Wbackground;
16
+ /**
17
+ * 将 Wbackground 实例转换为原始 XML JSON
18
+ *
19
+ * @returns RawElement 格式的 XML JSON
20
+ */
21
+ toXmlJson(): RawElement;
22
+ }
@@ -1,5 +1,6 @@
1
1
  import { RawElement } from '../types/raw';
2
2
  import { Wbody } from './Wbody';
3
+ import { Wbackground } from './Wbackground';
3
4
  import { ModelGroup, ModelGroupOptions } from '../base';
4
5
  import { DocModel } from '../DocModel';
5
6
  /**
@@ -15,8 +16,13 @@ export declare class Wdocument extends ModelGroup<Wbody> {
15
16
  name: 'w:document';
16
17
  /** 节点类型 */
17
18
  type: "element";
19
+ background?: Wbackground;
20
+ /** 配置对象 */
21
+ config?: Record<string, any>;
18
22
  parent?: DocModel;
19
- constructor(options: ModelGroupOptions<Wbody>);
23
+ constructor(options: ModelGroupOptions<Wbody> & {
24
+ background?: Wbackground;
25
+ });
20
26
  get body(): Wbody;
21
27
  /**
22
28
  * 从原始 XML JSON 转换为 Wdocument 实例
@@ -4,12 +4,13 @@ import { Wtc } from './Wtc';
4
4
  import { WrText } from './WrText';
5
5
  import { WrImage } from './WrImage';
6
6
  import { WrField } from './WrField';
7
+ import { WrPageWidget } from './WrPageWidget';
7
8
  import { ModelGroup, ModelGroupOptions } from '../base';
8
9
  import { WpPr } from './WpPr';
9
10
  /**
10
11
  * Run 类型定义 - 可以是文本 Run 或图片 Run
11
12
  */
12
- export type Wr = WrText | WrImage | WrField;
13
+ export type Wr = WrText | WrImage | WrField | WrPageWidget;
13
14
  export declare class Wp extends ModelGroup {
14
15
  name: 'w:p';
15
16
  type: "element";
@@ -60,4 +61,10 @@ export declare class Wp extends ModelGroup {
60
61
  * wp.setAlignment('center');
61
62
  */
62
63
  setAlignment(alignment: string): void;
64
+ /**
65
+ * 从模板创建段落
66
+ * @param width 单元格宽度(DXA/缇)
67
+ * @returns Wtc 实例
68
+ */
69
+ static fromTemplate(): Wp;
63
70
  }
@@ -48,6 +48,8 @@ export declare class WrImage extends ModelNode {
48
48
  * // before: null,after: this(图片作为整体保留)
49
49
  */
50
50
  splitAt(index: number): [WrImage | null, WrImage | null];
51
+ /** 需要进行拼接成运行时的 modelId */
52
+ cloneWithSuffix(suffix: string, index: string | undefined): WrImage;
51
53
  /**
52
54
  * 从原始 XML JSON 转换为 WrImage 实例
53
55
  * @param json w:r XML JSON 对象
@@ -0,0 +1,8 @@
1
+ import { RawElement } from '../types';
2
+ import { WrText } from './WrText';
3
+ export declare class WrPageWidget extends WrText {
4
+ static fromXmlJson(json: RawElement & {
5
+ valuePath?: string;
6
+ widgetMeta?: any;
7
+ }): WrPageWidget;
8
+ }
@@ -20,14 +20,16 @@ export declare class WrText extends ModelNode {
20
20
  elements?: IElement[];
21
21
  valuePath?: string;
22
22
  widgetMeta?: WidgetMeta;
23
+ pageWidgetMeta?: WidgetMeta;
23
24
  constructor(options: ModelNodeOptions & {
24
25
  text: string;
25
26
  rPr?: WrPr;
26
27
  elements?: IElement[];
27
28
  isComposition?: boolean;
28
29
  isPlaceholder?: boolean;
29
- widgetMeta?: WidgetMeta;
30
30
  valuePath?: string;
31
+ widgetMeta?: WidgetMeta;
32
+ pageWidgetMeta?: WidgetMeta;
31
33
  });
32
34
  /**
33
35
  * 在指定位置插入文本
@@ -104,6 +106,10 @@ export declare class WrText extends ModelNode {
104
106
  * // n 为 null,all 为 this(无分割)
105
107
  */
106
108
  splitAt(index: number): [WrText | null, WrText | null];
109
+ /** 需要使用运行时的 modelId */
110
+ cloneWithId(id: string): WrText;
111
+ /** 需要进行拼接成运行时的 modelId */
112
+ cloneWithSuffix(suffix: string, index: string | undefined): WrText;
107
113
  /**
108
114
  * 从原始 XML JSON 转换为 WrText 实例
109
115
  * @param json w:r XML JSON 对象
@@ -111,7 +117,8 @@ export declare class WrText extends ModelNode {
111
117
  */
112
118
  static fromXmlJson(json: RawElement & {
113
119
  valuePath?: string;
114
- widgetMeta?: any;
120
+ widgetMeta?: WidgetMeta;
121
+ pageWidgetMeta?: WidgetMeta;
115
122
  }): WrText;
116
123
  /**
117
124
  * 将实例转换为 XML JSON 格式
@@ -1,5 +1,6 @@
1
1
  import { RawElement } from '../types/raw';
2
- import { ModelNode, ModelNodeOptions } from '../base';
2
+ import { ModelNode, RefManager, ModelNodeOptions, SimpleRef, SlotRef } from '../base';
3
+ export type HeaderFooterKind = 'header' | 'footer';
3
4
  /**
4
5
  * 页面大小配置
5
6
  */
@@ -48,6 +49,14 @@ export declare class WsecPr extends ModelNode {
48
49
  margins?: PageMargins;
49
50
  columns?: Columns;
50
51
  docGrid?: DocGrid;
52
+ /** 页眉页脚首页不同 */
53
+ titlePg: boolean;
54
+ /** 页眉引用关系 */
55
+ headerRefManager: RefManager<SlotRef>;
56
+ /** 页脚引用关系 */
57
+ footerRefManager: RefManager<SlotRef>;
58
+ /** 浮层引用关系 */
59
+ overlayRefManager: RefManager<SimpleRef>;
51
60
  fromParagraph: boolean;
52
61
  constructor(options: ModelNodeOptions & {
53
62
  raw: RawElement;
@@ -55,6 +64,7 @@ export declare class WsecPr extends ModelNode {
55
64
  margins?: PageMargins;
56
65
  columns?: Columns;
57
66
  docGrid?: DocGrid;
67
+ titlePg: boolean;
58
68
  });
59
69
  /**
60
70
  * 从原始 XML JSON 转换为 WsecPr 实例
@@ -64,6 +74,9 @@ export declare class WsecPr extends ModelNode {
64
74
  * 将 WsecPr 实例转换为原始 XML JSON
65
75
  */
66
76
  toXmlJson(): RawElement;
77
+ /**
78
+ * 获取页面宽度
79
+ */
67
80
  getPageWidth(): number | undefined;
68
81
  /**
69
82
  * 获取页面高度(单位:twip,1/20点)
@@ -73,6 +86,44 @@ export declare class WsecPr extends ModelNode {
73
86
  * 获取有效的左边距(考虑装订线)
74
87
  */
75
88
  getEffectiveLeftMargin(): number | undefined;
89
+ /**
90
+ * 根据页码解析页眉/页脚引用
91
+ * @param type 'header' | 'footer'
92
+ * @param pageIndex 页码
93
+ * @param evenAndOddHeaders 是否启用奇偶页不同
94
+ */
95
+ private resolveHeaderFooterRef;
96
+ /**
97
+ * 根据 pageIndex 获取页眉引用
98
+ * @param pageIndex 页码
99
+ * @param evenAndOddHeaders 是否启用奇偶页
100
+ */
101
+ getHeaderRef(pageIndex: number, evenAndOddHeaders: boolean): string | null;
102
+ /**
103
+ * 根据 pageIndex 获取页脚引用
104
+ * @param pageIndex 页码
105
+ * @param evenAndOddHeaders 是否启用奇偶页
106
+ */
107
+ getFooterRef(pageIndex: number, evenAndOddHeaders: boolean): string | null;
108
+ /** 根据章节 id 获取浮层引用 */
109
+ getOverlayRef(): string | null;
110
+ /**
111
+ * 重新计算页眉引用,并写回 raw
112
+ */
113
+ normalizeHeaderRefs(refIds: string[]): void;
114
+ /**
115
+ * 重新计算页脚引用,并写回 raw
116
+ */
117
+ normalizeFooterRefs(refIds: string[]): void;
118
+ /**
119
+ * 重新计算浮层引用,并写回 raw
120
+ */
121
+ normalizeOverlayRefs(refs: string[], secIds: string[]): void;
122
+ /**
123
+ * 获取当前页面方向
124
+ * @returns 'portrait' | 'landscape' | null
125
+ */
126
+ getOrient(): 'portrait' | 'landscape' | null;
76
127
  setOrient(val: 'portrait' | 'landscape'): void;
77
128
  /**
78
129
  * 设置为横向(宽 > 高)
@@ -112,4 +163,18 @@ export declare class WsecPr extends ModelNode {
112
163
  * @param right 右边距值,单位:twip(1/20点)
113
164
  */
114
165
  setMargins(top: number, bottom: number, left: number, right: number): void;
166
+ /**
167
+ * 设置页眉距页面顶边距离
168
+ * @param value 单位:twip
169
+ */
170
+ setHeaderMargin(value: number): void;
171
+ /**
172
+ * 设置页脚距页面底边距离
173
+ * @param value 单位:twip
174
+ */
175
+ setFooterMargin(value: number): void;
176
+ /**
177
+ * 设置首页不同页眉页脚
178
+ */
179
+ setTitlePg(enabled: boolean): void;
115
180
  }
@@ -12,6 +12,10 @@ export declare class WtblCalculation {
12
12
  * 处理 repeating 数据
13
13
  */
14
14
  private static processRepeating;
15
+ /**
16
+ * 处理 2d-table 数据
17
+ */
18
+ private static process2DTable;
15
19
  /**
16
20
  * 处理 bounded 数据
17
21
  */
@@ -20,4 +24,12 @@ export declare class WtblCalculation {
20
24
  * 处理 boundedItem 数据
21
25
  */
22
26
  private static processBoundedItem;
27
+ /**
28
+ * 处理 check-table 数据
29
+ */
30
+ private static processCheckTable;
31
+ /**
32
+ * 处理 dataGroup2D 数据
33
+ */
34
+ private static processDataGroup2D;
23
35
  }
@@ -1,4 +1,4 @@
1
- import { BoundedRegionOptions, RepeatingRegionOptions, TableRegion, BoundedRegion, RepeatingRegion } from '../../logic';
1
+ import { BoundedRegionOptions, CheckTableRegionOptions, RepeatingRegionOptions, TableRegion, TableHeaderRegionOptions, SubTableHeaderRegionOptions, _2DTableRegionOptions, BoundedRegion, CheckTableRegion, RepeatingRegion, TableHeaderRegion, SubTableHeaderRegion, _2DTableRegion } from '../../logic';
2
2
  import { Wtbl } from '../Wtbl';
3
3
  /**
4
4
  * 表格区域管理功能类
@@ -9,6 +9,8 @@ export declare class WtblRegionManager {
9
9
  * 根据 region id 查找对应的 region
10
10
  */
11
11
  static findRegionById(table: Wtbl, regionId: string): TableRegion | undefined;
12
+ static findCrossRegion(table: Wtbl, options: Pick<TableRegion, 'start' | 'end'>): TableRegion | undefined;
13
+ static findCrossRegions(table: Wtbl, options: Pick<TableRegion, 'start' | 'end'>): TableRegion[];
12
14
  /**
13
15
  * 根据 region id 删除对应的 region
14
16
  */
@@ -17,8 +19,18 @@ export declare class WtblRegionManager {
17
19
  * 设置重复区域
18
20
  */
19
21
  static setRepeating(table: Wtbl, options: Omit<RepeatingRegionOptions, 'table'>): RepeatingRegion;
22
+ /**
23
+ * 设置二维表
24
+ */
25
+ static set2DTable(table: Wtbl, options: Omit<_2DTableRegionOptions, 'table'>): _2DTableRegion;
20
26
  /**
21
27
  * 设置有界区域
22
28
  */
23
29
  static setBounded(table: Wtbl, options: Omit<BoundedRegionOptions, 'table'>): BoundedRegion;
30
+ /**
31
+ * 设置检验表
32
+ */
33
+ static setCheckTable(table: Wtbl, options: Omit<CheckTableRegionOptions, 'table'>): CheckTableRegion;
34
+ static setTableHeader(table: Wtbl, options: Omit<TableHeaderRegionOptions, 'table'>): TableHeaderRegion;
35
+ static setSubTableHeader(table: Wtbl, options: Omit<SubTableHeaderRegionOptions, 'table'>): SubTableHeaderRegion;
24
36
  }
@@ -4,6 +4,12 @@ import { Wtbl } from '../Wtbl';
4
4
  * 提供插入和删除行列的功能
5
5
  */
6
6
  export declare class WtblRowColumnOps {
7
+ /**
8
+ * 新单元格同步引用信息
9
+ * refCell: 参考单元格 (above | left)
10
+ * nextRefCell: 后参考单元格 (below | right ),如果传入,需要跟 refCell 比对一致后同步
11
+ */
12
+ private static syncRefInfo;
7
13
  /**
8
14
  * 在指定行位置插入新行
9
15
  */
@@ -1,5 +1,7 @@
1
1
  import { RawElement } from '../../types/raw';
2
+ import { Wtr } from '../Wtr';
2
3
  import { Wtbl } from '../Wtbl';
4
+ import { Wtc } from '../Wtc';
3
5
  /**
4
6
  * 表格序列化功能类
5
7
  * 提供 XML 转换、快照序列化等功能
@@ -17,4 +19,14 @@ export declare class WtblSerialization {
17
19
  * 在指定行索引处断开表格
18
20
  */
19
21
  static splitAt(table: Wtbl, index: number): [Wtbl | null, Wtbl | null];
22
+ static getCell(rows: Wtr[], rowIndex: number, col: number): Wtc | undefined;
23
+ static findCellById(rows: Wtr[], cellId: string): Wtc | null;
24
+ /**
25
+ * 给起始单元格设置 rowspan
26
+ */
27
+ static applyRowspan(rows: Wtr[], rowIndex: number, col: number, rowspan: number): void;
28
+ /**
29
+ * 获取最大列数
30
+ */
31
+ static getMaxCols(rows: Wtr[]): number;
20
32
  }
@@ -3,7 +3,7 @@ import { Wbody } from './Wbody';
3
3
  import { Wtr } from './Wtr';
4
4
  import { Wtc } from './Wtc';
5
5
  import { ModelGroup, ModelGroupOptions } from '../base';
6
- import { TableRegion, BoundedRegionOptions, RepeatingRegionOptions, BoundedRegion, RepeatingRegion } from '../logic';
6
+ import { TableRegion, BoundedRegionOptions, CheckTableRegionOptions, RepeatingRegionOptions, _2DTableRegionOptions, TableHeaderRegion, SubTableHeaderRegion, TableHeaderRegionOptions, SubTableHeaderRegionOptions, CheckTableRegion, BoundedRegion, RepeatingRegion, _2DTableRegion } from '../logic';
7
7
  import { WtblPr } from './WtblPr';
8
8
  export declare class Wtbl extends ModelGroup {
9
9
  name: 'w:tbl';
@@ -14,6 +14,8 @@ export declare class Wtbl extends ModelGroup {
14
14
  parent?: Wbody;
15
15
  children: Wtr[];
16
16
  private pendingRecalculate;
17
+ private mutationDepth;
18
+ private mutationNeedsRecalculate;
17
19
  constructor(options: ModelGroupOptions & {
18
20
  tblPr?: WtblPr;
19
21
  colWidths?: number[];
@@ -22,14 +24,28 @@ export declare class Wtbl extends ModelGroup {
22
24
  get repeating(): RepeatingRegion[];
23
25
  getRepeatingById(id: string): RepeatingRegion | undefined;
24
26
  get hasRepeating(): boolean;
27
+ get _2DTable(): _2DTableRegion[];
28
+ get2DTableById(id: string): _2DTableRegion | undefined;
29
+ get has2DTable(): boolean;
25
30
  get bounded(): BoundedRegion[];
26
31
  getBoundedById(id: string): BoundedRegion | undefined;
27
32
  get hasBounded(): boolean;
33
+ get checkTable(): CheckTableRegion[];
34
+ getCheckTableById(id: string): CheckTableRegion | undefined;
35
+ get hasCheckTable(): boolean;
36
+ get tableHeader(): Array<TableHeaderRegion | SubTableHeaderRegion>;
37
+ getTableHeaderById(id: string): TableHeaderRegion | SubTableHeaderRegion | undefined;
28
38
  /**
29
39
  * 请求延迟重算
30
40
  * 在微任务队列中安排一次重算,同一事件循环内的多次操作会自动合并
31
41
  */
32
42
  scheduleRecalculate(): void;
43
+ runConsistencyMutation(options: {
44
+ validate?: () => void;
45
+ mutate: () => void;
46
+ syncRefs?: () => void;
47
+ finalize?: () => void;
48
+ }): void;
33
49
  static fromXmlJson(json: RawElement): Wtbl;
34
50
  toXmlJson(): RawElement;
35
51
  /**
@@ -42,11 +58,16 @@ export declare class Wtbl extends ModelGroup {
42
58
  */
43
59
  splitAt(index: number): [Wtbl | null, Wtbl | null];
44
60
  setRepeating(options: Omit<RepeatingRegionOptions, 'table'>): RepeatingRegion;
61
+ set2DTable(options: Omit<_2DTableRegionOptions, 'table'>): _2DTableRegion;
45
62
  setBounded(options: Omit<BoundedRegionOptions, 'table'>): BoundedRegion;
63
+ setCheckTable(options: Omit<CheckTableRegionOptions, 'table'>): CheckTableRegion;
64
+ setTableHeader(options: Omit<TableHeaderRegionOptions, 'table'>): TableHeaderRegion;
65
+ setSubTableHeader(options: Omit<SubTableHeaderRegionOptions, 'table'>): SubTableHeaderRegion;
46
66
  /**
47
67
  * 根据 region id 查找对应的 region
48
68
  */
49
69
  findRegionById(regionId: string): TableRegion | undefined;
70
+ findCrossRegion(options: Pick<TableRegion, 'start' | 'end'>): TableRegion | undefined;
50
71
  /**
51
72
  * 根据 region id 删除对应的 region
52
73
  */
@@ -3,6 +3,7 @@ import { Wtr } from './Wtr';
3
3
  import { Wp } from './Wp';
4
4
  import { ModelGroup, ModelGroupOptions } from '../base';
5
5
  import { Wtbl } from './Wtbl';
6
+ export declare const WTC_REF_KEYS: string[];
6
7
  /**
7
8
  * w:tc 表格单元格
8
9
  */
@@ -13,12 +14,18 @@ export declare class Wtc extends ModelGroup {
13
14
  tcPrRaw?: RawElement;
14
15
  colspan?: number;
15
16
  rowspan?: number;
17
+ backgroundColor?: string;
16
18
  mergeFromId?: string;
17
19
  mergeId?: string;
18
20
  repeatingId?: string;
21
+ _2DTableId?: string;
19
22
  boundedId?: string;
20
23
  boundedItemId?: string;
24
+ checkTableId?: string;
25
+ dataGroup2DId?: string;
26
+ headerId?: string;
21
27
  vMergeType?: 'restart' | 'continue';
28
+ tempMergeId?: string;
22
29
  constructor(options: ModelGroupOptions & {
23
30
  tcPrRaw?: RawElement;
24
31
  colspan?: number;
@@ -26,15 +33,52 @@ export declare class Wtc extends ModelGroup {
26
33
  mergeFromId?: string;
27
34
  mergeId?: string;
28
35
  repeatingId?: string;
36
+ _2DTableId?: string;
29
37
  boundedId?: string;
30
38
  boundedItemId?: string;
39
+ checkTableId?: string;
40
+ dataGroup2DId?: string;
41
+ headerId?: string;
42
+ backgroundColor?: string;
31
43
  vMergeType?: 'restart' | 'continue';
44
+ tempMergeId?: string;
32
45
  });
33
46
  get table(): Wtbl;
34
- get isMerged(): boolean;
47
+ /** 是否是被合并单元格 */
48
+ get isMergeSlave(): boolean;
49
+ /** 是否是合并起始单元格 */
50
+ get isMergeStart(): boolean;
35
51
  get contents(): Wp[];
36
52
  get firstContent(): Wp | undefined;
37
53
  get lastContent(): Wp | undefined;
54
+ get cellMergeInfo(): {
55
+ /** 是否属于合并单元格(不包括起点的) */
56
+ isMerged: boolean;
57
+ /** 合并方向 */
58
+ direction: 'horizontal' | 'vertical' | null;
59
+ /** 当前单元格在 XML 生成时是否需要跳过 */
60
+ skip: boolean;
61
+ /** 合并来源位置(左上角) */
62
+ from: null | {
63
+ row: number;
64
+ col: number;
65
+ };
66
+ /** 合并区域尺寸 */
67
+ span: null | {
68
+ rows: number;
69
+ cols: number;
70
+ };
71
+ /**
72
+ * 当前单元格是否是“某一行的起点”
73
+ * 用于决定是否输出 w:gridSpan
74
+ */
75
+ isRowStart: boolean;
76
+ /**
77
+ * 当前单元格是否是“整个合并区域的起点(左上角)”
78
+ * 用于决定 vMerge restart
79
+ */
80
+ isRoot: boolean;
81
+ };
38
82
  /**
39
83
  * 查找当前单元格对应的区域
40
84
  * @returns
@@ -55,7 +99,9 @@ export declare class Wtc extends ModelGroup {
55
99
  * ├── w:tcPr(如果存在)
56
100
  * └── w:p(所有段落子元素)
57
101
  */
58
- toXmlJson(): RawElement;
102
+ toXmlJson(): RawElement | null;
103
+ private buildTcPr;
104
+ private static normalizeWordColor;
59
105
  /**
60
106
  * 从模板创建单元格
61
107
  * @param width 单元格宽度(DXA/缇)
@@ -87,7 +133,9 @@ export declare class Wtc extends ModelGroup {
87
133
  * // 支持链式调用
88
134
  * cell.merge(2, 3).merge(1, 2);
89
135
  */
90
- merge(rowSpan: number, colSpan: number): this;
136
+ merge(rowSpan: number, colSpan: number, options?: {
137
+ skipConsistency?: boolean;
138
+ }): this;
91
139
  /**
92
140
  * 取消当前单元格的合并状态
93
141
  *
@@ -109,5 +157,7 @@ export declare class Wtc extends ModelGroup {
109
157
  * const cell = table.rows[1].cells[0]; // rowspan=2, colspan=2
110
158
  * cell.unmerge(); // 覆盖范围内的所有单元格恢复为独立状态
111
159
  */
112
- unmerge(): void;
160
+ unmerge(options?: {
161
+ skipConsistency?: boolean;
162
+ }): void;
113
163
  }
@@ -51,4 +51,5 @@ export declare class WtrPr extends ModelNode {
51
51
  * wpPr.removeElement('w:keepNext');
52
52
  */
53
53
  removeElement(name: string): boolean;
54
+ static fromTemplate(): WtrPr;
54
55
  }
@@ -1,10 +1,12 @@
1
1
  export { Wdocument } from './Wdocument';
2
2
  export { Wbody } from './Wbody';
3
+ export { Wbackground } from './Wbackground';
3
4
  export { Wp } from './Wp';
4
5
  export type { Wr } from './Wp';
5
6
  export { WrText } from './WrText';
6
7
  export { WrImage } from './WrImage';
7
8
  export { WrField } from './WrField';
9
+ export { WrPageWidget } from './WrPageWidget';
8
10
  export { Wtbl } from './Wtbl';
9
11
  export { Wtr } from './Wtr';
10
12
  export { Wtc } from './Wtc';
@@ -0,0 +1,40 @@
1
+ import { ModelGroup, ModelNode, ModelGroupOptions } from '../base';
2
+ import { DocModel } from '../DocModel';
3
+ import { RawElement } from '../types';
4
+ export type WfooterXmlJson = RawElement & {
5
+ name: 'w:ftr';
6
+ '@Relationship': {
7
+ Type: string;
8
+ Target: string;
9
+ Id: string;
10
+ };
11
+ };
12
+ /**
13
+ * 页脚类
14
+ */
15
+ export declare class Wfooter extends ModelGroup<ModelNode> {
16
+ /** 节点名称 */
17
+ name: 'w:ftr';
18
+ /** 节点类型 */
19
+ type: "element";
20
+ /** 原始 XML JSON 数据 */
21
+ raw?: WfooterXmlJson;
22
+ /** 关系 ID(rId) */
23
+ relId?: string;
24
+ parent?: DocModel;
25
+ constructor(options: ModelGroupOptions<ModelNode> & {
26
+ raw: WfooterXmlJson;
27
+ });
28
+ /**
29
+ * 从原始 XML JSON 转换为 Wfooter 实例
30
+ *
31
+ * @param json - 原始 XML JSON 数据
32
+ * @returns Wfooter 实例
33
+ */
34
+ static fromXmlJson(json: WfooterXmlJson): Wfooter;
35
+ /**
36
+ * 转换为 XML JSON
37
+ */
38
+ toXmlJson(): WfooterXmlJson;
39
+ static fromTemplate(index: string): Wfooter;
40
+ }
@@ -0,0 +1,42 @@
1
+ import { Wfooter, WfooterXmlJson } from './Wfooter';
2
+ import { DocModel } from '../DocModel';
3
+ import { WsecPr } from '../document';
4
+ export declare class Wfooters {
5
+ raw?: WfooterXmlJson[];
6
+ footers: Wfooter[];
7
+ parent?: DocModel;
8
+ FOOTER_SLOT_COUNT: number;
9
+ constructor(raw: WfooterXmlJson[], parent?: DocModel);
10
+ /**
11
+ * 批量从 JSON 转换
12
+ */
13
+ static fromXmlJsonArray(json: WfooterXmlJson[], parent?: DocModel): Wfooters;
14
+ /**
15
+ * 转为 XML JSON 数组
16
+ */
17
+ toXmlJson(): WfooterXmlJson[];
18
+ /**
19
+ * 根据 relId 查找页脚
20
+ */
21
+ getByRelId(rId: string): Wfooter | null;
22
+ /**
23
+ * 获取当前所有页脚的 relId
24
+ */
25
+ getRefIds(): string[];
26
+ /**
27
+ * 计算下一个页脚序号
28
+ */
29
+ private getNextFooterIndex;
30
+ /**
31
+ * footers 重建回 raw
32
+ */
33
+ private syncRaw;
34
+ /**
35
+ * 补齐页脚槽位,并同步 raw
36
+ */
37
+ ensureComplete(): void;
38
+ /**
39
+ * 统一修复所有 section 的页脚引用
40
+ */
41
+ syncSectionRefs(sections: WsecPr[]): void;
42
+ }