@docx4j/core-ts 0.5.0 → 0.7.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 (207) hide show
  1. package/NOTICE +4 -0
  2. package/README.md +92 -4
  3. package/dist/html/convert.mjs +2 -1
  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 +145 -23
  24. package/dist/model/content/Body.mjs +507 -150
  25. package/dist/model/content/Comment.d.mts +23 -5
  26. package/dist/model/content/Comment.mjs +207 -26
  27. package/dist/model/content/ContentControl.d.mts +198 -19
  28. package/dist/model/content/ContentControl.mjs +672 -99
  29. package/dist/model/content/Font.d.mts +70 -17
  30. package/dist/model/content/Font.mjs +119 -36
  31. package/dist/model/content/InlinePicture.d.mts +11 -0
  32. package/dist/model/content/InlinePicture.mjs +21 -1
  33. package/dist/model/content/List.d.mts +6 -3
  34. package/dist/model/content/List.mjs +18 -8
  35. package/dist/model/content/Paragraph.d.mts +200 -14
  36. package/dist/model/content/Paragraph.mjs +898 -82
  37. package/dist/model/content/Range.d.mts +227 -12
  38. package/dist/model/content/Range.mjs +785 -59
  39. package/dist/model/content/ResolvedView.d.mts +104 -0
  40. package/dist/model/content/ResolvedView.mjs +596 -0
  41. package/dist/model/content/Table.d.mts +29 -3
  42. package/dist/model/content/Table.mjs +135 -49
  43. package/dist/model/content/TrackedChange.d.mts +174 -15
  44. package/dist/model/content/TrackedChange.mjs +734 -170
  45. package/dist/model/content/comments.d.mts +20 -6
  46. package/dist/model/content/comments.mjs +67 -57
  47. package/dist/model/content/generalException.d.mts +18 -0
  48. package/dist/model/content/generalException.mjs +24 -0
  49. package/dist/model/content/index.d.mts +10 -3
  50. package/dist/model/content/index.mjs +10 -2
  51. package/dist/model/content/mathText.d.mts +21 -0
  52. package/dist/model/content/mathText.mjs +267 -0
  53. package/dist/model/content/officeText.d.mts +27 -0
  54. package/dist/model/content/officeText.mjs +74 -0
  55. package/dist/model/content/ooxml.mjs +12 -1
  56. package/dist/model/content/outline.d.mts +5 -0
  57. package/dist/model/content/outline.mjs +13 -0
  58. package/dist/model/content/paraIds.d.mts +5 -0
  59. package/dist/model/content/paraIds.mjs +54 -0
  60. package/dist/model/content/placeholders.d.mts +110 -0
  61. package/dist/model/content/placeholders.mjs +253 -0
  62. package/dist/model/content/search.d.mts +74 -0
  63. package/dist/model/content/search.mjs +255 -9
  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 +47 -0
  67. package/dist/model/content/story.mjs +95 -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 +102 -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 +63 -6
  79. package/dist/model/content/tracking.mjs +242 -22
  80. package/dist/model/content/tree.d.mts +172 -24
  81. package/dist/model/content/tree.mjs +328 -54
  82. package/dist/model/content/wordRange.d.mts +48 -0
  83. package/dist/model/content/wordRange.mjs +97 -0
  84. package/dist/model/customxml/CustomXmlPartCollection.d.mts +30 -1
  85. package/dist/model/customxml/CustomXmlPartCollection.mjs +81 -12
  86. package/dist/model/customxml/XmlMapping.d.mts +32 -8
  87. package/dist/model/customxml/XmlMapping.mjs +64 -10
  88. package/dist/model/customxml/bindings.d.mts +33 -4
  89. package/dist/model/customxml/bindings.mjs +171 -45
  90. package/dist/model/customxml/index.d.mts +1 -0
  91. package/dist/model/customxml/index.mjs +1 -0
  92. package/dist/model/customxml/kinds.d.mts +8 -3
  93. package/dist/model/customxml/kinds.mjs +26 -5
  94. package/dist/model/customxml/opendope.d.mts +4 -1
  95. package/dist/model/customxml/opendope.mjs +9 -6
  96. package/dist/model/customxml/picturePlaceholder.d.mts +17 -0
  97. package/dist/model/customxml/picturePlaceholder.mjs +32 -0
  98. package/dist/model/customxml/pictures.d.mts +4 -3
  99. package/dist/model/customxml/pictures.mjs +22 -8
  100. package/dist/model/customxml/storeItems.d.mts +57 -0
  101. package/dist/model/customxml/storeItems.mjs +122 -0
  102. package/dist/model/customxml/xhtml.mjs +23 -22
  103. package/dist/model/dateZone.d.mts +25 -0
  104. package/dist/model/dateZone.mjs +57 -0
  105. package/dist/model/index.d.mts +3 -0
  106. package/dist/model/index.mjs +5 -0
  107. package/dist/model/listnumbering/Emulator.d.mts +37 -5
  108. package/dist/model/listnumbering/Emulator.mjs +63 -9
  109. package/dist/model/properties/PropertyResolver.d.mts +74 -2
  110. package/dist/model/properties/PropertyResolver.mjs +133 -5
  111. package/dist/model/properties/catalogue.d.mts +19 -5
  112. package/dist/model/properties/catalogue.mjs +41 -15
  113. package/dist/model/properties/index.d.mts +1 -1
  114. package/dist/model/properties/log.d.mts +1 -1
  115. package/dist/model/properties/log.mjs +5 -5
  116. package/dist/model/properties/styleUtil.d.mts +3 -1
  117. package/dist/model/properties/styleUtil.mjs +20 -24
  118. package/dist/model/properties/table.mjs +4 -2
  119. package/dist/model/text/CaseMapping.d.mts +38 -0
  120. package/dist/model/text/CaseMapping.mjs +86 -0
  121. package/dist/model/text/Extractor.d.mts +349 -0
  122. package/dist/model/text/Extractor.mjs +2406 -0
  123. package/dist/model/text/LinkTargets.d.mts +45 -0
  124. package/dist/model/text/LinkTargets.mjs +170 -0
  125. package/dist/model/text/MarkdownExporter.d.mts +140 -0
  126. package/dist/model/text/MarkdownExporter.mjs +255 -0
  127. package/dist/model/text/PlainText.d.mts +29 -0
  128. package/dist/model/text/PlainText.mjs +542 -0
  129. package/dist/model/text/TextContext.d.mts +256 -0
  130. package/dist/model/text/TextContext.mjs +600 -0
  131. package/dist/model/text/TextOptions.d.mts +233 -0
  132. package/dist/model/text/TextOptions.mjs +419 -0
  133. package/dist/model/text/TextResult.d.mts +621 -0
  134. package/dist/model/text/TextResult.mjs +629 -0
  135. package/dist/model/text/Texts.d.mts +99 -0
  136. package/dist/model/text/Texts.mjs +187 -0
  137. package/dist/model/text/WmlToMarkdown.d.mts +120 -0
  138. package/dist/model/text/WmlToMarkdown.mjs +936 -0
  139. package/dist/model/text/caseMapping.generated.d.mts +7 -0
  140. package/dist/model/text/caseMapping.generated.mjs +214 -0
  141. package/dist/model/text/commonmark.d.mts +121 -0
  142. package/dist/model/text/commonmark.mjs +655 -0
  143. package/dist/model/text/index.d.mts +8 -0
  144. package/dist/model/text/index.mjs +9 -0
  145. package/dist/model/text/normalize.d.mts +8 -0
  146. package/dist/model/text/normalize.mjs +13 -0
  147. package/dist/model/text/outline.d.mts +4 -0
  148. package/dist/model/text/outline.mjs +71 -0
  149. package/dist/model/wordIntegers.d.mts +29 -0
  150. package/dist/model/wordIntegers.mjs +78 -0
  151. package/dist/office-js/document.mjs +15 -1
  152. package/dist/office-js/fragment.d.mts +7 -5
  153. package/dist/office-js/fragment.mjs +63 -14
  154. package/dist/office-js/proxy.d.mts +8 -0
  155. package/dist/office-js/proxy.mjs +29 -0
  156. package/dist/office-js/run.mjs +2 -0
  157. package/dist/office-js/supported.generated.mjs +16 -0
  158. package/dist/office-js/toApiScript.mjs +29 -12
  159. package/dist/opc/DirectoryPartStore.d.mts +6 -2
  160. package/dist/opc/DirectoryPartStore.mjs +11 -4
  161. package/dist/opc/FlatOpcPartStore.d.mts +4 -2
  162. package/dist/opc/FlatOpcPartStore.mjs +11 -8
  163. package/dist/opc/Load.d.mts +32 -0
  164. package/dist/opc/Load.mjs +115 -5
  165. package/dist/opc/PartStore.d.mts +34 -1
  166. package/dist/opc/PartStore.mjs +71 -8
  167. package/dist/opc/Save.d.mts +32 -0
  168. package/dist/opc/Save.mjs +110 -4
  169. package/dist/opc/ZipPartStore.d.mts +4 -2
  170. package/dist/opc/ZipPartStore.mjs +12 -7
  171. package/dist/opc/exceptions.d.mts +140 -0
  172. package/dist/opc/exceptions.mjs +108 -0
  173. package/dist/opc/index.d.mts +8 -5
  174. package/dist/opc/index.mjs +5 -3
  175. package/dist/opc/mce/preprocessor.d.mts +141 -5
  176. package/dist/opc/mce/preprocessor.mjs +119 -18
  177. package/dist/opc/mce/understood.d.mts +3 -11
  178. package/dist/opc/mce/understood.mjs +27 -23
  179. package/dist/opc/repair/breaks.d.mts +23 -0
  180. package/dist/opc/repair/breaks.mjs +288 -0
  181. package/dist/opc/repair/hosts.d.mts +12 -0
  182. package/dist/opc/repair/hosts.mjs +33 -0
  183. package/dist/opc/repair/mainRoot.d.mts +19 -0
  184. package/dist/opc/repair/mainRoot.mjs +168 -0
  185. package/dist/opc/repair/unknownElements.d.mts +8 -0
  186. package/dist/opc/repair/unknownElements.mjs +180 -0
  187. package/dist/opc/repair/wmlNames.generated.d.mts +2 -0
  188. package/dist/opc/repair/wmlNames.generated.mjs +80 -0
  189. package/dist/opc/skipped.d.mts +50 -0
  190. package/dist/opc/skipped.mjs +140 -0
  191. package/dist/packages/OpcPackage.d.mts +110 -4
  192. package/dist/packages/OpcPackage.mjs +123 -7
  193. package/dist/packages/WordprocessingMLPackage.d.mts +45 -8
  194. package/dist/packages/WordprocessingMLPackage.mjs +158 -21
  195. package/dist/packages/index.d.mts +1 -1
  196. package/dist/parts/DefaultXmlPart.mjs +2 -2
  197. package/dist/parts/Part.d.mts +14 -2
  198. package/dist/parts/RelationshipsPart.d.mts +15 -0
  199. package/dist/parts/RelationshipsPart.mjs +66 -1
  200. package/dist/parts/XmlPart.d.mts +63 -32
  201. package/dist/parts/XmlPart.mjs +240 -96
  202. package/dist/parts/wml/comments.mjs +30 -0
  203. package/dist/parts/wml/index.d.mts +12 -1
  204. package/dist/parts/wml/index.mjs +37 -1
  205. package/dist/xml/dom.d.mts +7 -0
  206. package/dist/xml/dom.mjs +18 -0
  207. package/package.json +2 -2
