@docx-editor.dev/core 0.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +91 -2
  3. package/THIRD_PARTY_NOTICES.md +18 -0
  4. package/dist/automation.cjs +1 -0
  5. package/dist/automation.d.cts +74 -0
  6. package/dist/automation.d.ts +74 -0
  7. package/dist/automation.js +1 -0
  8. package/dist/binding.cjs +1 -0
  9. package/dist/binding.d.cts +88 -0
  10. package/dist/binding.d.ts +88 -0
  11. package/dist/binding.js +1 -0
  12. package/dist/chunk-2DTQDAN7.js +2 -0
  13. package/dist/chunk-3JKQE4QJ.cjs +2 -0
  14. package/dist/chunk-4WWEDTTE.js +2 -0
  15. package/dist/chunk-6WIIHJFY.js +1 -0
  16. package/dist/chunk-7VQ7YLW3.cjs +1 -0
  17. package/dist/chunk-BS554B6D.cjs +2 -0
  18. package/dist/chunk-BZK64YU3.cjs +10 -0
  19. package/dist/chunk-CZFUMACF.cjs +12 -0
  20. package/dist/chunk-GQQOL4PV.js +1 -0
  21. package/dist/chunk-HBL3NNH5.cjs +1 -0
  22. package/dist/chunk-JQFDLZXQ.cjs +2 -0
  23. package/dist/chunk-O2WQY7IT.cjs +5 -0
  24. package/dist/chunk-PC76F2HR.cjs +1 -0
  25. package/dist/chunk-QRAUDDVY.js +2 -0
  26. package/dist/chunk-REZUWYB7.js +1 -0
  27. package/dist/chunk-STCITBJK.js +12 -0
  28. package/dist/chunk-TBBXCC7D.js +5 -0
  29. package/dist/chunk-TSXT537P.cjs +12 -0
  30. package/dist/chunk-WOGYVM3W.js +12 -0
  31. package/dist/chunk-Y7TA7TPF.js +10 -0
  32. package/dist/content-control-walk-CbTqHq6O.d.cts +56 -0
  33. package/dist/content-control-walk-D06GijR0.d.ts +56 -0
  34. package/dist/contracts/document.cjs +1 -0
  35. package/dist/contracts/document.d.cts +246 -0
  36. package/dist/contracts/document.d.ts +246 -0
  37. package/dist/contracts/document.js +0 -0
  38. package/dist/contracts/editor.cjs +1 -0
  39. package/dist/contracts/editor.d.cts +11 -0
  40. package/dist/contracts/editor.d.ts +11 -0
  41. package/dist/contracts/editor.js +1 -0
  42. package/dist/contracts/interaction.cjs +1 -0
  43. package/dist/contracts/interaction.d.cts +11 -0
  44. package/dist/contracts/interaction.d.ts +11 -0
  45. package/dist/contracts/interaction.js +0 -0
  46. package/dist/contracts/modules.cjs +1 -0
  47. package/dist/contracts/modules.d.cts +117 -0
  48. package/dist/contracts/modules.d.ts +117 -0
  49. package/dist/contracts/modules.js +1 -0
  50. package/dist/contracts/types.cjs +1 -0
  51. package/dist/contracts/types.d.cts +452 -0
  52. package/dist/contracts/types.d.ts +452 -0
  53. package/dist/contracts/types.js +0 -0
  54. package/dist/custom-node-writes-YqISlSRl.d.cts +885 -0
  55. package/dist/custom-node-writes-ttKuYd0M.d.ts +885 -0
  56. package/dist/editor-B93PggnR.d.cts +1690 -0
  57. package/dist/editor-CFsSrxGR.d.ts +1690 -0
  58. package/dist/editor.cjs +1 -0
  59. package/dist/editor.css +7106 -0
  60. package/dist/editor.d.cts +271 -0
  61. package/dist/editor.d.ts +271 -0
  62. package/dist/editor.js +1 -0
  63. package/dist/hf-references-BdjsQNE_.d.ts +71 -0
  64. package/dist/hf-references-CgEOSw3i.d.cts +71 -0
  65. package/dist/image-resources-C_YnqPhn.d.ts +203 -0
  66. package/dist/image-resources-DwpNnTg3.d.cts +203 -0
  67. package/dist/index-BjZelfWL.d.cts +2532 -0
  68. package/dist/index-DP1yJJ3R.d.ts +2532 -0
  69. package/dist/index.cjs +1 -0
  70. package/dist/index.d.cts +22 -0
  71. package/dist/index.d.ts +22 -0
  72. package/dist/index.js +1 -0
  73. package/dist/layout.cjs +1 -0
  74. package/dist/layout.d.cts +2366 -0
  75. package/dist/layout.d.ts +2366 -0
  76. package/dist/layout.js +1 -0
  77. package/dist/note-nodes-BPSTVDMr.d.ts +108 -0
  78. package/dist/note-nodes-C6DLxlvj.d.cts +108 -0
  79. package/dist/ooxml-package-CR5us6ad.d.cts +354 -0
  80. package/dist/ooxml-package-D_CtywTW.d.ts +354 -0
  81. package/dist/ooxml-tree-BU0e3DVi.d.cts +871 -0
  82. package/dist/ooxml-tree-BU0e3DVi.d.ts +871 -0
  83. package/dist/output.cjs +1 -0
  84. package/dist/output.d.cts +158 -0
  85. package/dist/output.d.ts +158 -0
  86. package/dist/output.js +1 -0
  87. package/dist/protocol-BWVA3Q1p.d.ts +1255 -0
  88. package/dist/protocol-FAz_nPm_.d.cts +1255 -0
  89. package/dist/review-reads-CsoXSvUg.d.ts +401 -0
  90. package/dist/review-reads-qW0jvdF1.d.cts +401 -0
  91. package/dist/review-support-D64Wu236.d.cts +358 -0
  92. package/dist/review-support-nsLXC9jf.d.ts +358 -0
  93. package/dist/revision-projection-72ZApe-g.d.cts +84 -0
  94. package/dist/revision-projection-DHAkcD_L.d.ts +84 -0
  95. package/dist/semantic-cell-selection-D_8RbPII.d.ts +427 -0
  96. package/dist/semantic-cell-selection-DwLB71fF.d.cts +427 -0
  97. package/dist/semantic-interaction-CXH2wFqi.d.ts +187 -0
  98. package/dist/semantic-interaction-DqcEonqD.d.cts +187 -0
  99. package/dist/semantic-paint-drawings-B5Wk2so5.d.ts +21 -0
  100. package/dist/semantic-paint-drawings-x8g44lD_.d.cts +21 -0
  101. package/dist/semantic-records-COVFW5aS.d.cts +1505 -0
  102. package/dist/semantic-records-zTC0_1zi.d.ts +1505 -0
  103. package/dist/shaped-measurer-AFnFxoot.d.cts +613 -0
  104. package/dist/shaped-measurer-CZXL-a6v.d.ts +613 -0
  105. package/dist/store.cjs +1 -0
  106. package/dist/store.d.cts +2153 -0
  107. package/dist/store.d.ts +2153 -0
  108. package/dist/store.js +1 -0
  109. package/dist/tree-op-types-DWLCllG7.d.ts +1486 -0
  110. package/dist/tree-op-types-UOXlRUqQ.d.cts +1486 -0
  111. package/dist/tree-session-BtVFXsF6.d.ts +580 -0
  112. package/dist/tree-session-DxIOHUOD.d.cts +580 -0
  113. package/dist/tree-store-B1lEkdXc.d.cts +273 -0
  114. package/dist/tree-store-BscFPB7x.d.ts +273 -0
  115. package/package.json +110 -8
  116. package/index.js +0 -1
