@docx4j/core-ts 0.1.0 → 0.1.1

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 (168) hide show
  1. package/README.md +410 -10
  2. package/dist/model/content/Body.d.mts +109 -4
  3. package/dist/model/content/Body.mjs +300 -29
  4. package/dist/model/content/Comment.d.mts +78 -0
  5. package/dist/model/content/Comment.mjs +429 -0
  6. package/dist/model/content/ContentControl.d.mts +173 -0
  7. package/dist/model/content/ContentControl.mjs +638 -0
  8. package/dist/model/content/Font.d.mts +48 -8
  9. package/dist/model/content/Font.mjs +55 -13
  10. package/dist/model/content/InlinePicture.d.mts +103 -0
  11. package/dist/model/content/InlinePicture.mjs +361 -0
  12. package/dist/model/content/List.d.mts +253 -0
  13. package/dist/model/content/List.mjs +778 -0
  14. package/dist/model/content/Paragraph.d.mts +213 -16
  15. package/dist/model/content/Paragraph.mjs +611 -57
  16. package/dist/model/content/Range.d.mts +48 -4
  17. package/dist/model/content/Range.mjs +161 -4
  18. package/dist/model/content/Table.d.mts +130 -0
  19. package/dist/model/content/Table.mjs +429 -0
  20. package/dist/model/content/TrackedChange.d.mts +96 -0
  21. package/dist/model/content/TrackedChange.mjs +352 -0
  22. package/dist/model/content/comments.d.mts +122 -0
  23. package/dist/model/content/comments.mjs +248 -0
  24. package/dist/model/content/index.d.mts +13 -3
  25. package/dist/model/content/index.mjs +15 -3
  26. package/dist/model/content/ooxml.d.mts +17 -0
  27. package/dist/model/content/ooxml.mjs +214 -0
  28. package/dist/model/content/styles.d.mts +21 -0
  29. package/dist/model/content/styles.mjs +86 -0
  30. package/dist/model/content/tracking.d.mts +104 -0
  31. package/dist/model/content/tracking.mjs +313 -0
  32. package/dist/model/content/tree.d.mts +56 -9
  33. package/dist/model/content/tree.mjs +104 -31
  34. package/dist/model/customxml/CustomXmlPart.d.mts +158 -0
  35. package/dist/model/customxml/CustomXmlPart.mjs +415 -0
  36. package/dist/model/customxml/CustomXmlPartCollection.d.mts +68 -0
  37. package/dist/model/customxml/CustomXmlPartCollection.mjs +183 -0
  38. package/dist/model/customxml/XmlMapping.d.mts +46 -0
  39. package/dist/model/customxml/XmlMapping.mjs +98 -0
  40. package/dist/model/customxml/bindings.d.mts +41 -0
  41. package/dist/model/customxml/bindings.mjs +230 -0
  42. package/dist/model/customxml/index.d.mts +7 -0
  43. package/dist/model/customxml/index.mjs +9 -0
  44. package/dist/model/customxml/insert.d.mts +20 -0
  45. package/dist/model/customxml/insert.mjs +22 -0
  46. package/dist/model/customxml/kinds.d.mts +103 -0
  47. package/dist/model/customxml/kinds.mjs +267 -0
  48. package/dist/model/customxml/xpath.d.mts +52 -0
  49. package/dist/model/customxml/xpath.mjs +205 -0
  50. package/dist/model/fonts/CJKToEnglish.d.mts +2 -0
  51. package/dist/model/fonts/CJKToEnglish.mjs +16 -0
  52. package/dist/model/fonts/FontFallback.d.mts +58 -0
  53. package/dist/model/fonts/FontFallback.mjs +219 -0
  54. package/dist/model/fonts/IdentityPlusMapper.d.mts +7 -0
  55. package/dist/model/fonts/IdentityPlusMapper.mjs +19 -0
  56. package/dist/model/fonts/LanguageTagToScriptMapping.d.mts +7 -0
  57. package/dist/model/fonts/LanguageTagToScriptMapping.mjs +67 -0
  58. package/dist/model/fonts/Mapper.d.mts +190 -0
  59. package/dist/model/fonts/Mapper.mjs +481 -0
  60. package/dist/model/fonts/PhysicalFont.d.mts +34 -0
  61. package/dist/model/fonts/PhysicalFont.mjs +62 -0
  62. package/dist/model/fonts/RunFontSelector.d.mts +194 -0
  63. package/dist/model/fonts/RunFontSelector.mjs +441 -0
  64. package/dist/model/fonts/ThemeFonts.d.mts +17 -0
  65. package/dist/model/fonts/ThemeFonts.mjs +76 -0
  66. package/dist/model/fonts/defaultTheme.d.mts +37 -0
  67. package/dist/model/fonts/defaultTheme.mjs +57 -0
  68. package/dist/model/fonts/families.generated.d.mts +11 -0
  69. package/dist/model/fonts/families.generated.mjs +17 -0
  70. package/dist/model/fonts/fontsInUse.d.mts +39 -0
  71. package/dist/model/fonts/fontsInUse.mjs +183 -0
  72. package/dist/model/fonts/index.d.mts +14 -0
  73. package/dist/model/fonts/index.mjs +29 -0
  74. package/dist/model/fonts/lookup.d.mts +5 -0
  75. package/dist/model/fonts/lookup.mjs +12 -0
  76. package/dist/model/fonts/registry.d.mts +31 -0
  77. package/dist/model/fonts/registry.mjs +103 -0
  78. package/dist/model/fonts/scripts.d.mts +2 -0
  79. package/dist/model/fonts/scripts.mjs +78 -0
  80. package/dist/model/fonts/substitutions.generated.d.mts +30 -0
  81. package/dist/model/fonts/substitutions.generated.mjs +12 -0
  82. package/dist/model/fonts/themes.generated.d.mts +6 -0
  83. package/dist/model/fonts/themes.generated.mjs +11 -0
  84. package/dist/model/index.d.mts +5 -0
  85. package/dist/model/index.mjs +13 -1
  86. package/dist/model/listnumbering/Emulator.d.mts +187 -0
  87. package/dist/model/listnumbering/Emulator.mjs +332 -0
  88. package/dist/model/listnumbering/definitions.d.mts +251 -0
  89. package/dist/model/listnumbering/definitions.mjs +571 -0
  90. package/dist/model/listnumbering/formats.d.mts +25 -0
  91. package/dist/model/listnumbering/formats.mjs +320 -0
  92. package/dist/model/listnumbering/index.d.mts +4 -0
  93. package/dist/model/listnumbering/index.mjs +15 -0
  94. package/dist/model/listnumbering/state.d.mts +97 -0
  95. package/dist/model/listnumbering/state.mjs +179 -0
  96. package/dist/model/properties/PropertyResolver.d.mts +216 -0
  97. package/dist/model/properties/PropertyResolver.mjs +524 -0
  98. package/dist/model/properties/catalogue.d.mts +179 -0
  99. package/dist/model/properties/catalogue.mjs +860 -0
  100. package/dist/model/properties/index.d.mts +4 -0
  101. package/dist/model/properties/index.mjs +9 -0
  102. package/dist/model/properties/log.d.mts +7 -0
  103. package/dist/model/properties/log.mjs +25 -0
  104. package/dist/model/properties/styleUtil.d.mts +112 -0
  105. package/dist/model/properties/styleUtil.mjs +359 -0
  106. package/dist/node/index.d.mts +1 -0
  107. package/dist/node/index.mjs +12 -0
  108. package/dist/office-js/document.d.mts +111 -0
  109. package/dist/office-js/document.mjs +267 -0
  110. package/dist/office-js/enums.d.mts +187 -0
  111. package/dist/office-js/enums.mjs +176 -0
  112. package/dist/office-js/errors.d.mts +29 -0
  113. package/dist/office-js/errors.mjs +39 -0
  114. package/dist/office-js/extras.d.mts +5 -0
  115. package/dist/office-js/extras.mjs +29 -0
  116. package/dist/office-js/fragment.d.mts +10 -0
  117. package/dist/office-js/fragment.mjs +23 -0
  118. package/dist/office-js/index.d.mts +183 -0
  119. package/dist/office-js/index.mjs +54 -0
  120. package/dist/office-js/proxy.d.mts +72 -0
  121. package/dist/office-js/proxy.mjs +279 -0
  122. package/dist/office-js/run.d.mts +32 -0
  123. package/dist/office-js/run.mjs +66 -0
  124. package/dist/office-js/supported.d.mts +7 -0
  125. package/dist/office-js/supported.generated.d.mts +1 -0
  126. package/dist/office-js/supported.generated.mjs +235 -0
  127. package/dist/office-js/supported.mjs +53 -0
  128. package/dist/office-js/toApiScript.d.mts +25 -0
  129. package/dist/office-js/toApiScript.mjs +394 -0
  130. package/dist/opc/ContentTypes.d.mts +1 -0
  131. package/dist/opc/ContentTypes.mjs +1 -0
  132. package/dist/opc/DirectoryPartStore.d.mts +47 -0
  133. package/dist/opc/DirectoryPartStore.mjs +123 -0
  134. package/dist/opc/exceptions.d.mts +30 -0
  135. package/dist/opc/exceptions.mjs +38 -0
  136. package/dist/opc/index.d.mts +1 -1
  137. package/dist/opc/index.mjs +1 -1
  138. package/dist/packages/OpcPackage.d.mts +19 -1
  139. package/dist/packages/OpcPackage.mjs +29 -0
  140. package/dist/packages/PresentationMLPackage.d.mts +71 -1
  141. package/dist/packages/PresentationMLPackage.mjs +179 -0
  142. package/dist/packages/SpreadsheetMLPackage.d.mts +30 -1
  143. package/dist/packages/SpreadsheetMLPackage.mjs +78 -0
  144. package/dist/packages/WordprocessingMLPackage.d.mts +124 -2
  145. package/dist/packages/WordprocessingMLPackage.mjs +309 -2
  146. package/dist/packages/index.d.mts +1 -1
  147. package/dist/packages/index.mjs +1 -1
  148. package/dist/parts/DefaultXmlPart.d.mts +18 -0
  149. package/dist/parts/DefaultXmlPart.mjs +34 -5
  150. package/dist/parts/PartRegistry.mjs +1 -0
  151. package/dist/parts/XmlPart.d.mts +33 -0
  152. package/dist/parts/XmlPart.mjs +105 -2
  153. package/dist/parts/pml/defaults.d.mts +6 -0
  154. package/dist/parts/pml/defaults.mjs +53 -0
  155. package/dist/parts/pml/index.d.mts +66 -3
  156. package/dist/parts/pml/index.mjs +206 -7
  157. package/dist/parts/pml/placeholders.d.mts +71 -0
  158. package/dist/parts/pml/placeholders.mjs +141 -0
  159. package/dist/parts/sml/index.d.mts +19 -1
  160. package/dist/parts/sml/index.mjs +60 -1
  161. package/dist/parts/wml/comments.d.mts +1 -0
  162. package/dist/parts/wml/comments.mjs +179 -0
  163. package/dist/parts/wml/defaultNumbering.d.mts +1 -0
  164. package/dist/parts/wml/defaultNumbering.mjs +216 -0
  165. package/dist/parts/wml/index.d.mts +121 -0
  166. package/dist/parts/wml/index.mjs +291 -0
  167. package/dist/xml/dom.mjs +1 -2
  168. package/package.json +25 -4