@@ -0,0 +1,349 @@
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
+ /** A SET field: its stored result is never shown (Word hides it; REQ-505, CR-012 section 26). */
36
+ hiddenResult: boolean;
37
+ /** Where its code's runs begin, for a table of contents' to be taken out again. */
38
+ codeBlock: TextBlock | undefined;
39
+ codeStart: number;
40
+ /** The paragraph whose merge floor its code raised, and the floor before. */
41
+ floorParagraph: ParagraphState | undefined;
42
+ previousFloor: number;
43
+ /** The field as a block after the one it began in starts inside it: its code's block and paragraph left behind. */
44
+ copy(): FieldState;
45
+ }
46
+ /** The complex fields open where a container's blocks begin, by the block's index (`Extractor.fieldsAtBlocks`). */
47
+ export type BlockStarts = ReadonlyMap<number, readonly FieldState[]>;
48
+ /** The state of a run-level walk: the revision and the control the runs are in. */
49
+ declare class RunState {
50
+ /** markup: the innermost revision; else undefined. */
51
+ readonly revision: TextRevision | undefined;
52
+ /** accepted, original: inside a revision holder the view keeps (its runs are text whatever their elements). */
53
+ readonly kept: boolean;
54
+ readonly placeholder: boolean;
55
+ constructor(
56
+ /** markup: the innermost revision; else undefined. */
57
+ revision: TextRevision | undefined,
58
+ /** accepted, original: inside a revision holder the view keeps (its runs are text whatever their elements). */
59
+ kept: boolean, placeholder: boolean);
60
+ withRevision(r: TextRevision | undefined, kept: boolean): RunState;
61
+ withPlaceholder(): RunState;
62
+ }
63
+ /** What follows its anchoring paragraph, or the table its anchor is in (REQ-511, REQ-518): a text box, legacy WordArt. */
64
+ interface Anchored {
65
+ prefix: string;
66
+ emit(x: Extractor, anchoring: Story, sink: TextBlock[]): void;
67
+ }
68
+ /** The walk of one story. */
69
+ declare class Story {
70
+ private readonly x;
71
+ readonly kind: TextStory;
72
+ readonly prefix: string;
73
+ readonly part: Part | undefined;
74
+ /** Open complex fields; [0] is the innermost (docx4j's deque head). */
75
+ readonly fields: FieldState[];
76
+ /** What was anchored since the last flush, to follow its anchor (or its table). */
77
+ readonly pending: Anchored[];
78
+ tableDepth: number;
79
+ /** The sections ended so far (the main story only). */
80
+ sections: (wml.SectPr | undefined)[] | undefined;
81
+ noteType: NoteType | undefined;
82
+ noteNumber: number;
83
+ noteId: string | undefined;
84
+ private numberingState;
85
+ constructor(x: Extractor, kind: TextStory, prefix: string, part: Part | undefined);
86
+ /** The resolver the walk reads styles with, for `officeSpans`' hidden rule. */
87
+ get resolver(): PropertyResolver | undefined;
88
+ numbering(): NumberingState;
89
+ }
90
+ /** A paragraph being read: the block its runs go to, its address, what it anchored so far. */
91
+ declare class ParagraphState {
92
+ readonly block: TextBlock;
93
+ readonly p: wml.P;
94
+ readonly address: string;
95
+ readonly story: Story;
96
+ boxes: number;
97
+ charts: number;
98
+ smartArts: number;
99
+ objects: number;
100
+ /** Whether every run with text so far is in a monospaced font; undefined before the first. */
101
+ monospace: boolean | undefined;
102
+ /** The formatting of the run being read (a run carrying only it), or undefined outside a run. */
103
+ format: TextRun | undefined;
104
+ /** The target of the `w:hyperlink` being read. */
105
+ link: string | undefined;
106
+ /** An equation being written, and whether it is a display one. */
107
+ math: boolean;
108
+ displayMath: boolean;
109
+ /** Whether a table of contents left out (D12) is in the paragraph. */
110
+ toc: boolean;
111
+ /** 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. */
112
+ mergeFloor: number;
113
+ private office;
114
+ constructor(block: TextBlock, p: wml.P, address: string, story: Story);
115
+ /** Where an item's text is in this paragraph's `Paragraph.text`. */
116
+ officeSpan(item: Element): OfficeSpan | undefined;
117
+ }
118
+ /**
119
+ * The text model's walk (CR-046 section 2.3): `scope(view(resolve(package)))` in one pass over the
120
+ * unresolved tree, producing the block model. docx4j `Extractor`, over trees read before it starts.
121
+ */
122
+ export declare class Extractor {
123
+ readonly trees: PackageTrees;
124
+ readonly options: TextOptions;
125
+ readonly context: TextContext;
126
+ readonly view: TextModelView;
127
+ readonly mode: ExtractorMode;
128
+ /** What a view removes and joins; undefined in markup, and in the resolved and planless modes. */
129
+ readonly plan: ResolvedView | undefined;
130
+ readonly resolver: PropertyResolver | undefined;
131
+ readonly warnings: TextWarning[];
132
+ private readonly warned;
133
+ /** The parts this reading took a story from, for what the walk can't meet (`partWarningsUnmet`). */
134
+ readonly storyParts: Set<Part>;
135
+ /** What every address this extraction makes starts with. */
136
+ root: string;
137
+ /** The run properties a paragraph style and character style give, by their ids. */
138
+ private readonly styleRPrCache;
139
+ /** Bookmarks open in the walk, by id (REQ-506's REF, phase 5a). */
140
+ private readonly openBookmarks;
141
+ /** `fieldsAtBlocks`' walk: paragraphs read for their field characters and instructions alone, nothing emitted. */
142
+ private fieldsOnly;
143
+ constructor(trees: PackageTrees, options: TextOptions, mode: ExtractorMode, context: TextContext);
144
+ extract(): TextResult;
145
+ /** The result's metadata: `fields_update_on_open`, `repaired` and the document properties (REQ-801, REQ-207, REQ-515). */
146
+ private metadata;
147
+ /** `w:updateFields`, which every result's metadata carries: so a settings part that cannot be read is needed by every reading. */
148
+ private fieldsUpdateOnOpen;
149
+ /** A part the reading needs here: `part.not_read`, once, where it could not be read (REQ-801; CR-012 section 28). */
150
+ private consult;
151
+ commentsIncluded(): boolean;
152
+ /** A part's or object's content as one story (`Texts.of(part)`, `Texts.of(pkg, content)`). */
153
+ extractContent(content: unknown, kind: TextStory, prefix: string, part: Part | undefined): TextResult;
154
+ /** The notes of one kind, in the context's reference order (`Texts.of(notesPart)`). */
155
+ extractNotes(type: NoteType): TextResult;
156
+ /** The comments (`Texts.of(commentsPart)`): what the view includes, in the comments part's order. */
157
+ extractComments(): TextResult;
158
+ private glossary;
159
+ /** Block-level content into `sink`: paragraphs (joined in a view), tables, and what is transparent. */
160
+ blocks(items: Element[] | undefined, prefix: string, story: Story, sink: TextBlock[], state?: RunState): void;
161
+ /** 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). */
162
+ private pendingTableJoin;
163
+ /**
164
+ * The block at `items[i]` into `sink`, with the paragraphs a view joins to it; the index of the last item it took.
165
+ * `dropCap` is a drop cap's frame paragraph just read in the same container, for the paragraph next to take (REQ-521).
166
+ */
167
+ private block;
168
+ /**
169
+ * Some of a container's blocks, by their indices, each as `extractContent` reads it in the whole: a
170
+ * paragraph the view joins to one before it gives nothing (its text is in that one's block), and each
171
+ * block starts inside the complex fields open where it begins (`starts`, from `fieldsAtBlocks`), so that
172
+ * a table of contents left out (D12) is left out here too. Each block is read as a story of its own.
173
+ */
174
+ extractBlocks(content: unknown, kind: TextStory, prefix: string, part: Part | undefined, indices: readonly number[], starts: BlockStarts): TextResult;
175
+ /**
176
+ * The complex fields open where each of a container's blocks begins, for `extractBlocks`: a walk of the
177
+ * blocks reading field characters and instructions alone (`fieldsOnly`), as the whole walk reads them.
178
+ * Blocks with none open are not in the map. Its own context and warnings, so the reading leaves no trace.
179
+ */
180
+ static fieldsAtBlocks(trees: PackageTrees, options: TextOptions, mode: ExtractorMode, context: TextContext, content: unknown, kind: TextStory, prefix: string, part: Part | undefined): BlockStarts;
181
+ /** 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. */
182
+ private joinedFromBefore;
183
+ /** The index of the paragraph a paragraph joins: the next in the list past markers and what the view removes, or -1. */
184
+ private nextParagraph;
185
+ /**
186
+ * A paragraph chain's block into the sink, returned; undefined where it makes none. A drop cap's frame paragraph read
187
+ * just before (`dropCap`; REQ-521) is taken in at its start.
188
+ */
189
+ private paragraph;
190
+ /**
191
+ * Whether a paragraph just read is a drop cap's frame, for the paragraph next to take (REQ-521; CR-012 section 24.3):
192
+ * under `drop_caps: join`, one `w:p` whose `w:framePr/@w:dropCap` (its own, or its style's) is `drop` or `margin`, whose
193
+ * text is at most one word (no white space and no space character, U+00A0 included), and which ends no section.
194
+ */
195
+ private dropCapFrame;
196
+ /**
197
+ * A drop cap's frame paragraph joined to the block after it (REQ-521): its runs and fields put at the block's start with
198
+ * no separator, the block (its address, its properties) in the frame's place in the sink, so that what the frame
199
+ * anchored still follows it; the warning `paragraph.drop_cap_joined` at the frame's address. The letter's run merges
200
+ * into the word's first run on docx4j's rule (the same kind, hidden and placeholder flags, revision and formatting; D6,
201
+ * Jason 2026-11-02), which replaces section 4.4's `officeOffset` contiguity rule at this one join, the two runs' text
202
+ * coming from two paragraphs' `Paragraph.text`: the merged run keeps the letter's source, and its `officeOffset` is
203
+ * undefined. False, and nothing done, where the frame is not in the sink.
204
+ */
205
+ private joinDropCap;
206
+ private endSection;
207
+ private flushIfOutsideTable;
208
+ /**
209
+ * An `altChunk`: not expanded until CR-012 phase 5e, which raises `altchunk.not_expanded` naming the chunk's part, its
210
+ * selector (WD 0.47, CR-012 section 22.2 (a)), with its content type.
211
+ */
212
+ private altChunk;
213
+ /**
214
+ * A plain-text control's bound value where its binding resolves and is what Word shows: not where the
215
+ * value is empty and the control shows its placeholder, nor under `bindings: surface`. Undefined to read
216
+ * the surface. Raises `sdt.binding_differs` where the two differ.
217
+ */
218
+ private bound;
219
+ /**
220
+ * A control's surface in the view: its `w:t`, tabs and breaks, what the view removes left out, and of an
221
+ * mc:AlternateContent the selected branch only, as the reading takes it (CR-013: every branch's text
222
+ * made a surface no binding could match, and a false `sdt.binding_differs`).
223
+ */
224
+ private surfaceText;
225
+ private bookmark;
226
+ private properties;
227
+ /**
228
+ * A paragraph's numbering from its effective `w:numPr` and the numbering definitions; undefined for none,
229
+ * for `w:numId` 0, and where Word gives the paragraph no number: a `w:numId` its style brought, whose
230
+ * level belongs to another paragraph style (`Emulator.levelStyleId`, REQ-510).
231
+ */
232
+ private numbering;
233
+ /**
234
+ * The numbering a numbered paragraph is counted by (`PackageTrees.numberingFor`): where the numbering part is absent or
235
+ * cannot be read, Word's default definition, and `part.absent` or `part.not_read` naming the part, once (WD 0.76).
236
+ */
237
+ private numberingEmulator;
238
+ /** Whether the level belongs to a paragraph style that is neither the paragraph's nor one its style is based on. */
239
+ private linkedElsewhere;
240
+ /** The paragraph counted in its story's numbering state; undefined where it is not numbered. */
241
+ private count;
242
+ private table;
243
+ private rows;
244
+ private cells;
245
+ private runs;
246
+ private holderState;
247
+ private run;
248
+ private runItem;
249
+ /** Document text: a field's code where a field is in its code (shown only under `field_codes`), else text. */
250
+ private text;
251
+ private addText;
252
+ private endField;
253
+ private simpleField;
254
+ /** The runs of a simple field's result, added to the paragraph; their text. `hidden`: a result never shown (a SET's). */
255
+ private resultOf;
256
+ /**
257
+ * An equation, `$...$` (`$$...$$` for an `m:oMathPara`). Until CR-012 phase 5b ports a LaTeX converter
258
+ * it is its `m:t` text in document order inside the delimiters, REQ-604's form for an equation that
259
+ * can't be converted. In markup, an equation with tracked changes is its Reject All form deleted and
260
+ * its Accept All form inserted, each as the plan for that view leaves it.
261
+ */
262
+ private math;
263
+ private mathText;
264
+ /** The view's rule for an equation's list members: what the plan removes goes; without a plan, a revision by its type. */
265
+ private keepMathInView;
266
+ /**
267
+ * What a run's drawing, picture or object holds, in document order, branches selected: text boxes and
268
+ * WordArt to follow the paragraph; pictures and objects as runs where they are. A chart or SmartArt
269
+ * contributes nothing until CR-012 phase 5c.
270
+ */
271
+ private anchored;
272
+ /** A `wp:inline` or `wp:anchor`: a chart, SmartArt, a picture, or a shape to walk into. */
273
+ private graphic;
274
+ /** A VML shape: legacy WordArt, a picture, or a shape to walk into for its text box. */
275
+ private vmlShape;
276
+ /** A `w:object`: an object run with its ProgID (REQ-512); its package is read under `embedded: true`, phase 5d. */
277
+ private object;
278
+ /**
279
+ * A DrawingML picture: its `wp:docPr` (or a nested picture's `pic:cNvPr`). `descr` and `title` are the
280
+ * schema's default, `''`, where the element doesn't give them, as docx4j's JAXB getters read them (CR-012
281
+ * section 20).
282
+ */
283
+ private image;
284
+ private imageOf;
285
+ /**
286
+ * `mce.branches_differ` (REQ-307): where the selected branch and another both hold text, and the texts
287
+ * differ after REQ-1201's normalisation. A branch's text is every `w:t`, `m:t` and `a:t` in it, whatever
288
+ * the view and hidden or not, as docx4j reads it: a comparison made at load knows no view, and a branch
289
+ * that differs only in hidden or deleted text is one an agent should hear of (Jason, 2026-10-21, for WD
290
+ * 0.29; CR-012 section 15.6). `mce.nothing_selected` (REQ-305): where the element has Choices and nothing is selected.
291
+ */
292
+ private compareBranches;
293
+ /** `mce.nothing_selected`, its selector the part and its `detail` the namespaces (REQ-801). */
294
+ private nothingSelected;
295
+ /**
296
+ * What the walk can't meet, from the warnings the load's passes recorded on each part this reading took, none with an address:
297
+ * `mce.nothing_selected` for an element a resolving load took out or one at a part's root (CR-029 section 3.5);
298
+ * `mce.undeclared_prefix` (REQ-323, CR-030), on a story part or the styles, numbering or settings part the reading consults;
299
+ * and `part.unexpected_root` (REQ-320, CR-028 D11).
300
+ */
301
+ private partWarningsUnmet;
302
+ /**
303
+ * A story part the reading takes that could not be read: none of its text, and `content.not_read` naming it (REQ-801),
304
+ * at the story's address prefix for a header or footer; docx4j's `storyContent` (`4fdd80063`).
305
+ */
306
+ private storyRead;
307
+ warn(w: TextWarning): void;
308
+ private sectionsWithHeaders;
309
+ private headerOrFooter;
310
+ /** A header or footer part's content as its own story (`Texts.of(headerPart)`). */
311
+ headerOrFooterPart(part: Part, kind: 'HEADER' | 'FOOTER', rId: string): TextResult;
312
+ private notes;
313
+ private comments;
314
+ /** Whether the view removes a list member (always false in markup and on a resolved copy). */
315
+ removes(item: unknown): boolean;
316
+ /** Whether the view takes a content control away and leaves its content (an inserted one, rejected). */
317
+ private unwraps;
318
+ private joinsNext;
319
+ /** The paragraph's properties in the view: its own, or what the plan gives a paragraph whose mark is gone with no paragraph next. */
320
+ private viewPPr;
321
+ private isHiddenRun;
322
+ /**
323
+ * A run's formatting beyond its paragraph style's (CR-046 phase 3): bold, italic, struck through,
324
+ * monospaced, each as the run's own property gives it, else its styles', where the paragraph style
325
+ * alone doesn't give it. And, whatever the paragraph style says, what the text shows (docx4j CR-069;
326
+ * CR-012 section 24): its case, folded the same way, a run under both caps and small caps being caps
327
+ * (WD REQ-607); its vertical alignment (REQ-710); and a cased run's language. A run carrying only that.
328
+ */
329
+ private formatOf;
330
+ /**
331
+ * The language a cased run's capitals are mapped by (WD REQ-607): its own `w:lang/@w:val`, else its styles' (with the
332
+ * document defaults'), else the `default_language` option. `w:themeFontLang` is no link (WD 0.80, CR-012 section 24.8):
333
+ * it chooses among the theme's fonts, and Word cases such a run by its editing language, which the option stands in for.
334
+ */
335
+ private language;
336
+ /** The run's font for `monospace`: its own `w:rFonts/@w:ascii`, else its styles'. */
337
+ private runFont;
338
+ /** The effective run properties of the paragraph's style and a character style, cached by their ids; undefined without styles. */
339
+ private styleRPr;
340
+ private isHiddenMark;
341
+ }
342
+ /** A TOC field's instruction: a table of contents, of figures (`\c`), of anything it collects. */
343
+ export declare function isTocField(instr: string): boolean;
344
+ /**
345
+ * A HYPERLINK field's target from its instruction (WD REQ-703): its address, and `#` and the bookmark its
346
+ * `\l` names; undefined for any other field, or one with neither.
347
+ */
348
+ export declare function fieldHyperlinkTarget(instr: string): string | undefined;
349
+ export {};