@@ -0,0 +1,871 @@
1
+ /**
2
+ * One parsed XML node, preserving significant order, whitespace and raw lexical values.
3
+ *
4
+ * Attribute records have a NULL prototype: attribute names come from a file and become object
5
+ * keys, so `__proto__` must be inert by construction rather than by filtering.
6
+ */
7
+ type XmlNode = {
8
+ readonly type: 'element';
9
+ readonly name: string;
10
+ readonly attributes: Readonly<Record<string, string>>;
11
+ readonly children: readonly XmlNode[];
12
+ } | {
13
+ readonly type: 'text';
14
+ readonly value: string;
15
+ };
16
+ /**
17
+ * Why XML was refused at the trust boundary.
18
+ *
19
+ * DTDs, entity declarations and external-entity references are PRE-rejected before parsing —
20
+ * blocking XXE and billion-laughs by never handing the parser the construct, rather than by
21
+ * trusting it to be configured safely.
22
+ */
23
+ type XmlRejection = 'too-large' | 'dtd-forbidden' | 'entity-forbidden' | 'too-deep' | 'too-many-elements' | 'invalid-limits' | 'parse-error';
24
+ /** A parsed document, or a typed refusal. Never throws — the input is untrusted. */
25
+ type XmlResult = {
26
+ readonly ok: true;
27
+ readonly nodes: readonly XmlNode[];
28
+ } | {
29
+ readonly ok: false;
30
+ readonly reason: XmlRejection;
31
+ };
32
+ /** Per-part caps on size, element count and depth. Clamped into the hard ceilings. */
33
+ interface XmlLimits {
34
+ readonly maxBytes: number;
35
+ readonly maxElements?: number;
36
+ }
37
+ /** Read XML into an ordered tree, refusing DTDs/entities and bounding size. */
38
+ /**
39
+ * Read XML at the trust boundary: bounded, entity-free, and fidelity-preserving.
40
+ *
41
+ * Pre-rejects DTDs and entity constructs, disables expansion and value coercion, and keeps child
42
+ * order, attributes, whitespace and raw lexical form — everything a lossless re-emit needs.
43
+ */
44
+ declare function readXml(xml: string, limits?: XmlLimits): XmlResult;
45
+ /** Find the first descendant element with the given qualified name. */
46
+ declare function findElement(nodes: readonly XmlNode[], name: string): Extract<XmlNode, {
47
+ type: 'element';
48
+ }> | undefined;
49
+ /** All direct child elements with the given name. */
50
+ declare function childElements(node: Extract<XmlNode, {
51
+ type: 'element';
52
+ }>, name: string): Extract<XmlNode, {
53
+ type: 'element';
54
+ }>[];
55
+ /** Concatenated text content of an element (all descendant text nodes). */
56
+ declare function textContent(node: Extract<XmlNode, {
57
+ type: 'element';
58
+ }>): string;
59
+
60
+ /** The WordprocessingML main namespace — the `w:` prefix in every `word/document.xml`. */
61
+ declare const WML_NAMESPACE_URI = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
62
+ /** The reserved `xml:` namespace, which carries `xml:space`. */
63
+ declare const XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";
64
+ /** The reserved `xmlns:` namespace that namespace declarations themselves live in. */
65
+ declare const XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/";
66
+ /** The `w14` wordml-2010 extension namespace — `w14:paraId`/`w14:textId` live here. */
67
+ declare const W14_NAMESPACE_URI = "http://schemas.microsoft.com/office/word/2010/wordml";
68
+ declare const DRAWINGML_MAIN_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/main";
69
+ declare const WP_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
70
+ declare const PIC_NAMESPACE_URI = "http://schemas.openxmlformats.org/drawingml/2006/picture";
71
+ /** The four content-position revision wrappers, which nest and carry runs. */
72
+ declare function isContentRevisionKind(kind: OoxmlNode['kind']): kind is 'revisionInsert' | 'revisionDelete' | 'revisionMoveFrom' | 'revisionMoveTo';
73
+ /** Move-range and comment-range boundary markers, which are empty and sit between runs. */
74
+ declare function isRangeMarkerKind(kind: OoxmlNode['kind']): kind is 'moveFromRangeStart' | 'moveFromRangeEnd' | 'moveToRangeStart' | 'moveToRangeEnd' | 'commentRangeStart' | 'commentRangeEnd';
75
+ /**
76
+ * OOXML on/off toggle: on only when a same-namespace child is present and its `w:val`
77
+ * (same namespace as the child) does not explicitly disable. Foreign-namespace siblings
78
+ * with the same local name cannot turn the flag on.
79
+ */
80
+ declare function readOnOffChild(parent: OoxmlNode, localName: string, namespaceUri?: string): boolean;
81
+
82
+ /**
83
+ * A node's stable identity within its part.
84
+ *
85
+ * Minted deterministically from the structural path at parse, then RETAINED through structural
86
+ * sharing — the same bytes always produce the same ids, and an edit elsewhere in the document
87
+ * does not renumber untouched nodes. Every tree op addresses nodes by these.
88
+ */
89
+ type OoxmlNodeId = string;
90
+ /**
91
+ * One `xmlns:` declaration carried on a node.
92
+ *
93
+ * Preserved rather than normalized away: a document that binds `w14` at the root and a document
94
+ * that binds it on a paragraph are different bytes, and re-emitting the wrong one is a fidelity
95
+ * loss even though the semantics match.
96
+ */
97
+ interface OoxmlNamespaceBinding {
98
+ readonly prefix: string;
99
+ readonly namespaceUri: string;
100
+ }
101
+ interface OoxmlAttributeBase {
102
+ readonly namespaceUri: string;
103
+ readonly localName: string;
104
+ readonly prefix?: string;
105
+ readonly value: string;
106
+ }
107
+ /** `xml:space`, which decides whether a run's leading and trailing whitespace survives. */
108
+ interface OoxmlXmlSpaceAttribute extends OoxmlAttributeBase {
109
+ readonly kind: 'xmlSpace';
110
+ readonly namespaceUri: typeof XML_NAMESPACE_URI;
111
+ readonly localName: 'space';
112
+ readonly prefix: 'xml';
113
+ readonly value: 'default' | 'preserve';
114
+ }
115
+ /** `w:val` — the attribute nearly every WordprocessingML property carries its value in. */
116
+ interface OoxmlWmlValAttribute extends OoxmlAttributeBase {
117
+ readonly kind: 'wmlVal';
118
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
119
+ readonly localName: 'val';
120
+ }
121
+ /**
122
+ * Any attribute outside the typed vocabulary, carried verbatim.
123
+ *
124
+ * Where losslessness actually happens: an attribute this engine has no model for is preserved
125
+ * exactly rather than dropped, so a save re-emits what the file said.
126
+ */
127
+ interface OoxmlGenericExtensionAttribute extends OoxmlAttributeBase {
128
+ readonly kind: 'genericExtension';
129
+ }
130
+ /** Any attribute on any node: the two typed ones, plus the verbatim catch-all. */
131
+ type OoxmlAttribute = OoxmlXmlSpaceAttribute | OoxmlWmlValAttribute | OoxmlGenericExtensionAttribute;
132
+ /**
133
+ * Attributes a TYPED node may carry.
134
+ *
135
+ * Excludes `w:val` on purpose: a node the engine models keeps its value in typed fields, and
136
+ * allowing a stray `w:val` alongside them would create two sources of truth for one property.
137
+ */
138
+ type OoxmlKnownNodeAttribute = OoxmlXmlSpaceAttribute | OoxmlGenericExtensionAttribute;
139
+ interface OoxmlElementBase<Children extends readonly OoxmlNode[] = readonly OoxmlNode[], Attributes extends readonly OoxmlAttribute[] = readonly OoxmlAttribute[]> {
140
+ readonly id: OoxmlNodeId;
141
+ readonly namespaceUri: string;
142
+ readonly localName: string;
143
+ /** Authored prefix retained as non-authoritative fidelity evidence. */
144
+ readonly prefix?: string;
145
+ /** Namespace declarations authored directly on this element, in source order. */
146
+ readonly namespaceBindings: readonly OoxmlNamespaceBinding[];
147
+ readonly attributes: Attributes;
148
+ readonly children: Children;
149
+ }
150
+ /** `w:document` — the root of a main document part. */
151
+ interface OoxmlDocumentNode extends OoxmlElementBase<readonly (OoxmlBodyNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
152
+ readonly kind: 'document';
153
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
154
+ readonly localName: 'document';
155
+ }
156
+ /** `w:body` — the main story's block content. */
157
+ interface OoxmlBodyNode extends OoxmlElementBase<readonly (OoxmlParagraphNode | OoxmlTableNode | OoxmlContentControlNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
158
+ readonly kind: 'body';
159
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
160
+ readonly localName: 'body';
161
+ }
162
+ interface OoxmlTableNode extends OoxmlElementBase<readonly (OoxmlTablePropertiesNode | OoxmlTableGridNode | OoxmlTableRowNode | OoxmlContentControlNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
163
+ readonly kind: 'table';
164
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
165
+ readonly localName: 'tbl';
166
+ }
167
+ interface OoxmlTableRowNode extends OoxmlElementBase<readonly (OoxmlTableCellNode | OoxmlContentControlNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
168
+ readonly kind: 'tableRow';
169
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
170
+ readonly localName: 'tr';
171
+ }
172
+ interface OoxmlTableCellNode extends OoxmlElementBase<readonly (OoxmlParagraphNode | OoxmlTableNode | OoxmlContentControlNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
173
+ readonly kind: 'tableCell';
174
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
175
+ readonly localName: 'tc';
176
+ }
177
+ /** Grid children (`w:gridCol`) stay generic: they are property leaves, not structure. */
178
+ interface OoxmlTableGridNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
179
+ readonly kind: 'tableGrid';
180
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
181
+ readonly localName: 'tblGrid';
182
+ }
183
+ /** Property children stay generic, mirroring `runProperties`. */
184
+ interface OoxmlTablePropertiesNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
185
+ readonly kind: 'tableProperties';
186
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
187
+ readonly localName: 'tblPr';
188
+ }
189
+ /**
190
+ * `w:p` — a paragraph, and the unit every offset in this engine is relative to.
191
+ *
192
+ * Positions are addressed as this node's id plus a UTF-16 offset, which is what makes a paragraph
193
+ * inside a table cell no different from one at the top level.
194
+ */
195
+ interface OoxmlParagraphNode extends OoxmlElementBase<readonly (OoxmlParagraphPropertiesNode | OoxmlRunNode | OoxmlHyperlinkNode | OoxmlContentControlNode | OoxmlBookmarkStartNode | OoxmlBookmarkEndNode | OoxmlRevisionContentNode | OoxmlRangeMarkerNode | OoxmlFldSimpleNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
196
+ readonly kind: 'paragraph';
197
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
198
+ readonly localName: 'p';
199
+ }
200
+ /**
201
+ * `CT_Hyperlink` (ECMA-376 §17.16.22) — a RUN CONTAINER, not a leaf.
202
+ *
203
+ * Its runs are part of the paragraph's inline sequence: they measure, paint, select and
204
+ * take offsets exactly like a run written directly under the `w:p`. Typing the element is
205
+ * what lets them in; while it was generic, its runs never reached the token stream and the
206
+ * words inside every link simply did not paint.
207
+ *
208
+ * Targets live in the ATTRIBUTES, and §17.16.22 declares exactly six. They divide into two
209
+ * groups, and the difference is load-bearing:
210
+ *
211
+ * MODELED `r:id` (a relationship, resolved against the owning part's rels), `w:anchor`
212
+ * (a bookmark name in this document) and `w:tooltip`. These are the three the
213
+ * ops read and write — `setHyperlinkTarget` sets one target attribute and
214
+ * CLEARS the other, so a link never carries both and resolves by the wrong one.
215
+ *
216
+ * PRESERVED `w:tgtFrame`, `w:docLocation` and `w:history`. Nothing in this engine
217
+ * interprets them and no op names them; they survive because attributes are
218
+ * carried verbatim, and `setHyperlinkTarget` must leave them exactly as
219
+ * authored. That is a REQUIREMENT, not an incidental property of the current
220
+ * applier: `w:docLocation` names a location inside the target document, so
221
+ * silently dropping it on a retarget would change where a link goes.
222
+ * `hyperlink-lossless-editing.test.ts` pins both against a retarget.
223
+ *
224
+ * Nothing here is a runtime URL — the sanitized projection is computed separately (see
225
+ * `hyperlinkTargetOf`), and only that reaches a DOM or navigation sink.
226
+ *
227
+ * Bookmark markers are admitted as children because Word writes them inside links; anything
228
+ * else it can carry (a drawing, a field, a nested SDT) stays `generic` at its position, so a
229
+ * link around a picture keeps both the picture and the link.
230
+ *
231
+ * A link may contain ANOTHER link: §17.16.22's content model is `EG_PContent`, which lists
232
+ * `w:hyperlink` among its own members. That is why this child union is self-referential
233
+ * rather than bottoming out at runs. Demoting the inner one to `generic` would have been the
234
+ * easier type, and it would have reintroduced exactly the bug typing this element fixed —
235
+ * a generic link's runs never reach the token stream, so the words inside it stop painting.
236
+ * Every walk that descends a link therefore recurses (`segmentsOf`, `runsUnder`,
237
+ * `runPropertyEdits`) instead of descending one level.
238
+ */
239
+ interface OoxmlHyperlinkNode extends OoxmlElementBase<readonly (OoxmlRunNode | OoxmlHyperlinkNode | OoxmlContentControlNode | OoxmlBookmarkStartNode | OoxmlBookmarkEndNode | OoxmlRevisionContentNode | OoxmlRangeMarkerNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
240
+ readonly kind: 'hyperlink';
241
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
242
+ readonly localName: 'hyperlink';
243
+ }
244
+ /**
245
+ * A content-position revision wrapper — `w:ins`, `w:del`, `w:moveFrom`, `w:moveTo`.
246
+ *
247
+ * These wrap runs, so a walk that visits only direct `run` children never reaches
248
+ * the content inside them. Typing them is what lets layout descend deliberately
249
+ * rather than treating tracked content as unknown markup.
250
+ *
251
+ * ECMA-376 §17.13.5.18/.14/.25/.29. All four extend `CT_TrackChange`: `@w:id` and
252
+ * `@w:author` are required, `@w:date` is optional and is never fabricated.
253
+ *
254
+ * The SAME element names appear in property positions — `w:pPr/w:rPr/w:ins` marks a
255
+ * paragraph mark, `w:trPr/w:del` marks a row — where they carry no content and mean
256
+ * something structurally different. Those stay generic; see `contentRevisionKind`.
257
+ */
258
+ interface OoxmlRevisionContentNode extends OoxmlElementBase<readonly (OoxmlRunNode | OoxmlRevisionContentNode | OoxmlHyperlinkNode | OoxmlRangeMarkerNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
259
+ readonly kind: 'revisionInsert' | 'revisionDelete' | 'revisionMoveFrom' | 'revisionMoveTo';
260
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
261
+ readonly localName: 'ins' | 'del' | 'moveFrom' | 'moveTo';
262
+ }
263
+ /**
264
+ * `w:bookmarkStart` — a ZERO-LENGTH point anchor (`@w:id`, `@w:name`).
265
+ *
266
+ * It takes no text offset and paints nothing; it only marks a position, which is what an
267
+ * internal hyperlink's `w:anchor` names. Split and join place it by that position, the
268
+ * behaviour `tree-op-split-anchors.test.ts` pins.
269
+ */
270
+ interface OoxmlBookmarkStartNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
271
+ readonly kind: 'bookmarkStart';
272
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
273
+ readonly localName: 'bookmarkStart';
274
+ }
275
+ /** `w:bookmarkEnd` — the closing point anchor (`@w:id`), zero-length like its start. */
276
+ interface OoxmlBookmarkEndNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
277
+ readonly kind: 'bookmarkEnd';
278
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
279
+ readonly localName: 'bookmarkEnd';
280
+ }
281
+ /**
282
+ * A range marker: the move-range and comment-range boundaries.
283
+ *
284
+ * Three of the base types in this family disagree, and the disagreement is load-bearing:
285
+ *
286
+ * - `w:moveFromRangeStart` / `w:moveToRangeStart` are `CT_MoveBookmark` (§17.13.5.22/.26):
287
+ * `@w:name`, `@w:author`, and `@w:date` are all REQUIRED.
288
+ * - `w:moveFromRangeEnd` / `w:moveToRangeEnd` / `w:commentRangeStart` / `w:commentRangeEnd`
289
+ * are `CT_MarkupRange` (§17.13.5.21): `@w:id` only, with NO author and NO date. Requiring
290
+ * provenance here refuses valid files; writing it emits invalid XML.
291
+ *
292
+ * Two different join keys ride on these: `@w:name` pairs a `moveFrom` range with its
293
+ * `moveTo` range, while `@w:id` pairs a range start with its own range end. In a real
294
+ * document the two halves of a named pair carry different ids, so neither key substitutes
295
+ * for the other.
296
+ */
297
+ interface OoxmlRangeMarkerNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
298
+ readonly kind: 'moveFromRangeStart' | 'moveFromRangeEnd' | 'moveToRangeStart' | 'moveToRangeEnd' | 'commentRangeStart' | 'commentRangeEnd';
299
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
300
+ readonly localName: 'moveFromRangeStart' | 'moveFromRangeEnd' | 'moveToRangeStart' | 'moveToRangeEnd' | 'commentRangeStart' | 'commentRangeEnd';
301
+ }
302
+ /** `w:commentReference` — the in-run mark that carries the comment's anchor point. */
303
+ interface OoxmlCommentReferenceNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
304
+ readonly kind: 'commentReference';
305
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
306
+ readonly localName: 'commentReference';
307
+ }
308
+ /** The `word/comments.xml` root (`CT_Comments`, §17.13.4.2). */
309
+ interface OoxmlCommentsNode extends OoxmlElementBase<readonly (OoxmlCommentNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
310
+ readonly kind: 'comments';
311
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
312
+ readonly localName: 'comments';
313
+ }
314
+ /**
315
+ * One comment (`CT_Comment`, §17.13.4.4) — `CT_TrackChange` plus `@w:initials`, holding
316
+ * block content. The block content is why a comment body is a story rather than a string.
317
+ */
318
+ interface OoxmlCommentNode extends OoxmlElementBase<readonly (OoxmlParagraphNode | OoxmlTableNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
319
+ readonly kind: 'comment';
320
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
321
+ readonly localName: 'comment';
322
+ }
323
+ /** `w:r` — a run: text and atoms sharing one set of character properties. */
324
+ interface OoxmlRunNode extends OoxmlElementBase<readonly (OoxmlRunPropertiesNode | OoxmlTextElementNode | OoxmlDeletedTextNode | OoxmlTabNode | OoxmlHardBreakNode | OoxmlCommentReferenceNode | OoxmlFldCharNode | OoxmlInstrTextNode | OoxmlNoteReferenceNode | OoxmlNoteRefNode | OoxmlSeparatorNode | OoxmlContinuationSeparatorNode | OoxmlDrawingNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
325
+ readonly kind: 'run';
326
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
327
+ readonly localName: 'r';
328
+ }
329
+ /** `w:drawing` — run content only; exactly one typed inline or anchored child. */
330
+ interface OoxmlDrawingNode extends OoxmlElementBase<readonly (OoxmlInlineDrawingNode | OoxmlAnchoredDrawingNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
331
+ readonly kind: 'drawing';
332
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
333
+ readonly localName: 'drawing';
334
+ }
335
+ /** `wp:inline` / `wp:anchor` shared payload children. */
336
+ type OoxmlDrawingAnchorChild = OoxmlDrawingExtentNode | OoxmlDrawingEffectExtentNode | OoxmlDrawingDocPrNode | OoxmlDrawingGraphicFramePrNode | OoxmlDrawingGraphicNode | OoxmlDrawingSimplePosNode | OoxmlDrawingPositionHNode | OoxmlDrawingPositionVNode | OoxmlDrawingWrapNoneNode | OoxmlDrawingWrapSquareNode | OoxmlDrawingWrapTightNode | OoxmlDrawingWrapThroughNode | OoxmlDrawingWrapTopBottomNode | OoxmlGenericElementNode;
337
+ /** `wp:inline` (`CT_Inline`) — typed only under `w:drawing`. */
338
+ interface OoxmlInlineDrawingNode extends OoxmlElementBase<readonly OoxmlDrawingAnchorChild[], readonly OoxmlKnownNodeAttribute[]> {
339
+ readonly kind: 'inlineDrawing';
340
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
341
+ readonly localName: 'inline';
342
+ }
343
+ /** `wp:anchor` (`CT_Anchor`) — typed only under `w:drawing`. */
344
+ interface OoxmlAnchoredDrawingNode extends OoxmlElementBase<readonly OoxmlDrawingAnchorChild[], readonly OoxmlKnownNodeAttribute[]> {
345
+ readonly kind: 'anchoredDrawing';
346
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
347
+ readonly localName: 'anchor';
348
+ }
349
+ interface OoxmlDrawingExtentNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
350
+ readonly kind: 'drawingExtent';
351
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
352
+ readonly localName: 'extent';
353
+ }
354
+ interface OoxmlDrawingEffectExtentNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
355
+ readonly kind: 'drawingEffectExtent';
356
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
357
+ readonly localName: 'effectExtent';
358
+ }
359
+ interface OoxmlDrawingDocPrNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
360
+ readonly kind: 'drawingDocPr';
361
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
362
+ readonly localName: 'docPr';
363
+ }
364
+ interface OoxmlDrawingGraphicFramePrNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
365
+ readonly kind: 'drawingGraphicFramePr';
366
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
367
+ readonly localName: 'cNvGraphicFramePr';
368
+ }
369
+ interface OoxmlDrawingGraphicNode extends OoxmlElementBase<readonly (OoxmlDrawingGraphicDataNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
370
+ readonly kind: 'drawingGraphic';
371
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
372
+ readonly localName: 'graphic';
373
+ }
374
+ interface OoxmlDrawingGraphicDataNode extends OoxmlElementBase<readonly (OoxmlPictureNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
375
+ readonly kind: 'drawingGraphicData';
376
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
377
+ readonly localName: 'graphicData';
378
+ }
379
+ interface OoxmlDrawingSimplePosNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
380
+ readonly kind: 'drawingSimplePos';
381
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
382
+ readonly localName: 'simplePos';
383
+ }
384
+ interface OoxmlDrawingPositionHNode extends OoxmlElementBase<readonly (OoxmlDrawingPositionAlignNode | OoxmlDrawingPositionOffsetNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
385
+ readonly kind: 'drawingPositionH';
386
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
387
+ readonly localName: 'positionH';
388
+ }
389
+ interface OoxmlDrawingPositionVNode extends OoxmlElementBase<readonly (OoxmlDrawingPositionAlignNode | OoxmlDrawingPositionOffsetNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
390
+ readonly kind: 'drawingPositionV';
391
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
392
+ readonly localName: 'positionV';
393
+ }
394
+ interface OoxmlDrawingPositionAlignNode extends OoxmlElementBase<readonly (OoxmlTextNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
395
+ readonly kind: 'drawingPositionAlign';
396
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
397
+ readonly localName: 'align';
398
+ }
399
+ interface OoxmlDrawingPositionOffsetNode extends OoxmlElementBase<readonly (OoxmlTextNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
400
+ readonly kind: 'drawingPositionOffset';
401
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
402
+ readonly localName: 'posOffset';
403
+ }
404
+ interface OoxmlDrawingWrapNoneNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
405
+ readonly kind: 'drawingWrapNone';
406
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
407
+ readonly localName: 'wrapNone';
408
+ }
409
+ interface OoxmlDrawingWrapSquareNode extends OoxmlElementBase<readonly (OoxmlDrawingEffectExtentNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
410
+ readonly kind: 'drawingWrapSquare';
411
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
412
+ readonly localName: 'wrapSquare';
413
+ }
414
+ interface OoxmlDrawingWrapTightNode extends OoxmlElementBase<readonly (OoxmlDrawingWrapPolygonNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
415
+ readonly kind: 'drawingWrapTight';
416
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
417
+ readonly localName: 'wrapTight';
418
+ }
419
+ interface OoxmlDrawingWrapThroughNode extends OoxmlElementBase<readonly (OoxmlDrawingWrapPolygonNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
420
+ readonly kind: 'drawingWrapThrough';
421
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
422
+ readonly localName: 'wrapThrough';
423
+ }
424
+ interface OoxmlDrawingWrapTopBottomNode extends OoxmlElementBase<readonly (OoxmlDrawingEffectExtentNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
425
+ readonly kind: 'drawingWrapTopBottom';
426
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
427
+ readonly localName: 'wrapTopAndBottom';
428
+ }
429
+ interface OoxmlDrawingWrapPolygonNode extends OoxmlElementBase<readonly (OoxmlDrawingWrapPolygonStartNode | OoxmlDrawingWrapPolygonLineToNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
430
+ readonly kind: 'drawingWrapPolygon';
431
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
432
+ readonly localName: 'wrapPolygon';
433
+ }
434
+ interface OoxmlDrawingWrapPolygonStartNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
435
+ readonly kind: 'drawingWrapPolygonStart';
436
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
437
+ readonly localName: 'start';
438
+ }
439
+ interface OoxmlDrawingWrapPolygonLineToNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
440
+ readonly kind: 'drawingWrapPolygonLineTo';
441
+ readonly namespaceUri: typeof WP_NAMESPACE_URI;
442
+ readonly localName: 'lineTo';
443
+ }
444
+ /** `pic:pic` (`CT_Picture`) — typed only under picture `a:graphicData`. */
445
+ interface OoxmlPictureNode extends OoxmlElementBase<readonly (OoxmlPictureNvPicPrNode | OoxmlPictureBlipFillNode | OoxmlPictureShapePropertiesNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
446
+ readonly kind: 'picture';
447
+ readonly namespaceUri: typeof PIC_NAMESPACE_URI;
448
+ readonly localName: 'pic';
449
+ }
450
+ interface OoxmlPictureNvPicPrNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
451
+ readonly kind: 'pictureNvPicPr';
452
+ readonly namespaceUri: typeof PIC_NAMESPACE_URI;
453
+ readonly localName: 'nvPicPr';
454
+ }
455
+ interface OoxmlPictureBlipFillNode extends OoxmlElementBase<readonly (OoxmlPictureBlipNode | OoxmlPictureSrcRectNode | OoxmlPictureStretchNode | OoxmlPictureTileNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
456
+ readonly kind: 'pictureBlipFill';
457
+ readonly namespaceUri: typeof PIC_NAMESPACE_URI;
458
+ readonly localName: 'blipFill';
459
+ }
460
+ interface OoxmlPictureBlipNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
461
+ readonly kind: 'pictureBlip';
462
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
463
+ readonly localName: 'blip';
464
+ }
465
+ interface OoxmlPictureSrcRectNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
466
+ readonly kind: 'pictureSrcRect';
467
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
468
+ readonly localName: 'srcRect';
469
+ }
470
+ interface OoxmlPictureStretchNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
471
+ readonly kind: 'pictureStretch';
472
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
473
+ readonly localName: 'stretch';
474
+ }
475
+ interface OoxmlPictureTileNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
476
+ readonly kind: 'pictureTile';
477
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
478
+ readonly localName: 'tile';
479
+ }
480
+ interface OoxmlPictureShapePropertiesNode extends OoxmlElementBase<readonly (OoxmlPictureTransformNode | OoxmlPicturePresetGeometryNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
481
+ readonly kind: 'pictureShapeProperties';
482
+ readonly namespaceUri: typeof PIC_NAMESPACE_URI;
483
+ readonly localName: 'spPr';
484
+ }
485
+ interface OoxmlPictureTransformNode extends OoxmlElementBase<readonly (OoxmlPictureTransformOffsetNode | OoxmlPictureTransformExtentNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
486
+ readonly kind: 'pictureTransform';
487
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
488
+ readonly localName: 'xfrm';
489
+ }
490
+ interface OoxmlPictureTransformOffsetNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
491
+ readonly kind: 'pictureTransformOffset';
492
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
493
+ readonly localName: 'off';
494
+ }
495
+ interface OoxmlPictureTransformExtentNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
496
+ readonly kind: 'pictureTransformExtent';
497
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
498
+ readonly localName: 'ext';
499
+ }
500
+ interface OoxmlPicturePresetGeometryNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
501
+ readonly kind: 'picturePresetGeometry';
502
+ readonly namespaceUri: typeof DRAWINGML_MAIN_NAMESPACE_URI;
503
+ readonly localName: 'prstGeom';
504
+ }
505
+ /**
506
+ * `w:delText` (§17.3.3.7) — the text container a run uses once its content is deleted.
507
+ *
508
+ * Structurally identical to `w:t`, and deliberately a DIFFERENT kind: it must never flow
509
+ * as ordinary text, and rejecting the deletion that contains it turns it back into `w:t`.
510
+ */
511
+ interface OoxmlDeletedTextNode extends OoxmlElementBase<readonly OoxmlTextNode[], readonly OoxmlKnownNodeAttribute[]> {
512
+ readonly kind: 'deletedText';
513
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
514
+ readonly localName: 'delText';
515
+ }
516
+ /**
517
+ * `w:rPr` — a run's character properties, whose children stay GENERIC.
518
+ *
519
+ * Deliberately unmodelled below this point: the property vocabulary is large and mostly
520
+ * uninteresting to layout, so carrying it verbatim preserves everything without the engine having
521
+ * to know what each element means.
522
+ */
523
+ interface OoxmlRunPropertiesNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
524
+ readonly kind: 'runProperties';
525
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
526
+ readonly localName: 'rPr';
527
+ }
528
+ /** `w:t` — the element holding a run's literal characters. */
529
+ interface OoxmlTextElementNode extends OoxmlElementBase<readonly OoxmlTextNode[], readonly OoxmlKnownNodeAttribute[]> {
530
+ readonly kind: 'text';
531
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
532
+ readonly localName: 't';
533
+ }
534
+ /** `w:pPr` — a paragraph's properties. Children stay generic, like `w:rPr`'s. */
535
+ interface OoxmlParagraphPropertiesNode extends OoxmlElementBase<readonly (OoxmlRunPropertiesNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
536
+ readonly kind: 'paragraphProperties';
537
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
538
+ readonly localName: 'pPr';
539
+ }
540
+ /** `w:tab` inside a run — one tab character as its own element. */
541
+ interface OoxmlTabNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
542
+ readonly kind: 'tab';
543
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
544
+ readonly localName: 'tab';
545
+ }
546
+ /** `w:br` — a line, column or page break inside a run. */
547
+ interface OoxmlHardBreakNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
548
+ readonly kind: 'hardBreak';
549
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
550
+ readonly localName: 'br';
551
+ }
552
+ /**
553
+ * Complex-field character (`w:fldChar`).
554
+ *
555
+ * Children stay generic so `w:ffData` (legacy form fields / macros) round-trips as inert
556
+ * payload and is never promoted to an executable surface. `@w:fldCharType`, `@w:dirty`,
557
+ * and `@w:fldLock` are preserved on `attributes`.
558
+ */
559
+ interface OoxmlFldCharNode extends OoxmlElementBase<readonly OoxmlGenericElementNode[], readonly OoxmlKnownNodeAttribute[]> {
560
+ readonly kind: 'fldChar';
561
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
562
+ readonly localName: 'fldChar';
563
+ }
564
+ /**
565
+ * Field instruction text (`w:instrText`), same text-carrier shape as `w:t`.
566
+ *
567
+ * Instruction strings are never executed; layout may recognize allowlisted page-number
568
+ * keywords only.
569
+ */
570
+ interface OoxmlInstrTextNode extends OoxmlElementBase<readonly OoxmlTextNode[], readonly OoxmlKnownNodeAttribute[]> {
571
+ readonly kind: 'instrText';
572
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
573
+ readonly localName: 'instrText';
574
+ }
575
+ /**
576
+ * Simple field (`w:fldSimple`) at paragraph content level.
577
+ *
578
+ * `@w:instr`, `@w:dirty`, and `@w:fldLock` round-trip on `attributes`. Cached result
579
+ * children stay structurally preserved; the field is one atomic addressable unit.
580
+ */
581
+ interface OoxmlFldSimpleNode extends OoxmlElementBase<readonly (OoxmlRunNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
582
+ readonly kind: 'fldSimple';
583
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
584
+ readonly localName: 'fldSimple';
585
+ }
586
+ /**
587
+ * Footnotes part root (`w:footnotes`). Children are typed notes or preserved generics.
588
+ * Never a story root itself — each note body is its own story for layout.
589
+ */
590
+ interface OoxmlFootnotesNode extends OoxmlElementBase<readonly (OoxmlNoteNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
591
+ readonly kind: 'footnotes';
592
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
593
+ readonly localName: 'footnotes';
594
+ }
595
+ /**
596
+ * Endnotes part root (`w:endnotes`). Same content model as {@link OoxmlFootnotesNode}.
597
+ */
598
+ interface OoxmlEndnotesNode extends OoxmlElementBase<readonly (OoxmlNoteNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
599
+ readonly kind: 'endnotes';
600
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
601
+ readonly localName: 'endnotes';
602
+ }
603
+ /**
604
+ * One footnote or endnote (`w:footnote` / `w:endnote`).
605
+ *
606
+ * Discriminated by `localName`. `@w:id` and optional `@w:type` (`ST_FtnEdn`, including
607
+ * authored `normal`) live on `attributes`. Children are ordinary block content.
608
+ */
609
+ interface OoxmlNoteNode extends OoxmlElementBase<readonly (OoxmlParagraphNode | OoxmlTableNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
610
+ readonly kind: 'note';
611
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
612
+ readonly localName: 'footnote' | 'endnote';
613
+ }
614
+ /**
615
+ * Body citation (`w:footnoteReference` / `w:endnoteReference`) as a typed run child.
616
+ * Display mark is derived — never stored as text. One UTF-16 atom in addressing.
617
+ */
618
+ interface OoxmlNoteReferenceNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
619
+ readonly kind: 'noteReference';
620
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
621
+ readonly localName: 'footnoteReference' | 'endnoteReference';
622
+ }
623
+ /**
624
+ * Auto mark inside a note body (`w:footnoteRef` / `w:endnoteRef`).
625
+ * One UTF-16 atom; display digit is derived at paint time.
626
+ */
627
+ interface OoxmlNoteRefNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
628
+ readonly kind: 'noteRef';
629
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
630
+ readonly localName: 'footnoteRef' | 'endnoteRef';
631
+ }
632
+ /** Run-inner separator rule (`w:separator`). One UTF-16 atom. */
633
+ interface OoxmlSeparatorNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
634
+ readonly kind: 'separator';
635
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
636
+ readonly localName: 'separator';
637
+ }
638
+ /** Run-inner continuation separator (`w:continuationSeparator`). One UTF-16 atom. */
639
+ interface OoxmlContinuationSeparatorNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
640
+ readonly kind: 'continuationSeparator';
641
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
642
+ readonly localName: 'continuationSeparator';
643
+ }
644
+ /**
645
+ * `w:sdt` — structured document tag (content control) at block, inline, row, or cell level.
646
+ *
647
+ * Placement is not a separate kind: the same element name appears in every `EG_*Content`
648
+ * group. Child shape is the union of those placements; parents admit the control wherever
649
+ * `generic` was previously accepted (see `isPreservedChild`). Identity is the node id —
650
+ * `w:id` inside `w:sdtPr` is optional, preserved when present, never fabricated here.
651
+ */
652
+ interface OoxmlContentControlNode extends OoxmlElementBase<readonly (OoxmlContentControlPropertiesNode | OoxmlContentControlEndPropertiesNode | OoxmlContentControlContentNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
653
+ readonly kind: 'contentControl';
654
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
655
+ readonly localName: 'sdt';
656
+ }
657
+ /**
658
+ * `w:sdtPr` (`CT_SdtPr`) — schema-ordered properties. Unmodelled children (alias/tag/id/lock
659
+ * leaves with `w:val`, `w15:*`, empty type markers) stay `generic` in position. Typed
660
+ * payloads: dropdown/combo/listItem, date (+ leaves), text, dataBinding, `w14:checkbox`.
661
+ */
662
+ interface OoxmlContentControlPropertiesNode extends OoxmlElementBase<readonly (OoxmlRunPropertiesNode | OoxmlContentControlDataBindingNode | OoxmlContentControlDropDownListNode | OoxmlContentControlComboBoxNode | OoxmlContentControlDateNode | OoxmlContentControlTextNode | OoxmlContentControlCheckboxNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
663
+ readonly kind: 'contentControlProperties';
664
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
665
+ readonly localName: 'sdtPr';
666
+ }
667
+ /** `w:sdtEndPr` — end-character properties; children are `w:rPr` or generic. */
668
+ interface OoxmlContentControlEndPropertiesNode extends OoxmlElementBase<readonly (OoxmlRunPropertiesNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
669
+ readonly kind: 'contentControlEndProperties';
670
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
671
+ readonly localName: 'sdtEndPr';
672
+ }
673
+ /**
674
+ * `w:sdtContent` — control contents for every placement. Block content is paragraphs/tables;
675
+ * inline content is runs/hyperlinks; row/cell content is rows/cells. Nested controls stay typed.
676
+ */
677
+ interface OoxmlContentControlContentNode extends OoxmlElementBase<readonly OoxmlNode[], readonly OoxmlKnownNodeAttribute[]> {
678
+ readonly kind: 'contentControlContent';
679
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
680
+ readonly localName: 'sdtContent';
681
+ }
682
+ /** `w:dropDownList` — `@w:lastValue` plus typed `w:listItem` children. */
683
+ interface OoxmlContentControlDropDownListNode extends OoxmlElementBase<readonly (OoxmlContentControlListItemNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
684
+ readonly kind: 'contentControlDropDownList';
685
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
686
+ readonly localName: 'dropDownList';
687
+ }
688
+ /** `w:comboBox` — same payload shape as dropdown; free entry is an editing concern. */
689
+ interface OoxmlContentControlComboBoxNode extends OoxmlElementBase<readonly (OoxmlContentControlListItemNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
690
+ readonly kind: 'contentControlComboBox';
691
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
692
+ readonly localName: 'comboBox';
693
+ }
694
+ /** `w:listItem` — `@w:displayText` / `@w:value` as preserved attributes (not `w:val`). */
695
+ interface OoxmlContentControlListItemNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
696
+ readonly kind: 'contentControlListItem';
697
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
698
+ readonly localName: 'listItem';
699
+ }
700
+ /**
701
+ * `w:date` — `@w:fullDate` plus typed dateFormat/lid/storeMappedDataAs/calendar leaves.
702
+ * Those leaves allow `w:val` (the only known kinds that do) so they are not demoted.
703
+ */
704
+ interface OoxmlContentControlDateNode extends OoxmlElementBase<readonly (OoxmlContentControlDateFormatNode | OoxmlContentControlLidNode | OoxmlContentControlStoreMappedDataAsNode | OoxmlContentControlCalendarNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
705
+ readonly kind: 'contentControlDate';
706
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
707
+ readonly localName: 'date';
708
+ }
709
+ /** `w:dateFormat` — the picture string a date picker formats its value with. */
710
+ interface OoxmlContentControlDateFormatNode extends OoxmlElementBase<readonly [], readonly (OoxmlKnownNodeAttribute | OoxmlWmlValAttribute)[]> {
711
+ readonly kind: 'contentControlDateFormat';
712
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
713
+ readonly localName: 'dateFormat';
714
+ }
715
+ /** `w:lid` — the language id a date picker parses and formats under. */
716
+ interface OoxmlContentControlLidNode extends OoxmlElementBase<readonly [], readonly (OoxmlKnownNodeAttribute | OoxmlWmlValAttribute)[]> {
717
+ readonly kind: 'contentControlLid';
718
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
719
+ readonly localName: 'lid';
720
+ }
721
+ /** `w:storeMappedDataAs` — which representation a bound date is written to its XML part as. */
722
+ interface OoxmlContentControlStoreMappedDataAsNode extends OoxmlElementBase<readonly [], readonly (OoxmlKnownNodeAttribute | OoxmlWmlValAttribute)[]> {
723
+ readonly kind: 'contentControlStoreMappedDataAs';
724
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
725
+ readonly localName: 'storeMappedDataAs';
726
+ }
727
+ /** `w:calendar` — which calendar system a date picker uses (Gregorian, Hijri, …). */
728
+ interface OoxmlContentControlCalendarNode extends OoxmlElementBase<readonly [], readonly (OoxmlKnownNodeAttribute | OoxmlWmlValAttribute)[]> {
729
+ readonly kind: 'contentControlCalendar';
730
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
731
+ readonly localName: 'calendar';
732
+ }
733
+ /** `w:text` (`CT_SdtText`) — distinct from `w:t` (`kind: 'text'`). `@w:multiLine` preserved. */
734
+ interface OoxmlContentControlTextNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
735
+ readonly kind: 'contentControlText';
736
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
737
+ readonly localName: 'text';
738
+ }
739
+ /**
740
+ * `w:dataBinding` — xpath / storeItemID / prefixMappings preserved as attributes.
741
+ * This tree never resolves or fetches the binding target.
742
+ */
743
+ interface OoxmlContentControlDataBindingNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
744
+ readonly kind: 'contentControlDataBinding';
745
+ readonly namespaceUri: typeof WML_NAMESPACE_URI;
746
+ readonly localName: 'dataBinding';
747
+ }
748
+ /**
749
+ * `w14:checkbox` — Microsoft extension, not an ECMA-376 type choice. Distinguishable from
750
+ * untyped rich-text controls that merely wrap a `w:sym`.
751
+ */
752
+ interface OoxmlContentControlCheckboxNode extends OoxmlElementBase<readonly (OoxmlContentControlCheckedNode | OoxmlContentControlCheckedStateNode | OoxmlContentControlUncheckedStateNode | OoxmlGenericElementNode)[], readonly OoxmlKnownNodeAttribute[]> {
753
+ readonly kind: 'contentControlCheckbox';
754
+ readonly namespaceUri: typeof W14_NAMESPACE_URI;
755
+ readonly localName: 'checkbox';
756
+ }
757
+ /** `w14:checked` — a checkbox's recorded state, independent of the glyph drawn for it. */
758
+ interface OoxmlContentControlCheckedNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
759
+ readonly kind: 'contentControlChecked';
760
+ readonly namespaceUri: typeof W14_NAMESPACE_URI;
761
+ readonly localName: 'checked';
762
+ }
763
+ /** `w14:checkedState` — the font and code point drawn when a checkbox is checked. */
764
+ interface OoxmlContentControlCheckedStateNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
765
+ readonly kind: 'contentControlCheckedState';
766
+ readonly namespaceUri: typeof W14_NAMESPACE_URI;
767
+ readonly localName: 'checkedState';
768
+ }
769
+ /** `w14:uncheckedState` — the font and code point drawn when a checkbox is not checked. */
770
+ interface OoxmlContentControlUncheckedStateNode extends OoxmlElementBase<readonly [], readonly OoxmlKnownNodeAttribute[]> {
771
+ readonly kind: 'contentControlUncheckedState';
772
+ readonly namespaceUri: typeof W14_NAMESPACE_URI;
773
+ readonly localName: 'uncheckedState';
774
+ }
775
+ /**
776
+ * Any element the typed vocabulary does not cover — the other half of the preservation model.
777
+ *
778
+ * Also where a KNOWN element lands when it appears somewhere invalid: an element is demoted to
779
+ * generic rather than rejected, so malformed or unfamiliar content is carried losslessly and
780
+ * never locks editing.
781
+ */
782
+ interface OoxmlGenericElementNode extends OoxmlElementBase<readonly OoxmlNode[]> {
783
+ readonly kind: 'generic';
784
+ }
785
+ /** A literal text value. The only node kind with no children and no attributes. */
786
+ interface OoxmlTextNode {
787
+ readonly id: OoxmlNodeId;
788
+ readonly kind: 'textValue';
789
+ readonly value: string;
790
+ }
791
+ /** Every element node kind: the typed vocabulary plus the generic catch-all. */
792
+ type OoxmlElement = OoxmlDocumentNode | OoxmlBodyNode | OoxmlParagraphNode | OoxmlRunNode | OoxmlHyperlinkNode | OoxmlBookmarkStartNode | OoxmlBookmarkEndNode | OoxmlRunPropertiesNode | OoxmlTextElementNode | OoxmlDeletedTextNode | OoxmlParagraphPropertiesNode | OoxmlTabNode | OoxmlHardBreakNode | OoxmlFldCharNode | OoxmlInstrTextNode | OoxmlFldSimpleNode | OoxmlFootnotesNode | OoxmlEndnotesNode | OoxmlNoteNode | OoxmlNoteReferenceNode | OoxmlNoteRefNode | OoxmlSeparatorNode | OoxmlContinuationSeparatorNode | OoxmlTableNode | OoxmlTableRowNode | OoxmlTableCellNode | OoxmlTableGridNode | OoxmlTablePropertiesNode | OoxmlRevisionContentNode | OoxmlRangeMarkerNode | OoxmlCommentReferenceNode | OoxmlCommentsNode | OoxmlCommentNode | OoxmlContentControlNode | OoxmlContentControlPropertiesNode | OoxmlContentControlEndPropertiesNode | OoxmlContentControlContentNode | OoxmlContentControlDropDownListNode | OoxmlContentControlComboBoxNode | OoxmlContentControlListItemNode | OoxmlContentControlDateNode | OoxmlContentControlDateFormatNode | OoxmlContentControlLidNode | OoxmlContentControlStoreMappedDataAsNode | OoxmlContentControlCalendarNode | OoxmlContentControlTextNode | OoxmlContentControlDataBindingNode | OoxmlContentControlCheckboxNode | OoxmlContentControlCheckedNode | OoxmlContentControlCheckedStateNode | OoxmlContentControlUncheckedStateNode | OoxmlDrawingNode | OoxmlInlineDrawingNode | OoxmlAnchoredDrawingNode | OoxmlDrawingExtentNode | OoxmlDrawingEffectExtentNode | OoxmlDrawingDocPrNode | OoxmlDrawingGraphicFramePrNode | OoxmlDrawingGraphicNode | OoxmlDrawingGraphicDataNode | OoxmlDrawingSimplePosNode | OoxmlDrawingPositionHNode | OoxmlDrawingPositionVNode | OoxmlDrawingPositionAlignNode | OoxmlDrawingPositionOffsetNode | OoxmlDrawingWrapNoneNode | OoxmlDrawingWrapSquareNode | OoxmlDrawingWrapTightNode | OoxmlDrawingWrapThroughNode | OoxmlDrawingWrapTopBottomNode | OoxmlDrawingWrapPolygonNode | OoxmlDrawingWrapPolygonStartNode | OoxmlDrawingWrapPolygonLineToNode | OoxmlPictureNode | OoxmlPictureNvPicPrNode | OoxmlPictureBlipFillNode | OoxmlPictureBlipNode | OoxmlPictureSrcRectNode | OoxmlPictureStretchNode | OoxmlPictureTileNode | OoxmlPictureShapePropertiesNode | OoxmlPictureTransformNode | OoxmlPictureTransformOffsetNode | OoxmlPictureTransformExtentNode | OoxmlPicturePresetGeometryNode | OoxmlGenericElementNode;
793
+ /**
794
+ * Any node in the canonical tree.
795
+ *
796
+ * Typed where layout needs structure, generic everywhere else — one tree carries a whole document
797
+ * whether or not the engine understands every part of it.
798
+ */
799
+ type OoxmlNode = OoxmlElement | OoxmlTextNode;
800
+ /** One XML part of the package, parsed into a canonical tree. */
801
+ interface OoxmlPart {
802
+ readonly id: string;
803
+ /** Canonical part name, e.g. `/word/document.xml`. */
804
+ readonly name: string;
805
+ readonly contentType: string;
806
+ readonly root: OoxmlElement;
807
+ }
808
+ /** A part's identity without its tree — enough to enumerate a package cheaply. */
809
+ interface OoxmlPartMetadata {
810
+ readonly name: string;
811
+ readonly contentType: string;
812
+ }
813
+ /**
814
+ * Why a part could not be read into a tree.
815
+ *
816
+ * Widens the XML-level rejections with the tree-level ones. All of them describe the FILE, which
817
+ * is why reading returns a result rather than throwing.
818
+ */
819
+ type OoxmlReadRejection = XmlRejection | 'missing-root' | 'multiple-roots' | 'invalid-name' | 'invalid-namespace' | 'undeclared-prefix' | 'duplicate-expanded-attribute';
820
+ /** A parsed part, or a typed refusal. Never throws — the input is untrusted by definition. */
821
+ type OoxmlReadResult = {
822
+ readonly ok: true;
823
+ readonly part: OoxmlPart;
824
+ } | {
825
+ readonly ok: false;
826
+ readonly reason: OoxmlReadRejection;
827
+ };
828
+ /**
829
+ * The node-identity contract, written down as a type so it is checkable rather than merely
830
+ * documented.
831
+ *
832
+ * Ids are deterministic from a normalized parse, retained through structural sharing, explicit on
833
+ * replacement, and unique within a part. Everything that addresses nodes — ops, the caret, the
834
+ * paraId bimap — depends on all four holding.
835
+ */
836
+ interface OoxmlNodeIdentityRules {
837
+ readonly initial: 'deterministic-structural-path-after-normalized-parse';
838
+ readonly unchanged: 'retain-id-through-structural-sharing';
839
+ readonly replacement: 'explicitly-retain-or-allocate';
840
+ readonly uniqueness: 'unique-within-part';
841
+ }
842
+ /**
843
+ * Identity policy for future immutable tree edits. This defines the boundary
844
+ * without implementing task 2.4 edit primitives.
845
+ */
846
+ declare const OOXML_NODE_IDENTITY_RULES: OoxmlNodeIdentityRules;
847
+ /** What a tree invariant walk found wrong. Each names a rule the canonical tree must satisfy. */
848
+ type OoxmlInvariantIssueCode = 'invalid-id' | 'duplicate-id' | 'invalid-name' | 'invalid-namespace' | 'invalid-qname' | 'duplicate-expanded-attribute' | 'invalid-xml-value' | 'known-node-invariant';
849
+ /** One invariant violation, located by structural path and node id. */
850
+ interface OoxmlInvariantIssue {
851
+ readonly code: OoxmlInvariantIssueCode;
852
+ readonly path: string;
853
+ readonly nodeId?: string;
854
+ }
855
+ /** Whether a tree satisfies its invariants, listing every violation when it does not. */
856
+ type OoxmlInvariantResult = {
857
+ readonly ok: true;
858
+ } | {
859
+ readonly ok: false;
860
+ readonly issues: readonly OoxmlInvariantIssue[];
861
+ };
862
+ /**
863
+ * Read one XML part into the additive typed/generic foundation. Existing package
864
+ * parsing and DocumentStore models intentionally remain unchanged until their
865
+ * later migration tasks; this tree is not yet the repository's sole runtime authority.
866
+ * Structural-path IDs are deterministic across normalized reopen. Preserving an
867
+ * identity through moves and edits is deferred to PackageModel/DocumentStore integration.
868
+ */
869
+ declare function readOoxmlPart(xml: string, metadata: OoxmlPartMetadata, limits?: XmlLimits): OoxmlReadResult;
870
+
871
+ export { type OoxmlPartMetadata as $, type OoxmlBookmarkEndNode as A, type OoxmlBookmarkStartNode as B, type OoxmlContentControlCalendarNode as C, type OoxmlContentControlCheckboxNode as D, type OoxmlContentControlCheckedNode as E, type OoxmlContentControlCheckedStateNode as F, type OoxmlContentControlComboBoxNode as G, type OoxmlContentControlDataBindingNode as H, type OoxmlContentControlDateFormatNode as I, type OoxmlContentControlDateNode as J, type OoxmlContentControlDropDownListNode as K, type OoxmlContentControlLidNode as L, type OoxmlContentControlListItemNode as M, type OoxmlContentControlStoreMappedDataAsNode as N, type OoxmlNode as O, type OoxmlContentControlTextNode as P, type OoxmlContentControlUncheckedStateNode as Q, type OoxmlDocumentNode as R, type OoxmlGenericExtensionAttribute as S, type OoxmlHyperlinkNode as T, type OoxmlInvariantIssueCode as U, type OoxmlKnownNodeAttribute as V, type OoxmlNamespaceBinding as W, type XmlLimits as X, type OoxmlNodeId as Y, type OoxmlNodeIdentityRules as Z, type OoxmlParagraphPropertiesNode as _, type OoxmlElement as a, type OoxmlReadResult as a0, type OoxmlRunNode as a1, type OoxmlRunPropertiesNode as a2, type OoxmlTabNode as a3, type OoxmlTextElementNode as a4, type OoxmlTextNode as a5, type OoxmlWmlValAttribute as a6, type OoxmlXmlSpaceAttribute as a7, WML_NAMESPACE_URI as a8, XMLNS_NAMESPACE_URI as a9, XML_NAMESPACE_URI as aa, type XmlNode as ab, type XmlRejection as ac, type XmlResult as ad, childElements as ae, findElement as af, isContentRevisionKind as ag, isRangeMarkerKind as ah, readOnOffChild as ai, readOoxmlPart as aj, readXml as ak, textContent as al, type OoxmlContentControlNode as b, type OoxmlGenericElementNode as c, type OoxmlContentControlContentNode as d, type OoxmlPart as e, type OoxmlParagraphNode as f, type OoxmlNoteNode as g, type OoxmlContinuationSeparatorNode as h, type OoxmlEndnotesNode as i, type OoxmlFootnotesNode as j, type OoxmlNoteRefNode as k, type OoxmlNoteReferenceNode as l, type OoxmlSeparatorNode as m, type OoxmlReadRejection as n, type OoxmlDrawingNode as o, type OoxmlContentControlEndPropertiesNode as p, type OoxmlContentControlPropertiesNode as q, type OoxmlInvariantResult as r, type OoxmlInvariantIssue as s, type OoxmlHardBreakNode as t, type OoxmlFldCharNode as u, type OoxmlFldSimpleNode as v, type OoxmlInstrTextNode as w, type OoxmlAttribute as x, OOXML_NODE_IDENTITY_RULES as y, type OoxmlBodyNode as z };