@@ -0,0 +1,216 @@
1
+ // docx4j's default numbering: the resource
2
+ // docx4j-core/src/main/resources/org/docx4j/openpackaging/parts/WordprocessingML/numbering.xml,
3
+ // which `NumberingDefinitionsPart.unmarshalDefaultNumbering()` reads. Taken from docx4j
4
+ // VERSION_17_1_1 at 546b18b56, where the file itself is unchanged since 752e200eb (2019-02-09).
5
+ //
6
+ // abstractNum 0 is Word's bullet set and abstractNum 1 its decimal set; `w:num` 1 names the
7
+ // decimal one and `w:num` 2 the bullet one. Generated from that resource - UTF-16 there, UTF-8
8
+ // here, CRLF normalised to LF, nothing else changed. Do not edit.
9
+ export const DEFAULT_NUMBERING_XML = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
10
+ <w:numbering xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
11
+ <w:abstractNum w:abstractNumId="0">
12
+ <w:nsid w:val="16892FB7"/>
13
+ <w:multiLevelType w:val="hybridMultilevel"/>
14
+ <w:tmpl w:val="5A4EB96A"/>
15
+ <w:lvl w:ilvl="0" w:tplc="0C090001">
16
+ <w:start w:val="1"/>
17
+ <w:numFmt w:val="bullet"/>
18
+ <w:lvlText w:val=""/>
19
+ <w:lvlJc w:val="left"/>
20
+ <w:pPr>
21
+ <w:ind w:left="720" w:hanging="360"/>
22
+ </w:pPr>
23
+ <w:rPr>
24
+ <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
25
+ </w:rPr>
26
+ </w:lvl>
27
+ <w:lvl w:ilvl="1" w:tplc="0C090003" w:tentative="1">
28
+ <w:start w:val="1"/>
29
+ <w:numFmt w:val="bullet"/>
30
+ <w:lvlText w:val="o"/>
31
+ <w:lvlJc w:val="left"/>
32
+ <w:pPr>
33
+ <w:ind w:left="1440" w:hanging="360"/>
34
+ </w:pPr>
35
+ <w:rPr>
36
+ <w:rFonts w:ascii="Courier New" w:hAnsi="Courier New" w:cs="Courier New" w:hint="default"/>
37
+ </w:rPr>
38
+ </w:lvl>
39
+ <w:lvl w:ilvl="2" w:tplc="0C090005" w:tentative="1">
40
+ <w:start w:val="1"/>
41
+ <w:numFmt w:val="bullet"/>
42
+ <w:lvlText w:val=""/>
43
+ <w:lvlJc w:val="left"/>
44
+ <w:pPr>
45
+ <w:ind w:left="2160" w:hanging="360"/>
46
+ </w:pPr>
47
+ <w:rPr>
48
+ <w:rFonts w:ascii="Wingdings" w:hAnsi="Wingdings" w:hint="default"/>
49
+ </w:rPr>
50
+ </w:lvl>
51
+ <w:lvl w:ilvl="3" w:tplc="0C090001" w:tentative="1">
52
+ <w:start w:val="1"/>
53
+ <w:numFmt w:val="bullet"/>
54
+ <w:lvlText w:val=""/>
55
+ <w:lvlJc w:val="left"/>
56
+ <w:pPr>
57
+ <w:ind w:left="2880" w:hanging="360"/>
58
+ </w:pPr>
59
+ <w:rPr>
60
+ <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
61
+ </w:rPr>
62
+ </w:lvl>
63
+ <w:lvl w:ilvl="4" w:tplc="0C090003" w:tentative="1">
64
+ <w:start w:val="1"/>
65
+ <w:numFmt w:val="bullet"/>
66
+ <w:lvlText w:val="o"/>
67
+ <w:lvlJc w:val="left"/>
68
+ <w:pPr>
69
+ <w:ind w:left="3600" w:hanging="360"/>
70
+ </w:pPr>
71
+ <w:rPr>
72
+ <w:rFonts w:ascii="Courier New" w:hAnsi="Courier New" w:cs="Courier New" w:hint="default"/>
73
+ </w:rPr>
74
+ </w:lvl>
75
+ <w:lvl w:ilvl="5" w:tplc="0C090005" w:tentative="1">
76
+ <w:start w:val="1"/>
77
+ <w:numFmt w:val="bullet"/>
78
+ <w:lvlText w:val=""/>
79
+ <w:lvlJc w:val="left"/>
80
+ <w:pPr>
81
+ <w:ind w:left="4320" w:hanging="360"/>
82
+ </w:pPr>
83
+ <w:rPr>
84
+ <w:rFonts w:ascii="Wingdings" w:hAnsi="Wingdings" w:hint="default"/>
85
+ </w:rPr>
86
+ </w:lvl>
87
+ <w:lvl w:ilvl="6" w:tplc="0C090001" w:tentative="1">
88
+ <w:start w:val="1"/>
89
+ <w:numFmt w:val="bullet"/>
90
+ <w:lvlText w:val=""/>
91
+ <w:lvlJc w:val="left"/>
92
+ <w:pPr>
93
+ <w:ind w:left="5040" w:hanging="360"/>
94
+ </w:pPr>
95
+ <w:rPr>
96
+ <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
97
+ </w:rPr>
98
+ </w:lvl>
99
+ <w:lvl w:ilvl="7" w:tplc="0C090003" w:tentative="1">
100
+ <w:start w:val="1"/>
101
+ <w:numFmt w:val="bullet"/>
102
+ <w:lvlText w:val="o"/>
103
+ <w:lvlJc w:val="left"/>
104
+ <w:pPr>
105
+ <w:ind w:left="5760" w:hanging="360"/>
106
+ </w:pPr>
107
+ <w:rPr>
108
+ <w:rFonts w:ascii="Courier New" w:hAnsi="Courier New" w:cs="Courier New" w:hint="default"/>
109
+ </w:rPr>
110
+ </w:lvl>
111
+ <w:lvl w:ilvl="8" w:tplc="0C090005" w:tentative="1">
112
+ <w:start w:val="1"/>
113
+ <w:numFmt w:val="bullet"/>
114
+ <w:lvlText w:val=""/>
115
+ <w:lvlJc w:val="left"/>
116
+ <w:pPr>
117
+ <w:ind w:left="6480" w:hanging="360"/>
118
+ </w:pPr>
119
+ <w:rPr>
120
+ <w:rFonts w:ascii="Wingdings" w:hAnsi="Wingdings" w:hint="default"/>
121
+ </w:rPr>
122
+ </w:lvl>
123
+ </w:abstractNum>
124
+ <w:abstractNum w:abstractNumId="1">
125
+ <w:nsid w:val="7E706046"/>
126
+ <w:multiLevelType w:val="hybridMultilevel"/>
127
+ <w:tmpl w:val="336E8F2C"/>
128
+ <w:lvl w:ilvl="0" w:tplc="0C09000F">
129
+ <w:start w:val="1"/>
130
+ <w:numFmt w:val="decimal"/>
131
+ <w:lvlText w:val="%1."/>
132
+ <w:lvlJc w:val="left"/>
133
+ <w:pPr>
134
+ <w:ind w:left="720" w:hanging="360"/>
135
+ </w:pPr>
136
+ </w:lvl>
137
+ <w:lvl w:ilvl="1" w:tplc="0C090019" w:tentative="1">
138
+ <w:start w:val="1"/>
139
+ <w:numFmt w:val="lowerLetter"/>
140
+ <w:lvlText w:val="%2."/>
141
+ <w:lvlJc w:val="left"/>
142
+ <w:pPr>
143
+ <w:ind w:left="1440" w:hanging="360"/>
144
+ </w:pPr>
145
+ </w:lvl>
146
+ <w:lvl w:ilvl="2" w:tplc="0C09001B" w:tentative="1">
147
+ <w:start w:val="1"/>
148
+ <w:numFmt w:val="lowerRoman"/>
149
+ <w:lvlText w:val="%3."/>
150
+ <w:lvlJc w:val="right"/>
151
+ <w:pPr>
152
+ <w:ind w:left="2160" w:hanging="180"/>
153
+ </w:pPr>
154
+ </w:lvl>
155
+ <w:lvl w:ilvl="3" w:tplc="0C09000F" w:tentative="1">
156
+ <w:start w:val="1"/>
157
+ <w:numFmt w:val="decimal"/>
158
+ <w:lvlText w:val="%4."/>
159
+ <w:lvlJc w:val="left"/>
160
+ <w:pPr>
161
+ <w:ind w:left="2880" w:hanging="360"/>
162
+ </w:pPr>
163
+ </w:lvl>
164
+ <w:lvl w:ilvl="4" w:tplc="0C090019" w:tentative="1">
165
+ <w:start w:val="1"/>
166
+ <w:numFmt w:val="lowerLetter"/>
167
+ <w:lvlText w:val="%5."/>
168
+ <w:lvlJc w:val="left"/>
169
+ <w:pPr>
170
+ <w:ind w:left="3600" w:hanging="360"/>
171
+ </w:pPr>
172
+ </w:lvl>
173
+ <w:lvl w:ilvl="5" w:tplc="0C09001B" w:tentative="1">
174
+ <w:start w:val="1"/>
175
+ <w:numFmt w:val="lowerRoman"/>
176
+ <w:lvlText w:val="%6."/>
177
+ <w:lvlJc w:val="right"/>
178
+ <w:pPr>
179
+ <w:ind w:left="4320" w:hanging="180"/>
180
+ </w:pPr>
181
+ </w:lvl>
182
+ <w:lvl w:ilvl="6" w:tplc="0C09000F" w:tentative="1">
183
+ <w:start w:val="1"/>
184
+ <w:numFmt w:val="decimal"/>
185
+ <w:lvlText w:val="%7."/>
186
+ <w:lvlJc w:val="left"/>
187
+ <w:pPr>
188
+ <w:ind w:left="5040" w:hanging="360"/>
189
+ </w:pPr>
190
+ </w:lvl>
191
+ <w:lvl w:ilvl="7" w:tplc="0C090019" w:tentative="1">
192
+ <w:start w:val="1"/>
193
+ <w:numFmt w:val="lowerLetter"/>
194
+ <w:lvlText w:val="%8."/>
195
+ <w:lvlJc w:val="left"/>
196
+ <w:pPr>
197
+ <w:ind w:left="5760" w:hanging="360"/>
198
+ </w:pPr>
199
+ </w:lvl>
200
+ <w:lvl w:ilvl="8" w:tplc="0C09001B" w:tentative="1">
201
+ <w:start w:val="1"/>
202
+ <w:numFmt w:val="lowerRoman"/>
203
+ <w:lvlText w:val="%9."/>
204
+ <w:lvlJc w:val="right"/>
205
+ <w:pPr>
206
+ <w:ind w:left="6480" w:hanging="180"/>
207
+ </w:pPr>
208
+ </w:lvl>
209
+ </w:abstractNum>
210
+ <w:num w:numId="1">
211
+ <w:abstractNumId w:val="1"/>
212
+ </w:num>
213
+ <w:num w:numId="2">
214
+ <w:abstractNumId w:val="0"/>
215
+ </w:num>
216
+ </w:numbering>`;
@@ -1,6 +1,7 @@
1
1
  import type * as wml from '@docx4j/generated-objects-ts/modules/org_docx4j_wml';
2
2
  import type * as w15 from '@docx4j/generated-objects-ts/modules/org_docx4j_w15';
3
3
  import type * as w16cid from '@docx4j/generated-objects-ts/modules/org_docx4j_w16cid';
4
+ import type * as w16cex from '@docx4j/generated-objects-ts/modules/org_docx4j_w16cex';
4
5
  import type * as wne from '@docx4j/generated-objects-ts/modules/org_docx4j_com_microsoft_schemas_office_word_x2006_wordml';
5
6
  import { XmlPart } from '../XmlPart.mjs';
6
7
  import { Part } from '../Part.mjs';
@@ -8,6 +9,12 @@ import { PartName } from '../../opc/PartName.mjs';
8
9
  import { DefaultXmlPart } from '../DefaultXmlPart.mjs';
9
10
  import { ThemePart } from '../dml/index.mjs';
10
11
  import { Body } from '../../model/content/Body.mjs';
12
+ import type { AbstractListDefinition, ListDefinition } from '../../model/listnumbering/definitions.mjs';
13
+ import { NumberingDefinitions } from '../../model/listnumbering/definitions.mjs';
14
+ import { Emulator } from '../../model/listnumbering/Emulator.mjs';
15
+ import type { NumberingState } from '../../model/listnumbering/state.mjs';
16
+ import { RunFontSelector } from '../../model/fonts/RunFontSelector.mjs';
17
+ import type { Mapper } from '../../model/fonts/Mapper.mjs';
11
18
  /**
12
19
  * Shared by the main document and the glossary document (docx4j DocumentPart): the shortcuts
13
20
  * to styles, numbering, fonts, settings, theme, comments and notes.
@@ -22,6 +29,7 @@ export declare abstract class DocumentPart<T> extends XmlPart<T> {
22
29
  commentsPart: CommentsPart | undefined;
23
30
  commentsExtendedPart: CommentsExtendedPart | undefined;
24
31
  commentsIdsPart: CommentsIdsPart | undefined;
32
+ commentsExtensiblePart: CommentsExtensiblePart | undefined;
25
33
  footnotesPart: FootnotesPart | undefined;
26
34
  endnotesPart: EndnotesPart | undefined;
27
35
  peoplePart: PeoplePart | undefined;
@@ -39,6 +47,49 @@ export declare class MainDocumentPart extends DocumentPart<wml.Document> {
39
47
  /** The Office JS-shaped view of `w:body`; the part must be unmarshalled (`getBody()` does that). */
40
48
  get body(): Body;
41
49
  getBody(): Promise<Body>;
50
+ private fontSelector;
51
+ private fontSelectorPending;
52
+ private fontMapper;
53
+ /**
54
+ * The package's `RunFontSelector`, built once: the property resolver, the theme part's font
55
+ * scheme, the settings part's `w:themeFontLang` and the package's `fonts.defaultTheme`.
56
+ *
57
+ * Asynchronous because it reads the theme and settings parts; `runFontSelector` is the
58
+ * synchronous accessor afterwards. Both parts are read with `readContents()`, so a document
59
+ * whose theme and settings nobody has edited still saves byte for byte.
60
+ */
61
+ getRunFontSelector(): Promise<RunFontSelector>;
62
+ private buildRunFontSelector;
63
+ /** The selector, which must already have been built (`await getRunFontSelector()`). */
64
+ get runFontSelector(): RunFontSelector;
65
+ /** The selector if it has been built, without throwing (what a read with a fallback wants). */
66
+ get runFontSelectorOrUndefined(): RunFontSelector | undefined;
67
+ /**
68
+ * The package's font mapper, populated from {@link fontsInUse} and the font table part
69
+ * (docx4j `WordprocessingMLPackage.getFontMapper` / `setFontMapper`): an
70
+ * `IdentityPlusMapper` over the default font registry unless one is given.
71
+ *
72
+ * @param mapper a mapper of the caller's own, which is then populated and kept
73
+ */
74
+ getFontMapper(mapper?: Mapper): Promise<Mapper>;
75
+ /** Discard the selector and the mapper: the styles, theme or settings changed under us. */
76
+ refreshFonts(): void;
77
+ /**
78
+ * The document font names, as docx4j's `fontsInUse()`: the four slots of every `w:rFonts` on
79
+ * the runs, paragraph marks and content controls of the body, headers, footers, footnotes,
80
+ * endnotes and comments; the styles in use with their `w:basedOn` chains; the numbering
81
+ * levels; the document defaults; and the default font. Theme references are resolved, and a
82
+ * CJK font name is collected by its English name.
83
+ */
84
+ fontsInUse(): Promise<Set<string>>;
85
+ /** The style ids used directly in the document (docx4j `getStylesInUse()`); not those that
86
+ * others are merely based on. */
87
+ getStylesInUse(): Promise<Set<string>>;
88
+ /** The block-level content of each story, in docx4j's order: the body, then the headers and
89
+ * footers, the endnotes, the footnotes and the comments. */
90
+ private stories;
91
+ /** The styles part and its `w:default="1"` style ids, read without costing it its round trip. */
92
+ private styleSource;
42
93
  }
43
94
  /** `/word/glossary/document.xml` (docx4j GlossaryDocumentPart). */
44
95
  export declare class GlossaryDocumentPart extends DocumentPart<wml.GlossaryDocument> {
@@ -47,8 +98,74 @@ export declare class GlossaryDocumentPart extends DocumentPart<wml.GlossaryDocum
47
98
  export declare class StyleDefinitionsPart extends XmlPart<wml.Styles> {
48
99
  constructor(partName?: PartName | string);
49
100
  }
101
+ /**
102
+ * `/word/numbering.xml` (docx4j NumberingDefinitionsPart): the list definitions, the indent a
103
+ * level contributes, and the `Emulator` that turns a paragraph into a label.
104
+ *
105
+ * The definitions are read **privately** (`readContents()`), as the `PropertyResolver` reads the
106
+ * styles, so that a document whose labels are only read still saves byte for byte; where the
107
+ * package already has a resolver the definitions it built are reused, since it needs them for
108
+ * `getInd`. A change to the part is picked up by `WordprocessingMLPackage.refresh()`.
109
+ */
50
110
  export declare class NumberingDefinitionsPart extends XmlPart<wml.Numbering> {
51
111
  constructor(partName?: PartName | string);
112
+ /** The tree `readContents()` gave, kept so the definitions can be rebuilt without re-reading. */
113
+ private privateTree;
114
+ private ownDefinitions;
115
+ private ownDefinitionsFrom;
116
+ private emulator;
117
+ /** The resolver of the package this part belongs to, if it has one built. */
118
+ private get resolver();
119
+ /** The `w:numbering` the definitions are built over: the live tree, or the private read. */
120
+ private get tree();
121
+ /**
122
+ * docx4j `initialiseMaps` and the two maps it fills: every `w:abstractNum` and every `w:num`,
123
+ * with `w:numStyleLink` resolved. Synchronous, so the part's tree must have been read - by
124
+ * {@link getDefinitions}, or by the package's `getPropertyResolver()`.
125
+ */
126
+ get definitions(): NumberingDefinitions;
127
+ /** {@link definitions}, reading the part first where nothing has. */
128
+ getDefinitions(): Promise<NumberingDefinitions>;
129
+ /** `w:abstractNumId` -> the definition. docx4j `getAbstractListDefinitions()`. */
130
+ get abstractListDefinitions(): ReadonlyMap<string, AbstractListDefinition>;
131
+ /** `w:numId` -> the definition. docx4j `getInstanceListDefinitions()`. */
132
+ get instanceListDefinitions(): ReadonlyMap<string, ListDefinition>;
133
+ /** The indent a `w:numPr`'s level contributes. docx4j `getInd(NumPr)`. */
134
+ getInd(numPr: wml.PPrBase.NumPr): wml.PPrBase.Ind | undefined;
135
+ /** The indent a level contributes. docx4j `getInd(String, String)`. */
136
+ getIndOf(numId: string, ilvl: string | undefined): wml.PPrBase.Ind | undefined;
137
+ /** The paragraph style a level is linked to (ECMA-376 17.9.24), or undefined. */
138
+ getLinkedStyleId(numId: string, ilvl: string | undefined): string | undefined;
139
+ /**
140
+ * docx4j `getEmulator([reset])`: the numbering emulator over this part, built once. `reset`
141
+ * gives it a fresh default {@link NumberingState} and re-reads the definitions, as docx4j's
142
+ * does - every list starts again.
143
+ */
144
+ getEmulator(reset?: boolean): Emulator;
145
+ /** The counters the state-less `Emulator` calls use. docx4j `getNumberingState()`. */
146
+ get numberingState(): NumberingState;
147
+ /**
148
+ * Replaces this part's contents with docx4j's default numbering (`numbering.xml` from its
149
+ * resources): abstractNum 0 is Word's bullet set and abstractNum 1 its decimal set, with
150
+ * `w:num` 1 naming the decimal one and `w:num` 2 the bullet one.
151
+ * docx4j `unmarshalDefaultNumbering()`.
152
+ */
153
+ unmarshalDefaultNumbering(): Promise<wml.Numbering>;
154
+ /**
155
+ * Makes the tree the definitions were built over this part's **live** contents, so that an
156
+ * edit to a `w:num` or a `w:lvl` is marshalled on save (CR-002 phase H).
157
+ *
158
+ * The definitions are read privately (`readContents()`), which keeps a document whose labels
159
+ * are only read byte for byte; a write has to give that up. Promoting the tree that is
160
+ * already in hand - rather than unmarshalling the part a second time - is what keeps the
161
+ * `List` views valid across the change: they hold objects of that very tree.
162
+ *
163
+ * Synchronous, since the tree has been read; the part must have been read
164
+ * (`getDefinitions()`, or the package's `getPropertyResolver()`) or unmarshalled first.
165
+ */
166
+ makeLive(): wml.Numbering;
167
+ /** Forgets the definitions and the emulator: the tree has changed under us. */
168
+ refreshDefinitions(): void;
52
169
  }
53
170
  export declare class FontTablePart extends XmlPart<wml.Fonts> {
54
171
  constructor(partName?: PartName | string);
@@ -86,6 +203,10 @@ export declare class CommentsExtendedPart extends XmlPart<w15.CTCommentsEx> {
86
203
  export declare class CommentsIdsPart extends XmlPart<w16cid.CTCommentsIds> {
87
204
  constructor(partName?: PartName | string);
88
205
  }
206
+ /** `/word/commentsExtensible.xml` (w16cex, Word 2018): a durable id and a UTC date per comment. Typed since objects 0.1.3. */
207
+ export declare class CommentsExtensiblePart extends XmlPart<w16cex.CTCommentsExtensible> {
208
+ constructor(partName?: PartName | string);
209
+ }
89
210
  export declare class PeoplePart extends XmlPart<w15.CTPeople> {
90
211
  constructor(partName?: PartName | string);
91
212
  }