@docx4j/core-ts 0.4.0 → 0.6.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 (166) hide show
  1. package/NOTICE +4 -0
  2. package/README.md +34 -3
  3. package/dist/html/convert.mjs +40 -15
  4. package/dist/html/elements.mjs +2 -1
  5. package/dist/model/color/ColorMath.d.mts +29 -0
  6. package/dist/model/color/ColorMath.mjs +146 -0
  7. package/dist/model/color/ColorTables.d.mts +6 -0
  8. package/dist/model/color/ColorTables.mjs +83 -0
  9. package/dist/model/color/DrawingMLColors.d.mts +52 -0
  10. package/dist/model/color/DrawingMLColors.mjs +374 -0
  11. package/dist/model/color/ResolvedColor.d.mts +36 -0
  12. package/dist/model/color/ResolvedColor.mjs +65 -0
  13. package/dist/model/color/SpreadsheetColors.d.mts +36 -0
  14. package/dist/model/color/SpreadsheetColors.mjs +84 -0
  15. package/dist/model/color/StyleFill.d.mts +28 -0
  16. package/dist/model/color/StyleFill.mjs +21 -0
  17. package/dist/model/color/ThemeColors.d.mts +86 -0
  18. package/dist/model/color/ThemeColors.mjs +304 -0
  19. package/dist/model/color/WordColors.d.mts +71 -0
  20. package/dist/model/color/WordColors.mjs +121 -0
  21. package/dist/model/color/index.d.mts +6 -0
  22. package/dist/model/color/index.mjs +30 -0
  23. package/dist/model/content/Body.d.mts +153 -19
  24. package/dist/model/content/Body.mjs +570 -131
  25. package/dist/model/content/Comment.d.mts +21 -3
  26. package/dist/model/content/Comment.mjs +202 -19
  27. package/dist/model/content/ContentControl.d.mts +197 -18
  28. package/dist/model/content/ContentControl.mjs +664 -95
  29. package/dist/model/content/Font.d.mts +67 -17
  30. package/dist/model/content/Font.mjs +114 -35
  31. package/dist/model/content/InlinePicture.d.mts +82 -7
  32. package/dist/model/content/InlinePicture.mjs +221 -28
  33. package/dist/model/content/List.mjs +13 -1
  34. package/dist/model/content/Paragraph.d.mts +213 -14
  35. package/dist/model/content/Paragraph.mjs +936 -100
  36. package/dist/model/content/Range.d.mts +242 -11
  37. package/dist/model/content/Range.mjs +975 -119
  38. package/dist/model/content/ResolvedView.d.mts +104 -0
  39. package/dist/model/content/ResolvedView.mjs +596 -0
  40. package/dist/model/content/Table.d.mts +29 -3
  41. package/dist/model/content/Table.mjs +109 -33
  42. package/dist/model/content/TrackedChange.d.mts +301 -16
  43. package/dist/model/content/TrackedChange.mjs +1284 -158
  44. package/dist/model/content/binder.d.mts +2 -1
  45. package/dist/model/content/binder.mjs +48 -1
  46. package/dist/model/content/comments.d.mts +20 -6
  47. package/dist/model/content/comments.mjs +67 -57
  48. package/dist/model/content/generalException.d.mts +18 -0
  49. package/dist/model/content/generalException.mjs +24 -0
  50. package/dist/model/content/index.d.mts +8 -3
  51. package/dist/model/content/index.mjs +7 -2
  52. package/dist/model/content/mathText.d.mts +21 -0
  53. package/dist/model/content/mathText.mjs +267 -0
  54. package/dist/model/content/officeText.d.mts +27 -0
  55. package/dist/model/content/officeText.mjs +74 -0
  56. package/dist/model/content/outline.d.mts +5 -0
  57. package/dist/model/content/outline.mjs +13 -0
  58. package/dist/model/content/placeholders.d.mts +110 -0
  59. package/dist/model/content/placeholders.mjs +253 -0
  60. package/dist/model/content/relationships.d.mts +30 -0
  61. package/dist/model/content/relationships.mjs +133 -0
  62. package/dist/model/content/search.d.mts +72 -0
  63. package/dist/model/content/search.mjs +204 -2
  64. package/dist/model/content/spanEdits.d.mts +159 -0
  65. package/dist/model/content/spanEdits.mjs +728 -0
  66. package/dist/model/content/story.d.mts +44 -0
  67. package/dist/model/content/story.mjs +92 -0
  68. package/dist/model/content/tableColumns.d.mts +1 -1
  69. package/dist/model/content/tableColumns.mjs +108 -80
  70. package/dist/model/content/tableRevisions.d.mts +11 -3
  71. package/dist/model/content/tableRevisions.mjs +72 -42
  72. package/dist/model/content/tableRules.d.mts +30 -0
  73. package/dist/model/content/tableRules.mjs +100 -0
  74. package/dist/model/content/textBoxes.d.mts +18 -0
  75. package/dist/model/content/textBoxes.mjs +105 -0
  76. package/dist/model/content/trackedChangeFilter.d.mts +39 -0
  77. package/dist/model/content/trackedChangeFilter.mjs +81 -0
  78. package/dist/model/content/tracking.d.mts +28 -0
  79. package/dist/model/content/tracking.mjs +149 -10
  80. package/dist/model/content/tree.d.mts +212 -13
  81. package/dist/model/content/tree.mjs +356 -35
  82. package/dist/model/customxml/CustomXmlPartCollection.d.mts +8 -0
  83. package/dist/model/customxml/CustomXmlPartCollection.mjs +34 -11
  84. package/dist/model/customxml/XmlMapping.d.mts +1 -1
  85. package/dist/model/customxml/XmlMapping.mjs +11 -0
  86. package/dist/model/customxml/bindings.d.mts +21 -2
  87. package/dist/model/customxml/bindings.mjs +76 -32
  88. package/dist/model/customxml/kinds.d.mts +8 -3
  89. package/dist/model/customxml/kinds.mjs +26 -5
  90. package/dist/model/customxml/picturePlaceholder.d.mts +17 -0
  91. package/dist/model/customxml/picturePlaceholder.mjs +32 -0
  92. package/dist/model/customxml/pictures.d.mts +9 -5
  93. package/dist/model/customxml/pictures.mjs +31 -13
  94. package/dist/model/customxml/xhtml.mjs +8 -2
  95. package/dist/model/fonts/families.generated.mjs +2 -2
  96. package/dist/model/fonts/registry.mjs +7 -1
  97. package/dist/model/fonts/substitutions.generated.mjs +2 -2
  98. package/dist/model/fonts/themes.generated.mjs +1 -1
  99. package/dist/model/index.d.mts +2 -0
  100. package/dist/model/index.mjs +4 -0
  101. package/dist/model/listnumbering/Emulator.d.mts +37 -5
  102. package/dist/model/listnumbering/Emulator.mjs +63 -9
  103. package/dist/model/listnumbering/definitions.mjs +18 -0
  104. package/dist/model/properties/PropertyResolver.d.mts +87 -7
  105. package/dist/model/properties/PropertyResolver.mjs +197 -17
  106. package/dist/model/properties/catalogue.d.mts +32 -4
  107. package/dist/model/properties/catalogue.mjs +115 -36
  108. package/dist/model/properties/log.d.mts +1 -1
  109. package/dist/model/properties/log.mjs +5 -5
  110. package/dist/model/properties/table.d.mts +16 -2
  111. package/dist/model/properties/table.mjs +17 -5
  112. package/dist/model/text/Extractor.d.mts +289 -0
  113. package/dist/model/text/Extractor.mjs +2162 -0
  114. package/dist/model/text/LinkTargets.d.mts +45 -0
  115. package/dist/model/text/LinkTargets.mjs +170 -0
  116. package/dist/model/text/MarkdownExporter.d.mts +140 -0
  117. package/dist/model/text/MarkdownExporter.mjs +255 -0
  118. package/dist/model/text/PlainText.d.mts +29 -0
  119. package/dist/model/text/PlainText.mjs +539 -0
  120. package/dist/model/text/TextContext.d.mts +161 -0
  121. package/dist/model/text/TextContext.mjs +425 -0
  122. package/dist/model/text/TextOptions.d.mts +150 -0
  123. package/dist/model/text/TextOptions.mjs +278 -0
  124. package/dist/model/text/TextResult.d.mts +504 -0
  125. package/dist/model/text/TextResult.mjs +526 -0
  126. package/dist/model/text/Texts.d.mts +99 -0
  127. package/dist/model/text/Texts.mjs +187 -0
  128. package/dist/model/text/WmlToMarkdown.d.mts +120 -0
  129. package/dist/model/text/WmlToMarkdown.mjs +911 -0
  130. package/dist/model/text/commonmark.d.mts +121 -0
  131. package/dist/model/text/commonmark.mjs +655 -0
  132. package/dist/model/text/index.d.mts +7 -0
  133. package/dist/model/text/index.mjs +8 -0
  134. package/dist/model/text/normalize.d.mts +8 -0
  135. package/dist/model/text/normalize.mjs +13 -0
  136. package/dist/model/text/outline.d.mts +4 -0
  137. package/dist/model/text/outline.mjs +71 -0
  138. package/dist/office-js/fragment.d.mts +7 -5
  139. package/dist/office-js/fragment.mjs +63 -14
  140. package/dist/office-js/proxy.d.mts +8 -0
  141. package/dist/office-js/proxy.mjs +29 -0
  142. package/dist/office-js/run.mjs +2 -0
  143. package/dist/office-js/supported.generated.mjs +16 -0
  144. package/dist/office-js/toApiScript.mjs +21 -5
  145. package/dist/opc/Load.d.mts +9 -2
  146. package/dist/opc/Save.d.mts +17 -0
  147. package/dist/opc/Save.mjs +12 -2
  148. package/dist/opc/index.d.mts +3 -3
  149. package/dist/opc/index.mjs +2 -2
  150. package/dist/opc/mce/preprocessor.d.mts +88 -7
  151. package/dist/opc/mce/preprocessor.mjs +144 -37
  152. package/dist/opc/mce/understood.d.mts +34 -0
  153. package/dist/opc/mce/understood.mjs +55 -3
  154. package/dist/packages/OpcPackage.d.mts +20 -0
  155. package/dist/packages/OpcPackage.mjs +16 -3
  156. package/dist/packages/WordprocessingMLPackage.d.mts +77 -7
  157. package/dist/packages/WordprocessingMLPackage.mjs +242 -11
  158. package/dist/parts/DefaultXmlPart.mjs +2 -2
  159. package/dist/parts/Part.d.mts +10 -2
  160. package/dist/parts/XmlPart.d.mts +35 -32
  161. package/dist/parts/XmlPart.mjs +107 -107
  162. package/dist/parts/wml/comments.mjs +30 -0
  163. package/dist/parts/wml/index.mjs +12 -0
  164. package/dist/xml/dom.d.mts +7 -0
  165. package/dist/xml/dom.mjs +18 -0
  166. package/package.json +2 -2
@@ -0,0 +1,289 @@
1
+ import type * as wml from '@docx4j/generated-objects-ts/modules/org_docx4j_wml';
2
+ import type { Part } from '../../parts/Part.mjs';
3
+ import type { PropertyResolver } from '../properties/PropertyResolver.mjs';
4
+ import type { NumberingState } from '../listnumbering/state.mjs';
5
+ import { type Element } from '../content/tree.mjs';
6
+ import type { ResolvedView } from '../content/ResolvedView.mjs';
7
+ import type { TextOptions, TextModelView } from './TextOptions.mjs';
8
+ import { TextBlock, TextRun, TextRevision, TextWarning, TextResult, type TextStory, type NoteType } from './TextResult.mjs';
9
+ import { type TextContext, type PackageTrees } from './TextContext.mjs';
10
+ /** How the view is read (docx4j `Extractor.Mode`). */
11
+ export type ExtractorMode =
12
+ /** The view's rules: a plan for accepted and original, revisions marked for markup. */
13
+ 'view'
14
+ /** A package already resolved by Accept All or Reject All (the copy route, REQ-406): no view logic. */
15
+ | 'resolved'
16
+ /** Content with no package to plan over: run-level revisions only, no joins or moves. */
17
+ | 'planless';
18
+ interface OfficeSpan {
19
+ offset: number;
20
+ length: number;
21
+ }
22
+ /** An open complex field. */
23
+ declare class FieldState {
24
+ instr: string;
25
+ result: string;
26
+ separated: boolean;
27
+ /** `w:fldLock` on its beginning: never recomputed (REQ-506). */
28
+ locked: boolean;
29
+ /** Its result computed under `fields: update` (REQ-506): the cached result's text is not read. */
30
+ computed: string | undefined;
31
+ /** A HYPERLINK field's target, once its code is read (REQ-703). */
32
+ link: string | undefined;
33
+ /** A table of contents under `toc: false` (D12): nothing of it is read. */
34
+ toc: boolean;
35
+ /** Where its code's runs begin, for a table of contents' to be taken out again. */
36
+ codeBlock: TextBlock | undefined;
37
+ codeStart: number;
38
+ /** The paragraph whose merge floor its code raised, and the floor before. */
39
+ floorParagraph: ParagraphState | undefined;
40
+ previousFloor: number;
41
+ /** The field as a block after the one it began in starts inside it: its code's block and paragraph left behind. */
42
+ copy(): FieldState;
43
+ }
44
+ /** The complex fields open where a container's blocks begin, by the block's index (`Extractor.fieldsAtBlocks`). */
45
+ export type BlockStarts = ReadonlyMap<number, readonly FieldState[]>;
46
+ /** The state of a run-level walk: the revision and the control the runs are in. */
47
+ declare class RunState {
48
+ /** markup: the innermost revision; else undefined. */
49
+ readonly revision: TextRevision | undefined;
50
+ /** accepted, original: inside a revision holder the view keeps (its runs are text whatever their elements). */
51
+ readonly kept: boolean;
52
+ readonly placeholder: boolean;
53
+ constructor(
54
+ /** markup: the innermost revision; else undefined. */
55
+ revision: TextRevision | undefined,
56
+ /** accepted, original: inside a revision holder the view keeps (its runs are text whatever their elements). */
57
+ kept: boolean, placeholder: boolean);
58
+ withRevision(r: TextRevision | undefined, kept: boolean): RunState;
59
+ withPlaceholder(): RunState;
60
+ }
61
+ /** What follows its anchoring paragraph, or the table its anchor is in (REQ-511, REQ-518): a text box, legacy WordArt. */
62
+ interface Anchored {
63
+ prefix: string;
64
+ emit(x: Extractor, anchoring: Story, sink: TextBlock[]): void;
65
+ }
66
+ /** The walk of one story. */
67
+ declare class Story {
68
+ private readonly x;
69
+ readonly kind: TextStory;
70
+ readonly prefix: string;
71
+ readonly part: Part | undefined;
72
+ /** Open complex fields; [0] is the innermost (docx4j's deque head). */
73
+ readonly fields: FieldState[];
74
+ /** What was anchored since the last flush, to follow its anchor (or its table). */
75
+ readonly pending: Anchored[];
76
+ tableDepth: number;
77
+ /** The sections ended so far (the main story only). */
78
+ sections: (wml.SectPr | undefined)[] | undefined;
79
+ noteType: NoteType | undefined;
80
+ noteNumber: number;
81
+ noteId: string | undefined;
82
+ private numberingState;
83
+ constructor(x: Extractor, kind: TextStory, prefix: string, part: Part | undefined);
84
+ /** The resolver the walk reads styles with, for `officeSpans`' hidden rule. */
85
+ get resolver(): PropertyResolver | undefined;
86
+ numbering(): NumberingState;
87
+ }
88
+ /** A paragraph being read: the block its runs go to, its address, what it anchored so far. */
89
+ declare class ParagraphState {
90
+ readonly block: TextBlock;
91
+ readonly p: wml.P;
92
+ readonly address: string;
93
+ readonly story: Story;
94
+ boxes: number;
95
+ charts: number;
96
+ smartArts: number;
97
+ objects: number;
98
+ /** Whether every run with text so far is in a monospaced font; undefined before the first. */
99
+ monospace: boolean | undefined;
100
+ /** The formatting of the run being read (a run carrying only it), or undefined outside a run. */
101
+ format: TextRun | undefined;
102
+ /** The target of the `w:hyperlink` being read. */
103
+ link: string | undefined;
104
+ /** An equation being written, and whether it is a display one. */
105
+ math: boolean;
106
+ displayMath: boolean;
107
+ /** Whether a table of contents left out (D12) is in the paragraph. */
108
+ toc: boolean;
109
+ /** The first of the block's runs a run may be merged into: a field's code starts a run of its own where it may be taken out. */
110
+ mergeFloor: number;
111
+ private office;
112
+ constructor(block: TextBlock, p: wml.P, address: string, story: Story);
113
+ /** Where an item's text is in this paragraph's `Paragraph.text`. */
114
+ officeSpan(item: Element): OfficeSpan | undefined;
115
+ }
116
+ /**
117
+ * The text model's walk (CR-046 section 2.3): `scope(view(resolve(package)))` in one pass over the
118
+ * unresolved tree, producing the block model. docx4j `Extractor`, over trees read before it starts.
119
+ */
120
+ export declare class Extractor {
121
+ readonly trees: PackageTrees;
122
+ readonly options: TextOptions;
123
+ readonly context: TextContext;
124
+ readonly view: TextModelView;
125
+ readonly mode: ExtractorMode;
126
+ /** What a view removes and joins; undefined in markup, and in the resolved and planless modes. */
127
+ readonly plan: ResolvedView | undefined;
128
+ readonly resolver: PropertyResolver | undefined;
129
+ readonly warnings: TextWarning[];
130
+ private readonly warned;
131
+ /** What every address this extraction makes starts with. */
132
+ root: string;
133
+ /** The run properties a paragraph style and character style give, by their ids. */
134
+ private readonly styleRPrCache;
135
+ /** Bookmarks open in the walk, by id (REQ-506's REF, phase 5a). */
136
+ private readonly openBookmarks;
137
+ /** `fieldsAtBlocks`' walk: paragraphs read for their field characters and instructions alone, nothing emitted. */
138
+ private fieldsOnly;
139
+ constructor(trees: PackageTrees, options: TextOptions, mode: ExtractorMode, context: TextContext);
140
+ extract(): TextResult;
141
+ /** The result's metadata: `fields_update_on_open` and the document properties (REQ-801, REQ-515). */
142
+ private metadata;
143
+ private fieldsUpdateOnOpen;
144
+ commentsIncluded(): boolean;
145
+ /** A part's or object's content as one story (`Texts.of(part)`, `Texts.of(pkg, content)`). */
146
+ extractContent(content: unknown, kind: TextStory, prefix: string, part: Part | undefined): TextResult;
147
+ /** The notes of one kind, in the context's reference order (`Texts.of(notesPart)`). */
148
+ extractNotes(type: NoteType): TextResult;
149
+ /** The comments (`Texts.of(commentsPart)`): what the view includes, in the comments part's order. */
150
+ extractComments(): TextResult;
151
+ private glossary;
152
+ /** Block-level content into `sink`: paragraphs (joined in a view), tables, and what is transparent. */
153
+ blocks(items: Element[] | undefined, prefix: string, story: Story, sink: TextBlock[], state?: RunState): void;
154
+ /** A paragraph chain whose deleted mark has a table next: it joins the table's first cell's first paragraph (docx4j CR-043 section 17). */
155
+ private pendingTableJoin;
156
+ /** The block at `items[i]` into `sink`, with the paragraphs a view joins to it; the index of the last item it took. */
157
+ private block;
158
+ /**
159
+ * Some of a container's blocks, by their indices, each as `extractContent` reads it in the whole: a
160
+ * paragraph the view joins to one before it gives nothing (its text is in that one's block), and each
161
+ * block starts inside the complex fields open where it begins (`starts`, from `fieldsAtBlocks`), so that
162
+ * a table of contents left out (D12) is left out here too. Each block is read as a story of its own.
163
+ */
164
+ extractBlocks(content: unknown, kind: TextStory, prefix: string, part: Part | undefined, indices: readonly number[], starts: BlockStarts): TextResult;
165
+ /**
166
+ * The complex fields open where each of a container's blocks begins, for `extractBlocks`: a walk of the
167
+ * blocks reading field characters and instructions alone (`fieldsOnly`), as the whole walk reads them.
168
+ * Blocks with none open are not in the map. Its own context and warnings, so the reading leaves no trace.
169
+ */
170
+ static fieldsAtBlocks(trees: PackageTrees, options: TextOptions, mode: ExtractorMode, context: TextContext, content: unknown, kind: TextStory, prefix: string, part: Part | undefined): BlockStarts;
171
+ /** Whether the view joins the paragraph at `items[i]` to one before it: the item before it, past markers and what the view removes, is a paragraph whose mark goes. */
172
+ private joinedFromBefore;
173
+ /** The index of the paragraph a paragraph joins: the next in the list past markers and what the view removes, or -1. */
174
+ private nextParagraph;
175
+ private paragraph;
176
+ private endSection;
177
+ private flushIfOutsideTable;
178
+ /** An `altChunk`: not expanded until CR-012 phase 5e, which raises `altchunk.not_expanded` with its content type. */
179
+ private altChunk;
180
+ /**
181
+ * A plain-text control's bound value where its binding resolves and is what Word shows: not where the
182
+ * value is empty and the control shows its placeholder, nor under `bindings: surface`. Undefined to read
183
+ * the surface. Raises `sdt.binding_differs` where the two differ.
184
+ */
185
+ private bound;
186
+ /**
187
+ * A control's surface in the view: its `w:t`, tabs and breaks, what the view removes left out, and of an
188
+ * mc:AlternateContent the selected branch only, as the reading takes it (CR-013: every branch's text
189
+ * made a surface no binding could match, and a false `sdt.binding_differs`).
190
+ */
191
+ private surfaceText;
192
+ private bookmark;
193
+ private properties;
194
+ /**
195
+ * A paragraph's numbering from its effective `w:numPr` and the numbering definitions; undefined for none,
196
+ * for `w:numId` 0, and where Word gives the paragraph no number: a `w:numId` its style brought, whose
197
+ * level belongs to another paragraph style (`Emulator.levelStyleId`, REQ-510).
198
+ */
199
+ private numbering;
200
+ /** Whether the level belongs to a paragraph style that is neither the paragraph's nor one its style is based on. */
201
+ private linkedElsewhere;
202
+ /** The paragraph counted in its story's numbering state; undefined where it is not numbered. */
203
+ private count;
204
+ private table;
205
+ private rows;
206
+ private cells;
207
+ private runs;
208
+ private holderState;
209
+ private run;
210
+ private runItem;
211
+ /** Document text: a field's code where a field is in its code (shown only under `field_codes`), else text. */
212
+ private text;
213
+ private addText;
214
+ private endField;
215
+ private simpleField;
216
+ /** The runs of a simple field's result, added to the paragraph; their text. */
217
+ private resultOf;
218
+ /**
219
+ * An equation, `$...$` (`$$...$$` for an `m:oMathPara`). Until CR-012 phase 5b ports a LaTeX converter
220
+ * it is its `m:t` text in document order inside the delimiters, REQ-604's form for an equation that
221
+ * can't be converted. In markup, an equation with tracked changes is its Reject All form deleted and
222
+ * its Accept All form inserted, each as the plan for that view leaves it.
223
+ */
224
+ private math;
225
+ private mathText;
226
+ /** The view's rule for an equation's list members: what the plan removes goes; without a plan, a revision by its type. */
227
+ private keepMathInView;
228
+ /**
229
+ * What a run's drawing, picture or object holds, in document order, branches selected: text boxes and
230
+ * WordArt to follow the paragraph; pictures and objects as runs where they are. A chart or SmartArt
231
+ * contributes nothing until CR-012 phase 5c.
232
+ */
233
+ private anchored;
234
+ /** A `wp:inline` or `wp:anchor`: a chart, SmartArt, a picture, or a shape to walk into. */
235
+ private graphic;
236
+ /** A VML shape: legacy WordArt, a picture, or a shape to walk into for its text box. */
237
+ private vmlShape;
238
+ /** A `w:object`: an object run with its ProgID (REQ-512); its package is read under `embedded: true`, phase 5d. */
239
+ private object;
240
+ /**
241
+ * A DrawingML picture: its `wp:docPr` (or a nested picture's `pic:cNvPr`). `descr` and `title` are the
242
+ * schema's default, `''`, where the element doesn't give them, as docx4j's JAXB getters read them (CR-012
243
+ * section 20).
244
+ */
245
+ private image;
246
+ private imageOf;
247
+ /**
248
+ * `mce.branches_differ` (REQ-307): where the selected branch and another both hold text, and the texts
249
+ * differ after REQ-1201's normalisation. A branch's text is every `w:t`, `m:t` and `a:t` in it, whatever
250
+ * the view and hidden or not, as docx4j reads it: a comparison made at load knows no view, and a branch
251
+ * that differs only in hidden or deleted text is one an agent should hear of (Jason, 2026-10-21, for WD
252
+ * 0.29; CR-012 section 15.6).
253
+ */
254
+ private compareBranches;
255
+ warn(w: TextWarning): void;
256
+ private sectionsWithHeaders;
257
+ private headerOrFooter;
258
+ /** A header or footer part's content as its own story (`Texts.of(headerPart)`). */
259
+ headerOrFooterPart(part: Part, kind: 'HEADER' | 'FOOTER', rId: string): TextResult;
260
+ private notes;
261
+ private comments;
262
+ /** Whether the view removes a list member (always false in markup and on a resolved copy). */
263
+ removes(item: unknown): boolean;
264
+ /** Whether the view takes a content control away and leaves its content (an inserted one, rejected). */
265
+ private unwraps;
266
+ private joinsNext;
267
+ /** The paragraph's properties in the view: its own, or what the plan gives a paragraph whose mark is gone with no paragraph next. */
268
+ private viewPPr;
269
+ private isHiddenRun;
270
+ /**
271
+ * A run's formatting beyond its paragraph style's (CR-046 phase 3): bold, italic, struck through,
272
+ * monospaced, each as the run's own property gives it, else its styles', where the paragraph style
273
+ * alone doesn't give it. A run carrying only that.
274
+ */
275
+ private formatOf;
276
+ /** The run's font for `monospace`: its own `w:rFonts/@w:ascii`, else its styles'. */
277
+ private runFont;
278
+ /** The effective run properties of the paragraph's style and a character style, cached by their ids; undefined without styles. */
279
+ private styleRPr;
280
+ private isHiddenMark;
281
+ }
282
+ /** A TOC field's instruction: a table of contents, of figures (`\c`), of anything it collects. */
283
+ export declare function isTocField(instr: string): boolean;
284
+ /**
285
+ * A HYPERLINK field's target from its instruction (WD REQ-703): its address, and `#` and the bookmark its
286
+ * `\l` names; undefined for any other field, or one with neither.
287
+ */
288
+ export declare function fieldHyperlinkTarget(instr: string): string | undefined;
289
+ export {};