@stll/docx-core 0.5.0 → 0.5.2
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.
|
@@ -12,10 +12,15 @@ type ThemeColorSlot = "dk1" | "lt1" | "dk2" | "lt2" | "accent1" | "accent2" | "a
|
|
|
12
12
|
* Color value - can be direct RGB, theme reference, or auto
|
|
13
13
|
*/
|
|
14
14
|
type ColorValue = {
|
|
15
|
-
/** RGB hex value without # (e.g., "FF0000") */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/** RGB hex value without # (e.g., "FF0000") */
|
|
16
|
+
rgb?: string;
|
|
17
|
+
/** Theme color slot reference */
|
|
18
|
+
themeColor?: ThemeColorSlot;
|
|
19
|
+
/** Tint modifier (0-255 as hex string, e.g., "80") - makes color lighter */
|
|
20
|
+
themeTint?: string;
|
|
21
|
+
/** Shade modifier (0-255 as hex string) - makes color darker */
|
|
22
|
+
themeShade?: string;
|
|
23
|
+
/** Auto color - context-dependent (usually black for text) */
|
|
19
24
|
auto?: boolean;
|
|
20
25
|
};
|
|
21
26
|
type KnownBorderStyle = "none" | "single" | "double" | "dotted" | "dashed" | "thick" | "triple" | "thinThickSmallGap" | "thickThinSmallGap" | "thinThickMediumGap" | "thickThinMediumGap" | "thinThickLargeGap" | "thickThinLargeGap" | "wave" | "doubleWave" | "dashSmallGap" | "dashDotStroked" | "threeDEmboss" | "threeDEngrave" | "outset" | "inset" | "nil";
|
|
@@ -23,28 +28,41 @@ type KnownBorderStyle = "none" | "single" | "double" | "dotted" | "dashed" | "th
|
|
|
23
28
|
* Border specification for any border (paragraph, table, page)
|
|
24
29
|
*/
|
|
25
30
|
type BorderSpec = {
|
|
26
|
-
/** Border style. Unknown OOXML styles are preserved for fallback rendering. */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
/** Border style. Unknown OOXML styles are preserved for fallback rendering. */
|
|
32
|
+
style: string;
|
|
33
|
+
/** Color of the border */
|
|
34
|
+
color?: ColorValue;
|
|
35
|
+
/** Width in eighths of a point (1/8 pt) */
|
|
36
|
+
size?: number;
|
|
37
|
+
/** Spacing from text in points */
|
|
38
|
+
space?: number;
|
|
39
|
+
/** Shadow effect */
|
|
40
|
+
shadow?: boolean;
|
|
41
|
+
/** Frame effect */
|
|
31
42
|
frame?: boolean;
|
|
32
43
|
/**
|
|
33
44
|
* Custom page-border art relationship id (`w:id` on `<w:pgBorders>` side
|
|
34
45
|
* children). Preserved for round-trip; folio does not paint art glyphs.
|
|
35
46
|
*/
|
|
36
|
-
artRelationshipId?: string;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
artRelationshipId?: string;
|
|
48
|
+
/** Custom page-border art relationship id for the top-left corner. */
|
|
49
|
+
topLeftArtRelationshipId?: string;
|
|
50
|
+
/** Custom page-border art relationship id for the top-right corner. */
|
|
51
|
+
topRightArtRelationshipId?: string;
|
|
52
|
+
/** Custom page-border art relationship id for the bottom-left corner. */
|
|
53
|
+
bottomLeftArtRelationshipId?: string;
|
|
54
|
+
/** Custom page-border art relationship id for the bottom-right corner. */
|
|
40
55
|
bottomRightArtRelationshipId?: string;
|
|
41
56
|
};
|
|
42
57
|
/**
|
|
43
58
|
* Shading/background properties
|
|
44
59
|
*/
|
|
45
60
|
type ShadingProperties = {
|
|
46
|
-
/** Pattern fill color */
|
|
47
|
-
|
|
61
|
+
/** Pattern fill color */
|
|
62
|
+
color?: ColorValue;
|
|
63
|
+
/** Background fill color */
|
|
64
|
+
fill?: ColorValue;
|
|
65
|
+
/** Shading pattern type */
|
|
48
66
|
pattern?: "clear" | "solid" | "horzStripe" | "vertStripe" | "reverseDiagStripe" | "diagStripe" | "horzCross" | "diagCross" | "thinHorzStripe" | "thinVertStripe" | "thinReverseDiagStripe" | "thinDiagStripe" | "thinHorzCross" | "thinDiagCross" | "pct5" | "pct10" | "pct12" | "pct15" | "pct20" | "pct25" | "pct30" | "pct35" | "pct37" | "pct40" | "pct45" | "pct50" | "pct55" | "pct60" | "pct62" | "pct65" | "pct70" | "pct75" | "pct80" | "pct85" | "pct87" | "pct90" | "pct95" | "nil";
|
|
49
67
|
};
|
|
50
68
|
//#endregion
|
|
@@ -65,52 +83,86 @@ type EmphasisMark = "none" | "dot" | "comma" | "circle" | "underDot";
|
|
|
65
83
|
* Complete text formatting properties (w:rPr)
|
|
66
84
|
*/
|
|
67
85
|
type TextFormatting = {
|
|
68
|
-
/** Bold (w:b) */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
86
|
+
/** Bold (w:b) */
|
|
87
|
+
bold?: boolean;
|
|
88
|
+
/** Bold complex script (w:bCs) */
|
|
89
|
+
boldCs?: boolean;
|
|
90
|
+
/** Italic (w:i) */
|
|
91
|
+
italic?: boolean;
|
|
92
|
+
/** Italic complex script (w:iCs) */
|
|
93
|
+
italicCs?: boolean;
|
|
94
|
+
/** Underline style and color (w:u) */
|
|
72
95
|
underline?: {
|
|
73
96
|
style: UnderlineStyle;
|
|
74
97
|
color?: ColorValue;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
98
|
+
};
|
|
99
|
+
/** Strikethrough (w:strike) */
|
|
100
|
+
strike?: boolean;
|
|
101
|
+
/** Double strikethrough (w:dstrike) */
|
|
102
|
+
doubleStrike?: boolean;
|
|
103
|
+
/** Superscript/subscript (w:vertAlign) */
|
|
104
|
+
vertAlign?: "baseline" | "superscript" | "subscript";
|
|
105
|
+
/** Small caps (w:smallCaps) */
|
|
106
|
+
smallCaps?: boolean;
|
|
107
|
+
/** All caps (w:caps) */
|
|
108
|
+
allCaps?: boolean;
|
|
109
|
+
/** Hidden text (w:vanish) */
|
|
110
|
+
hidden?: boolean;
|
|
111
|
+
/** Text color (w:color) */
|
|
112
|
+
color?: ColorValue;
|
|
113
|
+
/** Highlight/background color (w:highlight) */
|
|
114
|
+
highlight?: "black" | "blue" | "cyan" | "darkBlue" | "darkCyan" | "darkGray" | "darkGreen" | "darkMagenta" | "darkRed" | "darkYellow" | "green" | "lightGray" | "magenta" | "none" | "red" | "white" | "yellow";
|
|
115
|
+
/** Character shading (w:shd) */
|
|
116
|
+
shading?: ShadingProperties;
|
|
117
|
+
/** Font size in half-points (w:sz) - e.g., 24 = 12pt */
|
|
118
|
+
fontSize?: number;
|
|
119
|
+
/** Font size complex script (w:szCs) */
|
|
120
|
+
fontSizeCs?: number;
|
|
121
|
+
/** Font family (w:rFonts) */
|
|
87
122
|
fontFamily?: {
|
|
88
123
|
ascii?: string;
|
|
89
124
|
hAnsi?: string;
|
|
90
125
|
eastAsia?: string;
|
|
91
|
-
cs?: string;
|
|
126
|
+
cs?: string;
|
|
127
|
+
/** Script slot Word should prefer when selecting a glyph font (w:hint). */
|
|
128
|
+
hint?: "default" | "eastAsia" | "cs";
|
|
129
|
+
/** Theme font reference */
|
|
92
130
|
asciiTheme?: "majorAscii" | "majorHAnsi" | "majorEastAsia" | "majorBidi" | "minorAscii" | "minorHAnsi" | "minorEastAsia" | "minorBidi";
|
|
93
131
|
hAnsiTheme?: string;
|
|
94
132
|
eastAsiaTheme?: string;
|
|
95
133
|
csTheme?: string;
|
|
96
|
-
};
|
|
134
|
+
};
|
|
135
|
+
/** Run language metadata (`w:lang`) used by spelling and line breaking. */
|
|
97
136
|
language?: {
|
|
98
137
|
val?: string;
|
|
99
138
|
eastAsia?: string;
|
|
100
139
|
bidi?: string;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
140
|
+
};
|
|
141
|
+
/** Character spacing in twips (w:spacing) */
|
|
142
|
+
spacing?: number;
|
|
143
|
+
/** Raised/lowered text position in half-points (w:position) */
|
|
144
|
+
position?: number;
|
|
145
|
+
/** Horizontal text scale percentage (w:w) */
|
|
146
|
+
scale?: number;
|
|
147
|
+
/** Kerning threshold in half-points (w:kern) */
|
|
148
|
+
kerning?: number;
|
|
149
|
+
/** Text effect animation (w:effect) */
|
|
150
|
+
effect?: TextEffect;
|
|
151
|
+
/** Emphasis mark (w:em) */
|
|
152
|
+
emphasisMark?: EmphasisMark;
|
|
153
|
+
/** Emboss effect (w:emboss) */
|
|
154
|
+
emboss?: boolean;
|
|
155
|
+
/** Imprint/engrave effect (w:imprint) */
|
|
156
|
+
imprint?: boolean;
|
|
157
|
+
/** Outline effect (w:outline) */
|
|
158
|
+
outline?: boolean;
|
|
159
|
+
/** Shadow effect (w:shadow) */
|
|
160
|
+
shadow?: boolean;
|
|
161
|
+
/** Right-to-left text (w:rtl) */
|
|
162
|
+
rtl?: boolean;
|
|
163
|
+
/** Complex script formatting (w:cs) */
|
|
164
|
+
cs?: boolean;
|
|
165
|
+
/** Character style ID (w:rStyle) */
|
|
114
166
|
styleId?: string;
|
|
115
167
|
};
|
|
116
168
|
/**
|
|
@@ -125,8 +177,11 @@ type TabLeader = "none" | "dot" | "hyphen" | "underscore" | "heavy" | "middleDot
|
|
|
125
177
|
* Tab stop definition
|
|
126
178
|
*/
|
|
127
179
|
type TabStop = {
|
|
128
|
-
/** Position in twips from left margin */
|
|
129
|
-
|
|
180
|
+
/** Position in twips from left margin */
|
|
181
|
+
position: number;
|
|
182
|
+
/** Alignment at tab stop */
|
|
183
|
+
alignment: TabStopAlignment;
|
|
184
|
+
/** Leader character */
|
|
130
185
|
leader?: TabLeader;
|
|
131
186
|
};
|
|
132
187
|
/**
|
|
@@ -145,22 +200,39 @@ type SpacingExplicit = {
|
|
|
145
200
|
after?: boolean;
|
|
146
201
|
};
|
|
147
202
|
type ParagraphFormatting = {
|
|
148
|
-
/** Paragraph alignment (w:jc) */
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
203
|
+
/** Paragraph alignment (w:jc) */
|
|
204
|
+
alignment?: ParagraphAlignment;
|
|
205
|
+
/** Text direction (w:bidi) */
|
|
206
|
+
bidi?: boolean;
|
|
207
|
+
/** Apply East Asian first/last-character line-breaking rules (w:kinsoku). */
|
|
208
|
+
kinsoku?: boolean;
|
|
209
|
+
/** Allow punctuation to hang beyond the text margin (w:overflowPunct). */
|
|
210
|
+
overflowPunctuation?: boolean;
|
|
211
|
+
/** Spacing before in twips (w:spacing/@w:before) */
|
|
212
|
+
spaceBefore?: number;
|
|
213
|
+
/** Spacing after in twips (w:spacing/@w:after) */
|
|
214
|
+
spaceAfter?: number;
|
|
215
|
+
/** Line spacing value (w:spacing/@w:line) */
|
|
216
|
+
lineSpacing?: number;
|
|
217
|
+
/** Line spacing rule (w:spacing/@w:lineRule) */
|
|
218
|
+
lineSpacingRule?: LineSpacingRule;
|
|
219
|
+
/** Whether the paragraph participates in the section document grid (w:snapToGrid). */
|
|
220
|
+
snapToGrid?: boolean;
|
|
221
|
+
/** Auto space before (w:spacing/@w:beforeAutospacing) */
|
|
222
|
+
beforeAutospacing?: boolean;
|
|
223
|
+
/** Auto space after (w:spacing/@w:afterAutospacing) */
|
|
224
|
+
afterAutospacing?: boolean;
|
|
225
|
+
/** Which spacing sides came from this paragraph's own pPr. */
|
|
226
|
+
spacingExplicit?: SpacingExplicit;
|
|
227
|
+
/** Left indent in twips (w:ind/@w:left) */
|
|
228
|
+
indentLeft?: number;
|
|
229
|
+
/** Right indent in twips (w:ind/@w:right) */
|
|
230
|
+
indentRight?: number;
|
|
231
|
+
/** First line indent in twips - positive for indent, negative for hanging (w:ind/@w:firstLine or @w:hanging) */
|
|
232
|
+
indentFirstLine?: number;
|
|
233
|
+
/** Whether first line is hanging indent */
|
|
234
|
+
hangingIndent?: boolean;
|
|
235
|
+
/** Paragraph borders (w:pBdr) */
|
|
164
236
|
borders?: {
|
|
165
237
|
top?: BorderSpec;
|
|
166
238
|
bottom?: BorderSpec;
|
|
@@ -168,16 +240,26 @@ type ParagraphFormatting = {
|
|
|
168
240
|
right?: BorderSpec;
|
|
169
241
|
between?: BorderSpec;
|
|
170
242
|
bar?: BorderSpec;
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
243
|
+
};
|
|
244
|
+
/** Paragraph shading (w:shd) */
|
|
245
|
+
shading?: ShadingProperties;
|
|
246
|
+
/** Custom tab stops (w:tabs) */
|
|
247
|
+
tabs?: TabStop[];
|
|
248
|
+
/** Keep with next paragraph (w:keepNext) */
|
|
249
|
+
keepNext?: boolean;
|
|
250
|
+
/** Keep lines together (w:keepLines) */
|
|
251
|
+
keepLines?: boolean;
|
|
252
|
+
/** Widow/orphan control (w:widowControl) */
|
|
253
|
+
widowControl?: boolean;
|
|
254
|
+
/** Page break before (w:pageBreakBefore) */
|
|
255
|
+
pageBreakBefore?: boolean;
|
|
256
|
+
/** Contextual spacing — suppress space between paragraphs of the same style (w:contextualSpacing) */
|
|
257
|
+
contextualSpacing?: boolean;
|
|
258
|
+
/** Numbering properties (w:numPr) */
|
|
179
259
|
numPr?: {
|
|
180
|
-
/** Numbering definition ID (w:numId) */
|
|
260
|
+
/** Numbering definition ID (w:numId) */
|
|
261
|
+
numId?: number;
|
|
262
|
+
/** List level (0-8) (w:ilvl) */
|
|
181
263
|
ilvl?: number;
|
|
182
264
|
};
|
|
183
265
|
/**
|
|
@@ -192,9 +274,12 @@ type ParagraphFormatting = {
|
|
|
192
274
|
numPrFromStyle?: {
|
|
193
275
|
numId?: number;
|
|
194
276
|
ilvl?: number;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
|
|
277
|
+
};
|
|
278
|
+
/** Outline level 0-9 (w:outlineLvl) */
|
|
279
|
+
outlineLevel?: number;
|
|
280
|
+
/** Paragraph style ID (w:pStyle) */
|
|
281
|
+
styleId?: string;
|
|
282
|
+
/** Text frame properties (w:framePr) */
|
|
198
283
|
frame?: {
|
|
199
284
|
dropCap?: "none" | "drop" | "margin";
|
|
200
285
|
lines?: number;
|
|
@@ -209,9 +294,12 @@ type ParagraphFormatting = {
|
|
|
209
294
|
xAlign?: "left" | "center" | "right" | "inside" | "outside";
|
|
210
295
|
yAlign?: "top" | "center" | "bottom" | "inside" | "outside" | "inline";
|
|
211
296
|
wrap?: "around" | "auto" | "none" | "notBeside" | "through" | "tight";
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
|
|
297
|
+
};
|
|
298
|
+
/** Suppress line numbers (w:suppressLineNumbers) */
|
|
299
|
+
suppressLineNumbers?: boolean;
|
|
300
|
+
/** Suppress auto hyphens (w:suppressAutoHyphens) */
|
|
301
|
+
suppressAutoHyphens?: boolean;
|
|
302
|
+
/** Run properties to apply to all runs (w:rPr) */
|
|
215
303
|
runProperties?: TextFormatting;
|
|
216
304
|
/**
|
|
217
305
|
* Run-in heading: this paragraph's mark carries `<w:specVanish/>`
|
|
@@ -227,7 +315,9 @@ type TableWidthType = "auto" | "dxa" | "nil" | "pct";
|
|
|
227
315
|
* Table measurement (width or height)
|
|
228
316
|
*/
|
|
229
317
|
type TableMeasurement = {
|
|
230
|
-
/** Value in twips (for dxa) or fifths of a percent (for pct) */
|
|
318
|
+
/** Value in twips (for dxa) or fifths of a percent (for pct) */
|
|
319
|
+
value: number;
|
|
320
|
+
/** Measurement type */
|
|
231
321
|
type: TableWidthType;
|
|
232
322
|
};
|
|
233
323
|
/**
|
|
@@ -273,12 +363,17 @@ type TableLook = {
|
|
|
273
363
|
* Floating table properties
|
|
274
364
|
*/
|
|
275
365
|
type FloatingTableProperties = {
|
|
276
|
-
/** Horizontal anchor */
|
|
277
|
-
|
|
366
|
+
/** Horizontal anchor */
|
|
367
|
+
horzAnchor?: "margin" | "page" | "text";
|
|
368
|
+
/** Vertical anchor */
|
|
369
|
+
vertAnchor?: "margin" | "page" | "text";
|
|
370
|
+
/** Horizontal position */
|
|
278
371
|
tblpX?: number;
|
|
279
|
-
tblpXSpec?: "left" | "center" | "right" | "inside" | "outside";
|
|
372
|
+
tblpXSpec?: "left" | "center" | "right" | "inside" | "outside";
|
|
373
|
+
/** Vertical position */
|
|
280
374
|
tblpY?: number;
|
|
281
|
-
tblpYSpec?: "top" | "center" | "bottom" | "inside" | "outside" | "inline";
|
|
375
|
+
tblpYSpec?: "top" | "center" | "bottom" | "inside" | "outside" | "inline";
|
|
376
|
+
/** Distance from surrounding text */
|
|
282
377
|
topFromText?: number;
|
|
283
378
|
bottomFromText?: number;
|
|
284
379
|
leftFromText?: number;
|
|
@@ -288,68 +383,116 @@ type FloatingTableProperties = {
|
|
|
288
383
|
* Table formatting properties (w:tblPr)
|
|
289
384
|
*/
|
|
290
385
|
type TableFormatting = {
|
|
291
|
-
/** Table width */
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
386
|
+
/** Table width */
|
|
387
|
+
width?: TableMeasurement;
|
|
388
|
+
/** Table justification */
|
|
389
|
+
justification?: "left" | "center" | "right";
|
|
390
|
+
/** Cell spacing */
|
|
391
|
+
cellSpacing?: TableMeasurement;
|
|
392
|
+
/** Table indent from left margin */
|
|
393
|
+
indent?: TableMeasurement;
|
|
394
|
+
/** Table borders */
|
|
395
|
+
borders?: TableBorders;
|
|
396
|
+
/** Default cell margins */
|
|
397
|
+
cellMargins?: CellMargins;
|
|
398
|
+
/** Table layout */
|
|
399
|
+
layout?: "fixed" | "autofit";
|
|
400
|
+
/** Table style ID */
|
|
401
|
+
styleId?: string;
|
|
402
|
+
/** Table look (conditional formatting flags) */
|
|
403
|
+
look?: TableLook;
|
|
404
|
+
/** Shading/background */
|
|
405
|
+
shading?: ShadingProperties;
|
|
406
|
+
/** Overlap for floating tables */
|
|
407
|
+
overlap?: "never" | "overlap";
|
|
408
|
+
/** Floating table properties */
|
|
409
|
+
floating?: FloatingTableProperties;
|
|
410
|
+
/** Right to left table */
|
|
303
411
|
bidi?: boolean;
|
|
304
412
|
};
|
|
305
413
|
/**
|
|
306
414
|
* Table row formatting properties (w:trPr)
|
|
307
415
|
*/
|
|
308
416
|
type TableRowFormatting = {
|
|
309
|
-
/** Number of table grid columns omitted before the first cell */
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
417
|
+
/** Number of table grid columns omitted before the first cell */
|
|
418
|
+
gridBefore?: number;
|
|
419
|
+
/** Preferred width of the omitted leading grid columns */
|
|
420
|
+
widthBefore?: TableMeasurement;
|
|
421
|
+
/** Number of table grid columns omitted after the last cell */
|
|
422
|
+
gridAfter?: number;
|
|
423
|
+
/** Preferred width of the omitted trailing grid columns */
|
|
424
|
+
widthAfter?: TableMeasurement;
|
|
425
|
+
/** Row height */
|
|
426
|
+
height?: TableMeasurement;
|
|
427
|
+
/** Height rule */
|
|
428
|
+
heightRule?: "auto" | "atLeast" | "exact";
|
|
429
|
+
/** Header row (repeats on each page) */
|
|
430
|
+
header?: boolean;
|
|
431
|
+
/** Allow row to break across pages */
|
|
432
|
+
cantSplit?: boolean;
|
|
433
|
+
/** Row justification */
|
|
434
|
+
justification?: "left" | "center" | "right";
|
|
435
|
+
/** Hidden row */
|
|
436
|
+
hidden?: boolean;
|
|
437
|
+
/** Conditional format style */
|
|
319
438
|
conditionalFormat?: ConditionalFormatStyle;
|
|
320
439
|
};
|
|
321
440
|
/**
|
|
322
441
|
* Conditional format style
|
|
323
442
|
*/
|
|
324
443
|
type ConditionalFormatStyle = {
|
|
325
|
-
/** First row */
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
444
|
+
/** First row */
|
|
445
|
+
firstRow?: boolean;
|
|
446
|
+
/** Last row */
|
|
447
|
+
lastRow?: boolean;
|
|
448
|
+
/** First column */
|
|
449
|
+
firstColumn?: boolean;
|
|
450
|
+
/** Last column */
|
|
451
|
+
lastColumn?: boolean;
|
|
452
|
+
/** Odd horizontal band */
|
|
453
|
+
oddHBand?: boolean;
|
|
454
|
+
/** Even horizontal band */
|
|
455
|
+
evenHBand?: boolean;
|
|
456
|
+
/** Odd vertical band */
|
|
457
|
+
oddVBand?: boolean;
|
|
458
|
+
/** Even vertical band */
|
|
459
|
+
evenVBand?: boolean;
|
|
460
|
+
/** Northwest corner */
|
|
461
|
+
nwCell?: boolean;
|
|
462
|
+
/** Northeast corner */
|
|
463
|
+
neCell?: boolean;
|
|
464
|
+
/** Southwest corner */
|
|
465
|
+
swCell?: boolean;
|
|
466
|
+
/** Southeast corner */
|
|
336
467
|
seCell?: boolean;
|
|
337
468
|
};
|
|
338
469
|
/**
|
|
339
470
|
* Table cell formatting properties (w:tcPr)
|
|
340
471
|
*/
|
|
341
472
|
type TableCellFormatting = {
|
|
342
|
-
/** Cell width */
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
473
|
+
/** Cell width */
|
|
474
|
+
width?: TableMeasurement;
|
|
475
|
+
/** Cell borders */
|
|
476
|
+
borders?: TableCellBorders;
|
|
477
|
+
/** Cell margins (override table default) */
|
|
478
|
+
margins?: CellMargins;
|
|
479
|
+
/** Cell shading/background */
|
|
480
|
+
shading?: ShadingProperties;
|
|
481
|
+
/** Vertical alignment */
|
|
482
|
+
verticalAlign?: "top" | "center" | "bottom";
|
|
483
|
+
/** Text direction */
|
|
484
|
+
textDirection?: "lr" | "lrV" | "rl" | "rlV" | "tb" | "tbV" | "tbRl" | "tbRlV" | "btLr";
|
|
485
|
+
/** Grid span (horizontal merge) */
|
|
486
|
+
gridSpan?: number;
|
|
487
|
+
/** Vertical merge */
|
|
488
|
+
vMerge?: "restart" | "continue";
|
|
489
|
+
/** Fit text to cell width */
|
|
490
|
+
fitText?: boolean;
|
|
491
|
+
/** Wrap text */
|
|
492
|
+
noWrap?: boolean;
|
|
493
|
+
/** Hide cell marker */
|
|
494
|
+
hideMark?: boolean;
|
|
495
|
+
/** Conditional format style */
|
|
353
496
|
conditionalFormat?: ConditionalFormatStyle;
|
|
354
497
|
};
|
|
355
498
|
//#endregion
|
|
@@ -366,16 +509,27 @@ type LevelSuffix = "tab" | "space" | "nothing";
|
|
|
366
509
|
* List level definition
|
|
367
510
|
*/
|
|
368
511
|
type ListLevel = {
|
|
369
|
-
/** Level index (0-8) */
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
512
|
+
/** Level index (0-8) */
|
|
513
|
+
ilvl: number;
|
|
514
|
+
/** Starting number */
|
|
515
|
+
start?: number;
|
|
516
|
+
/** Number format */
|
|
517
|
+
numFmt: NumberFormat;
|
|
518
|
+
/** Level text (e.g., "%1." or "•") */
|
|
519
|
+
lvlText: string;
|
|
520
|
+
/** Justification */
|
|
521
|
+
lvlJc?: "left" | "center" | "right";
|
|
522
|
+
/** Suffix after number */
|
|
523
|
+
suffix?: LevelSuffix;
|
|
524
|
+
/** Paragraph properties for this level */
|
|
525
|
+
pPr?: ParagraphFormatting;
|
|
526
|
+
/** Run properties for the number/bullet */
|
|
527
|
+
rPr?: TextFormatting;
|
|
528
|
+
/** Restart numbering from higher level */
|
|
529
|
+
lvlRestart?: number;
|
|
530
|
+
/** Is legal numbering style */
|
|
531
|
+
isLgl?: boolean;
|
|
532
|
+
/** Legacy settings */
|
|
379
533
|
legacy?: {
|
|
380
534
|
legacy?: boolean;
|
|
381
535
|
legacySpace?: number;
|
|
@@ -386,19 +540,28 @@ type ListLevel = {
|
|
|
386
540
|
* Abstract numbering definition (w:abstractNum)
|
|
387
541
|
*/
|
|
388
542
|
type AbstractNumbering = {
|
|
389
|
-
/** Abstract numbering ID */
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
543
|
+
/** Abstract numbering ID */
|
|
544
|
+
abstractNumId: number;
|
|
545
|
+
/** Multi-level type */
|
|
546
|
+
multiLevelType?: "hybridMultilevel" | "multilevel" | "singleLevel";
|
|
547
|
+
/** Numbering style link */
|
|
548
|
+
numStyleLink?: string;
|
|
549
|
+
/** Style link */
|
|
550
|
+
styleLink?: string;
|
|
551
|
+
/** Level definitions */
|
|
552
|
+
levels: ListLevel[];
|
|
553
|
+
/** Name */
|
|
394
554
|
name?: string;
|
|
395
555
|
};
|
|
396
556
|
/**
|
|
397
557
|
* Numbering instance (w:num)
|
|
398
558
|
*/
|
|
399
559
|
type NumberingInstance = {
|
|
400
|
-
/** Numbering ID (referenced by paragraphs) */
|
|
401
|
-
|
|
560
|
+
/** Numbering ID (referenced by paragraphs) */
|
|
561
|
+
numId: number;
|
|
562
|
+
/** Reference to abstract numbering */
|
|
563
|
+
abstractNumId: number;
|
|
564
|
+
/** Level overrides */
|
|
402
565
|
levelOverrides?: {
|
|
403
566
|
ilvl: number;
|
|
404
567
|
startOverride?: number;
|
|
@@ -409,16 +572,27 @@ type NumberingInstance = {
|
|
|
409
572
|
* Computed list rendering info
|
|
410
573
|
*/
|
|
411
574
|
type ListRendering = {
|
|
412
|
-
/** Computed marker text (e.g., "1.", "a)", "•") */
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
575
|
+
/** Computed marker text (e.g., "1.", "a)", "•") */
|
|
576
|
+
marker: string;
|
|
577
|
+
/** List level (0-8) */
|
|
578
|
+
level: number;
|
|
579
|
+
/** Numbering ID */
|
|
580
|
+
numId: number;
|
|
581
|
+
/** Whether this is a bullet or numbered list */
|
|
582
|
+
isBullet: boolean;
|
|
583
|
+
/** Whether this level uses legal numbering (parent placeholders render decimal). */
|
|
584
|
+
isLegal?: boolean;
|
|
585
|
+
/** Number format type (decimal, lowerRoman, upperRoman, etc.) */
|
|
586
|
+
numFmt?: NumberFormat;
|
|
587
|
+
/** Whether the list marker is hidden (w:vanish on level rPr) */
|
|
588
|
+
markerHidden?: boolean;
|
|
589
|
+
/** Marker font family from numbering level rPr (ascii name) */
|
|
590
|
+
markerFontFamily?: string;
|
|
591
|
+
/** Marker font size from numbering level rPr, in points */
|
|
592
|
+
markerFontSize?: number;
|
|
593
|
+
/** Marker bold state from numbering level rPr */
|
|
594
|
+
markerBold?: boolean;
|
|
595
|
+
/** Horizontal alignment of the marker around the paragraph's list anchor. */
|
|
422
596
|
markerAlignment?: "left" | "center" | "right";
|
|
423
597
|
/**
|
|
424
598
|
* `w:caps` on the numbering level rPr — the marker text renders in upper
|
|
@@ -431,9 +605,12 @@ type ListRendering = {
|
|
|
431
605
|
* `tab` (the OOXML default) grows the marker to the next tab stop; `space`
|
|
432
606
|
* adds one space glyph; `nothing` lets body text butt against the marker.
|
|
433
607
|
*/
|
|
434
|
-
markerSuffix?: LevelSuffix;
|
|
435
|
-
|
|
436
|
-
|
|
608
|
+
markerSuffix?: LevelSuffix;
|
|
609
|
+
/** Number format for each level from 0 through this paragraph's level. */
|
|
610
|
+
levelNumFmts?: NumberFormat[];
|
|
611
|
+
/** Abstract numbering definition shared by one or more numIds. */
|
|
612
|
+
abstractNumId?: number;
|
|
613
|
+
/** Start override for this numId/level, if the numbering instance defines one. */
|
|
437
614
|
startOverride?: number;
|
|
438
615
|
/**
|
|
439
616
|
* Number of inline `LISTNUM` (default-list) fields the paragraph contains.
|
|
@@ -455,7 +632,9 @@ type ListRendering = {
|
|
|
455
632
|
* Complete numbering definitions
|
|
456
633
|
*/
|
|
457
634
|
type NumberingDefinitions = {
|
|
458
|
-
/** Abstract numbering definitions */
|
|
635
|
+
/** Abstract numbering definitions */
|
|
636
|
+
abstractNums: AbstractNumbering[];
|
|
637
|
+
/** Numbering instances */
|
|
459
638
|
nums: NumberingInstance[];
|
|
460
639
|
};
|
|
461
640
|
//#endregion
|
|
@@ -464,46 +643,63 @@ type NumberingDefinitions = {
|
|
|
464
643
|
* Plain text content
|
|
465
644
|
*/
|
|
466
645
|
type TextContent = {
|
|
467
|
-
type: "text";
|
|
468
|
-
|
|
646
|
+
type: "text";
|
|
647
|
+
/** The text string */
|
|
648
|
+
text: string;
|
|
649
|
+
/** Preserve whitespace (xml:space="preserve") */
|
|
469
650
|
preserveSpace?: boolean;
|
|
470
651
|
};
|
|
471
652
|
/**
|
|
472
653
|
* Tab character
|
|
473
654
|
*/
|
|
655
|
+
type PositionalTab = {
|
|
656
|
+
relativeTo?: "margin" | "indent";
|
|
657
|
+
alignment?: "left" | "center" | "right";
|
|
658
|
+
leader?: "none" | "dot" | "hyphen" | "underscore" | "middleDot";
|
|
659
|
+
};
|
|
474
660
|
type TabContent = {
|
|
475
661
|
type: "tab";
|
|
662
|
+
/** Word positional-tab properties (`w:ptab`); absent for a regular `w:tab`. */
|
|
663
|
+
positional?: PositionalTab;
|
|
476
664
|
};
|
|
477
665
|
/**
|
|
478
666
|
* Line break
|
|
479
667
|
*/
|
|
480
668
|
type BreakContent = {
|
|
481
|
-
type: "break";
|
|
482
|
-
|
|
669
|
+
type: "break";
|
|
670
|
+
/** Break type */
|
|
671
|
+
breakType?: "page" | "column" | "textWrapping";
|
|
672
|
+
/** Clear type for text wrapping break */
|
|
483
673
|
clear?: "none" | "left" | "right" | "all";
|
|
484
674
|
};
|
|
485
675
|
/**
|
|
486
676
|
* Symbol character (special font character)
|
|
487
677
|
*/
|
|
488
678
|
type SymbolContent = {
|
|
489
|
-
type: "symbol";
|
|
490
|
-
|
|
679
|
+
type: "symbol";
|
|
680
|
+
/** Font name */
|
|
681
|
+
font: string;
|
|
682
|
+
/** Character code */
|
|
491
683
|
char: string;
|
|
492
684
|
};
|
|
493
685
|
/**
|
|
494
686
|
* Footnote or endnote reference
|
|
495
687
|
*/
|
|
496
688
|
type NoteReferenceContent = {
|
|
497
|
-
type: "footnoteRef" | "endnoteRef";
|
|
689
|
+
type: "footnoteRef" | "endnoteRef";
|
|
690
|
+
/** Note ID */
|
|
498
691
|
id: number;
|
|
499
692
|
};
|
|
500
693
|
/**
|
|
501
694
|
* Field character (begin/separate/end)
|
|
502
695
|
*/
|
|
503
696
|
type FieldCharContent = {
|
|
504
|
-
type: "fieldChar";
|
|
505
|
-
|
|
506
|
-
|
|
697
|
+
type: "fieldChar";
|
|
698
|
+
/** Field character type */
|
|
699
|
+
charType: "begin" | "separate" | "end";
|
|
700
|
+
/** Field is locked */
|
|
701
|
+
fldLock?: boolean;
|
|
702
|
+
/** Field is dirty (needs update) */
|
|
507
703
|
dirty?: boolean;
|
|
508
704
|
/**
|
|
509
705
|
* Cached display value from a child `<w:numberingChange w:original="…"/>`.
|
|
@@ -518,7 +714,8 @@ type FieldCharContent = {
|
|
|
518
714
|
* Field instruction text
|
|
519
715
|
*/
|
|
520
716
|
type InstrTextContent = {
|
|
521
|
-
type: "instrText";
|
|
717
|
+
type: "instrText";
|
|
718
|
+
/** Field instruction */
|
|
522
719
|
text: string;
|
|
523
720
|
};
|
|
524
721
|
/**
|
|
@@ -541,15 +738,18 @@ type RenderedPageBreakContent = {
|
|
|
541
738
|
* Drawing/image reference
|
|
542
739
|
*/
|
|
543
740
|
type DrawingContent = {
|
|
544
|
-
type: "drawing";
|
|
545
|
-
|
|
741
|
+
type: "drawing";
|
|
742
|
+
/** Image data */
|
|
743
|
+
image: Image;
|
|
744
|
+
/** Original OOXML for package-preserving round-trips of unsupported drawing markup. */
|
|
546
745
|
rawXml?: string;
|
|
547
746
|
};
|
|
548
747
|
/**
|
|
549
748
|
* Shape reference
|
|
550
749
|
*/
|
|
551
750
|
type ShapeContent = {
|
|
552
|
-
type: "shape";
|
|
751
|
+
type: "shape";
|
|
752
|
+
/** Shape data */
|
|
553
753
|
shape: Shape;
|
|
554
754
|
};
|
|
555
755
|
/**
|
|
@@ -560,32 +760,46 @@ type RunContent = TextContent | TabContent | BreakContent | SymbolContent | Note
|
|
|
560
760
|
* A run is a contiguous region of text with the same formatting
|
|
561
761
|
*/
|
|
562
762
|
type Run = {
|
|
563
|
-
type: "run";
|
|
564
|
-
|
|
565
|
-
|
|
763
|
+
type: "run";
|
|
764
|
+
/** Text formatting properties */
|
|
765
|
+
formatting?: TextFormatting;
|
|
766
|
+
/** Run-level tracked property changes (w:rPrChange) */
|
|
767
|
+
propertyChanges?: RunPropertyChange[];
|
|
768
|
+
/** Run content (text, tabs, breaks, etc.) */
|
|
566
769
|
content: RunContent[];
|
|
567
770
|
};
|
|
568
771
|
/**
|
|
569
772
|
* Hyperlink (w:hyperlink)
|
|
570
773
|
*/
|
|
571
774
|
type Hyperlink = {
|
|
572
|
-
type: "hyperlink";
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
775
|
+
type: "hyperlink";
|
|
776
|
+
/** Relationship ID for external link */
|
|
777
|
+
rId?: string;
|
|
778
|
+
/** Resolved URL (from relationships) */
|
|
779
|
+
href?: string;
|
|
780
|
+
/** Internal bookmark anchor */
|
|
781
|
+
anchor?: string;
|
|
782
|
+
/** Tooltip text */
|
|
783
|
+
tooltip?: string;
|
|
784
|
+
/** Target frame */
|
|
785
|
+
target?: string;
|
|
786
|
+
/** Link history tracking */
|
|
787
|
+
history?: boolean;
|
|
788
|
+
/** Document location */
|
|
789
|
+
docLocation?: string;
|
|
790
|
+
/** Child runs */
|
|
580
791
|
children: (Run | BookmarkStart | BookmarkEnd)[];
|
|
581
792
|
};
|
|
582
793
|
/**
|
|
583
794
|
* Bookmark start marker (w:bookmarkStart)
|
|
584
795
|
*/
|
|
585
796
|
type BookmarkStart = {
|
|
586
|
-
type: "bookmarkStart";
|
|
587
|
-
|
|
588
|
-
|
|
797
|
+
type: "bookmarkStart";
|
|
798
|
+
/** Bookmark ID */
|
|
799
|
+
id: number;
|
|
800
|
+
/** Bookmark name */
|
|
801
|
+
name: string;
|
|
802
|
+
/** Column index for table bookmarks */
|
|
589
803
|
colFirst?: number;
|
|
590
804
|
colLast?: number;
|
|
591
805
|
};
|
|
@@ -593,7 +807,8 @@ type BookmarkStart = {
|
|
|
593
807
|
* Bookmark end marker (w:bookmarkEnd)
|
|
594
808
|
*/
|
|
595
809
|
type BookmarkEnd = {
|
|
596
|
-
type: "bookmarkEnd";
|
|
810
|
+
type: "bookmarkEnd";
|
|
811
|
+
/** Bookmark ID */
|
|
597
812
|
id: number;
|
|
598
813
|
};
|
|
599
814
|
/**
|
|
@@ -604,21 +819,30 @@ type FieldType = "PAGE" | "NUMPAGES" | "NUMWORDS" | "NUMCHARS" | "DATE" | "TIME"
|
|
|
604
819
|
* Simple field (w:fldSimple)
|
|
605
820
|
*/
|
|
606
821
|
type SimpleField = {
|
|
607
|
-
type: "simpleField";
|
|
608
|
-
instruction
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
822
|
+
type: "simpleField";
|
|
823
|
+
/** Field instruction (e.g., "PAGE \\* MERGEFORMAT") */
|
|
824
|
+
instruction: string;
|
|
825
|
+
/** Parsed field type */
|
|
826
|
+
fieldType: FieldType;
|
|
827
|
+
/** Current display value */
|
|
828
|
+
content: (Run | Hyperlink)[];
|
|
829
|
+
/** Field is locked */
|
|
830
|
+
fldLock?: boolean;
|
|
831
|
+
/** Field is dirty */
|
|
612
832
|
dirty?: boolean;
|
|
613
833
|
};
|
|
614
834
|
/**
|
|
615
835
|
* Complex field (w:fldChar begin/separate/end with w:instrText)
|
|
616
836
|
*/
|
|
617
837
|
type ComplexField = {
|
|
618
|
-
type: "complexField";
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
838
|
+
type: "complexField";
|
|
839
|
+
/** Field instruction */
|
|
840
|
+
instruction: string;
|
|
841
|
+
/** Parsed field type */
|
|
842
|
+
fieldType: FieldType;
|
|
843
|
+
/** Field code runs */
|
|
844
|
+
fieldCode: Run[];
|
|
845
|
+
/** Display result runs */
|
|
622
846
|
fieldResult: Run[];
|
|
623
847
|
/**
|
|
624
848
|
* Run formatting captured from the field's structural run(s) (`w:rPr` on the
|
|
@@ -626,8 +850,10 @@ type ComplexField = {
|
|
|
626
850
|
* no separate result run to read it from, e.g. a footer `PAGE` number whose
|
|
627
851
|
* formatting lives on the field run (eigenpal/docx-editor#909).
|
|
628
852
|
*/
|
|
629
|
-
formatting?: TextFormatting;
|
|
630
|
-
|
|
853
|
+
formatting?: TextFormatting;
|
|
854
|
+
/** Field is locked */
|
|
855
|
+
fldLock?: boolean;
|
|
856
|
+
/** Field is dirty */
|
|
631
857
|
dirty?: boolean;
|
|
632
858
|
};
|
|
633
859
|
type Field = SimpleField | ComplexField;
|
|
@@ -635,15 +861,19 @@ type Field = SimpleField | ComplexField;
|
|
|
635
861
|
* Image size specification
|
|
636
862
|
*/
|
|
637
863
|
type ImageSize = {
|
|
638
|
-
/** Width in EMUs (English Metric Units) */
|
|
864
|
+
/** Width in EMUs (English Metric Units) */
|
|
865
|
+
width: number;
|
|
866
|
+
/** Height in EMUs */
|
|
639
867
|
height: number;
|
|
640
868
|
};
|
|
641
869
|
/**
|
|
642
870
|
* Image wrap type for floating images
|
|
643
871
|
*/
|
|
644
872
|
type ImageWrap = {
|
|
645
|
-
type: "inline" | "square" | "tight" | "through" | "topAndBottom" | "behind" | "inFront";
|
|
646
|
-
|
|
873
|
+
type: "inline" | "square" | "tight" | "through" | "topAndBottom" | "behind" | "inFront";
|
|
874
|
+
/** Wrap text direction */
|
|
875
|
+
wrapText?: "bothSides" | "left" | "right" | "largest";
|
|
876
|
+
/** Distance from text */
|
|
647
877
|
distT?: number;
|
|
648
878
|
distB?: number;
|
|
649
879
|
distL?: number;
|
|
@@ -653,11 +883,13 @@ type ImageWrap = {
|
|
|
653
883
|
* Position for floating images
|
|
654
884
|
*/
|
|
655
885
|
type ImagePosition = {
|
|
656
|
-
/** Horizontal positioning */
|
|
886
|
+
/** Horizontal positioning */
|
|
887
|
+
horizontal: {
|
|
657
888
|
relativeTo: "character" | "column" | "insideMargin" | "leftMargin" | "margin" | "outsideMargin" | "page" | "rightMargin";
|
|
658
889
|
alignment?: "left" | "right" | "center" | "inside" | "outside";
|
|
659
890
|
posOffset?: number;
|
|
660
|
-
};
|
|
891
|
+
};
|
|
892
|
+
/** Vertical positioning */
|
|
661
893
|
vertical: {
|
|
662
894
|
relativeTo: "insideMargin" | "line" | "margin" | "outsideMargin" | "page" | "paragraph" | "topMargin" | "bottomMargin";
|
|
663
895
|
alignment?: "top" | "bottom" | "center" | "inside" | "outside";
|
|
@@ -668,8 +900,11 @@ type ImagePosition = {
|
|
|
668
900
|
* Image transformation
|
|
669
901
|
*/
|
|
670
902
|
type ImageTransform = {
|
|
671
|
-
/** Rotation in degrees */
|
|
672
|
-
|
|
903
|
+
/** Rotation in degrees */
|
|
904
|
+
rotation?: number;
|
|
905
|
+
/** Flip horizontal */
|
|
906
|
+
flipH?: boolean;
|
|
907
|
+
/** Flip vertical */
|
|
673
908
|
flipV?: boolean;
|
|
674
909
|
};
|
|
675
910
|
/**
|
|
@@ -698,20 +933,36 @@ type ImageCrop = {
|
|
|
698
933
|
* Embedded image (w:drawing)
|
|
699
934
|
*/
|
|
700
935
|
type Image = {
|
|
701
|
-
type: "image";
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
936
|
+
type: "image";
|
|
937
|
+
/** Unique ID */
|
|
938
|
+
id?: string;
|
|
939
|
+
/** Relationship ID for the image data */
|
|
940
|
+
rId: string;
|
|
941
|
+
/** Resolved image data (base64 or blob URL) */
|
|
942
|
+
src?: string;
|
|
943
|
+
/** Image MIME type */
|
|
944
|
+
mimeType?: string;
|
|
945
|
+
/** Original filename */
|
|
946
|
+
filename?: string;
|
|
947
|
+
/** Authored non-visual drawing name (`wp:docPr@name`) */
|
|
948
|
+
docPrName?: string;
|
|
949
|
+
/** Alt text for accessibility */
|
|
950
|
+
alt?: string;
|
|
951
|
+
/** Authored non-visual drawing title (`wp:docPr@title`) */
|
|
952
|
+
title?: string;
|
|
953
|
+
/** Image size */
|
|
954
|
+
size: ImageSize;
|
|
955
|
+
/** Original size before any transforms */
|
|
956
|
+
originalSize?: ImageSize;
|
|
957
|
+
/** Wrap settings */
|
|
958
|
+
wrap: ImageWrap;
|
|
959
|
+
/** Position for floating images */
|
|
960
|
+
position?: ImagePosition;
|
|
961
|
+
/** Image transformations */
|
|
962
|
+
transform?: ImageTransform;
|
|
963
|
+
/** Padding around image */
|
|
964
|
+
padding?: ImagePadding;
|
|
965
|
+
/** Source-bitmap crop (wp:srcRect), eigenpal #424 */
|
|
715
966
|
crop?: ImageCrop;
|
|
716
967
|
/**
|
|
717
968
|
* Opacity in [0, 1] (OOXML `a:alphaModFix amt`). Undefined or `1` means
|
|
@@ -731,10 +982,16 @@ type Image = {
|
|
|
731
982
|
* don't currently reposition, but we round-trip the flag so saving
|
|
732
983
|
* preserves the author's intent; undefined means "use the spec default".
|
|
733
984
|
*/
|
|
734
|
-
allowOverlap?: boolean;
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
985
|
+
allowOverlap?: boolean;
|
|
986
|
+
/** Whether this is a decorative image */
|
|
987
|
+
decorative?: boolean;
|
|
988
|
+
/** Hyperlink URL for clickable image */
|
|
989
|
+
hlinkHref?: string;
|
|
990
|
+
/** Relationship ID for the clickable image hyperlink */
|
|
991
|
+
hlinkRId?: string;
|
|
992
|
+
/** Image outline/border */
|
|
993
|
+
outline?: ShapeOutline;
|
|
994
|
+
/** Image effects */
|
|
738
995
|
effects?: {
|
|
739
996
|
brightness?: number;
|
|
740
997
|
contrast?: number;
|
|
@@ -749,8 +1006,15 @@ type ShapeType = "rect" | "roundRect" | "ellipse" | "triangle" | "rtTriangle" |
|
|
|
749
1006
|
* Shape fill type
|
|
750
1007
|
*/
|
|
751
1008
|
type ShapeFill = {
|
|
752
|
-
type: "none" | "solid" | "gradient" | "pattern" | "picture";
|
|
753
|
-
|
|
1009
|
+
type: "none" | "solid" | "gradient" | "pattern" | "picture";
|
|
1010
|
+
/**
|
|
1011
|
+
* Authored DrawingML retained when the normalized projection is incomplete.
|
|
1012
|
+
* Serializers prefer this value; omit it when modifying the fill.
|
|
1013
|
+
*/
|
|
1014
|
+
rawXml?: string;
|
|
1015
|
+
/** Solid fill color */
|
|
1016
|
+
color?: ColorValue;
|
|
1017
|
+
/** Gradient stops for gradient fill */
|
|
754
1018
|
gradient?: {
|
|
755
1019
|
type: "linear" | "radial" | "rectangular" | "path";
|
|
756
1020
|
angle?: number;
|
|
@@ -764,16 +1028,28 @@ type ShapeFill = {
|
|
|
764
1028
|
* Shape outline/stroke
|
|
765
1029
|
*/
|
|
766
1030
|
type ShapeOutline = {
|
|
767
|
-
/**
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
1031
|
+
/**
|
|
1032
|
+
* Authored DrawingML retained for lossless round-trips. Serializers prefer
|
|
1033
|
+
* this value; callers modifying structured outline fields must omit it.
|
|
1034
|
+
*/
|
|
1035
|
+
rawXml?: string;
|
|
1036
|
+
/** Line width in EMUs */
|
|
1037
|
+
width?: number;
|
|
1038
|
+
/** Line color */
|
|
1039
|
+
color?: ColorValue;
|
|
1040
|
+
/** Line style */
|
|
1041
|
+
style?: "solid" | "dot" | "dash" | "lgDash" | "dashDot" | "lgDashDot" | "lgDashDotDot" | "sysDot" | "sysDash" | "sysDashDot" | "sysDashDotDot";
|
|
1042
|
+
/** Line cap */
|
|
1043
|
+
cap?: "flat" | "round" | "square";
|
|
1044
|
+
/** Line join */
|
|
1045
|
+
join?: "bevel" | "miter" | "round";
|
|
1046
|
+
/** Head arrow */
|
|
772
1047
|
headEnd?: {
|
|
773
1048
|
type: "none" | "triangle" | "stealth" | "diamond" | "oval" | "arrow";
|
|
774
1049
|
width?: "sm" | "med" | "lg";
|
|
775
1050
|
length?: "sm" | "med" | "lg";
|
|
776
|
-
};
|
|
1051
|
+
};
|
|
1052
|
+
/** Tail arrow */
|
|
777
1053
|
tailEnd?: {
|
|
778
1054
|
type: "none" | "triangle" | "stealth" | "diamond" | "oval" | "arrow";
|
|
779
1055
|
width?: "sm" | "med" | "lg";
|
|
@@ -784,49 +1060,76 @@ type ShapeOutline = {
|
|
|
784
1060
|
* Text body inside a shape
|
|
785
1061
|
*/
|
|
786
1062
|
type ShapeTextBody = {
|
|
787
|
-
/** Text direction */
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
1063
|
+
/** Text direction */
|
|
1064
|
+
vertical?: boolean;
|
|
1065
|
+
/** Rotation */
|
|
1066
|
+
rotation?: number;
|
|
1067
|
+
/** Anchor/vertical alignment */
|
|
1068
|
+
anchor?: "top" | "middle" | "bottom" | "distributed" | "justified";
|
|
1069
|
+
/** Anchor center */
|
|
1070
|
+
anchorCenter?: boolean;
|
|
1071
|
+
/** Auto fit */
|
|
1072
|
+
autoFit?: "none" | "normal" | "shape";
|
|
1073
|
+
/** Text margins */
|
|
792
1074
|
margins?: {
|
|
793
1075
|
top?: number;
|
|
794
1076
|
bottom?: number;
|
|
795
1077
|
left?: number;
|
|
796
1078
|
right?: number;
|
|
797
|
-
};
|
|
1079
|
+
};
|
|
1080
|
+
/** Block content inside the shape */
|
|
798
1081
|
content: (Paragraph | Table)[];
|
|
799
1082
|
};
|
|
800
1083
|
/**
|
|
801
1084
|
* Shape/drawing object (wps:wsp)
|
|
802
1085
|
*/
|
|
803
1086
|
type Shape = {
|
|
804
|
-
type: "shape";
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
1087
|
+
type: "shape";
|
|
1088
|
+
/** Shape type preset */
|
|
1089
|
+
shapeType: ShapeType;
|
|
1090
|
+
/** Unique ID */
|
|
1091
|
+
id?: string;
|
|
1092
|
+
/** Name */
|
|
1093
|
+
name?: string;
|
|
1094
|
+
/** Size in EMUs */
|
|
1095
|
+
size: ImageSize;
|
|
1096
|
+
/** Position for floating shapes */
|
|
1097
|
+
position?: ImagePosition;
|
|
1098
|
+
/** Wrap settings */
|
|
1099
|
+
wrap?: ImageWrap;
|
|
1100
|
+
/** Fill */
|
|
1101
|
+
fill?: ShapeFill;
|
|
1102
|
+
/** Outline/stroke */
|
|
1103
|
+
outline?: ShapeOutline;
|
|
1104
|
+
/** Transform */
|
|
1105
|
+
transform?: ImageTransform;
|
|
1106
|
+
/** Text content inside the shape */
|
|
1107
|
+
textBody?: ShapeTextBody;
|
|
1108
|
+
/** Custom geometry points */
|
|
815
1109
|
customGeometry?: string;
|
|
816
1110
|
};
|
|
817
1111
|
/**
|
|
818
1112
|
* Text box (floating text container)
|
|
819
1113
|
*/
|
|
820
1114
|
type TextBox = {
|
|
821
|
-
type: "textBox";
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
1115
|
+
type: "textBox";
|
|
1116
|
+
/** Unique ID */
|
|
1117
|
+
id?: string;
|
|
1118
|
+
/** Size */
|
|
1119
|
+
size: ImageSize;
|
|
1120
|
+
/** Position */
|
|
1121
|
+
position?: ImagePosition;
|
|
1122
|
+
/** Wrap settings */
|
|
1123
|
+
wrap?: ImageWrap;
|
|
1124
|
+
/** Fill */
|
|
1125
|
+
fill?: ShapeFill;
|
|
1126
|
+
/** Outline */
|
|
1127
|
+
outline?: ShapeOutline;
|
|
1128
|
+
/** Text and table content */
|
|
1129
|
+
content: (Paragraph | Table)[];
|
|
1130
|
+
/** Text fitting behavior */
|
|
1131
|
+
autoFit?: ShapeTextBody["autoFit"];
|
|
1132
|
+
/** Internal margins */
|
|
830
1133
|
margins?: {
|
|
831
1134
|
top?: number;
|
|
832
1135
|
bottom?: number;
|
|
@@ -838,42 +1141,63 @@ type TextBox = {
|
|
|
838
1141
|
* Table cell
|
|
839
1142
|
*/
|
|
840
1143
|
type TableCell = {
|
|
841
|
-
type: "tableCell";
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
1144
|
+
type: "tableCell";
|
|
1145
|
+
/** Cell formatting */
|
|
1146
|
+
formatting?: TableCellFormatting;
|
|
1147
|
+
/** Cell-level tracked property changes (w:tcPrChange) */
|
|
1148
|
+
propertyChanges?: TableCellPropertyChange[];
|
|
1149
|
+
/** Tracked structural changes (cell insert/delete/merge) */
|
|
1150
|
+
structuralChange?: TableStructuralChangeInfo;
|
|
1151
|
+
/** Cell content (paragraphs, tables, etc.) */
|
|
845
1152
|
content: (Paragraph | Table)[];
|
|
846
1153
|
};
|
|
847
1154
|
/**
|
|
848
1155
|
* Table row
|
|
849
1156
|
*/
|
|
850
1157
|
type TableRow = {
|
|
851
|
-
type: "tableRow";
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
1158
|
+
type: "tableRow";
|
|
1159
|
+
/** Row formatting */
|
|
1160
|
+
formatting?: TableRowFormatting;
|
|
1161
|
+
/** Row-level tracked property changes (w:trPrChange) */
|
|
1162
|
+
propertyChanges?: TableRowPropertyChange[];
|
|
1163
|
+
/** Tracked structural changes (row insert/delete) */
|
|
1164
|
+
structuralChange?: TableStructuralChangeInfo;
|
|
1165
|
+
/** Cells in this row */
|
|
855
1166
|
cells: TableCell[];
|
|
856
1167
|
};
|
|
857
1168
|
/**
|
|
858
1169
|
* Table (w:tbl)
|
|
859
1170
|
*/
|
|
860
1171
|
type Table = {
|
|
861
|
-
type: "table";
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
1172
|
+
type: "table";
|
|
1173
|
+
/** Table formatting */
|
|
1174
|
+
formatting?: TableFormatting;
|
|
1175
|
+
/** Table-level tracked property changes (w:tblPrChange) */
|
|
1176
|
+
propertyChanges?: TablePropertyChange[];
|
|
1177
|
+
/** Column widths in twips */
|
|
1178
|
+
columnWidths?: number[];
|
|
1179
|
+
/** Table rows */
|
|
865
1180
|
rows: TableRow[];
|
|
866
1181
|
};
|
|
867
1182
|
/**
|
|
868
1183
|
* A comment (w:comment) from comments.xml
|
|
869
1184
|
*/
|
|
870
1185
|
type Comment = {
|
|
871
|
-
/** Comment ID (matches commentRangeStart/End) */
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
1186
|
+
/** Comment ID (matches commentRangeStart/End) */
|
|
1187
|
+
id: number;
|
|
1188
|
+
/** Author name */
|
|
1189
|
+
author: string;
|
|
1190
|
+
/** Author initials */
|
|
1191
|
+
initials?: string;
|
|
1192
|
+
/** Date */
|
|
1193
|
+
date?: string;
|
|
1194
|
+
/** Comment content (paragraphs) */
|
|
1195
|
+
content: Paragraph[];
|
|
1196
|
+
/** Formatting of the structural annotation-reference run in the first paragraph */
|
|
1197
|
+
annotationReferenceFormatting?: TextFormatting;
|
|
1198
|
+
/** Parent comment ID (for replies) */
|
|
1199
|
+
parentId?: number;
|
|
1200
|
+
/** Whether the comment is resolved/done */
|
|
877
1201
|
done?: boolean;
|
|
878
1202
|
};
|
|
879
1203
|
/**
|
|
@@ -902,9 +1226,12 @@ type CommentReference = {
|
|
|
902
1226
|
* Math equation content (m:oMath or m:oMathPara)
|
|
903
1227
|
*/
|
|
904
1228
|
type MathEquation = {
|
|
905
|
-
type: "mathEquation";
|
|
906
|
-
|
|
907
|
-
|
|
1229
|
+
type: "mathEquation";
|
|
1230
|
+
/** Whether this is a block (oMathPara) or inline (oMath) equation */
|
|
1231
|
+
display: "inline" | "block";
|
|
1232
|
+
/** Raw OMML XML for round-trip preservation */
|
|
1233
|
+
ommlXml: string;
|
|
1234
|
+
/** Plain text representation for accessibility/fallback */
|
|
908
1235
|
plainText?: string;
|
|
909
1236
|
};
|
|
910
1237
|
/**
|
|
@@ -931,8 +1258,11 @@ declare function normalizeRevisionId(id: number): number;
|
|
|
931
1258
|
* Tracked change metadata (w:ins, w:del attributes)
|
|
932
1259
|
*/
|
|
933
1260
|
type TrackedChangeInfo = {
|
|
934
|
-
/** Revision ID */
|
|
935
|
-
|
|
1261
|
+
/** Revision ID */
|
|
1262
|
+
id: number;
|
|
1263
|
+
/** Author who made the change */
|
|
1264
|
+
author: string;
|
|
1265
|
+
/** Date of the change */
|
|
936
1266
|
date?: string;
|
|
937
1267
|
/**
|
|
938
1268
|
* Author initials (w:initials). Optional attribution used by the review UI
|
|
@@ -944,38 +1274,47 @@ type TrackedChangeInfo = {
|
|
|
944
1274
|
* Generic tracked property-change wrapper metadata (w:*PrChange)
|
|
945
1275
|
*/
|
|
946
1276
|
type PropertyChangeInfo = {
|
|
947
|
-
/** Optional revision session ID */
|
|
1277
|
+
/** Optional revision session ID */
|
|
1278
|
+
rsid?: string;
|
|
948
1279
|
} & TrackedChangeInfo;
|
|
949
1280
|
/**
|
|
950
1281
|
* Insertion wrapper (w:ins) — runs inserted by tracked changes
|
|
951
1282
|
*/
|
|
952
1283
|
type Insertion = {
|
|
953
|
-
type: "insertion";
|
|
954
|
-
|
|
1284
|
+
type: "insertion";
|
|
1285
|
+
/** Tracked change metadata */
|
|
1286
|
+
info: TrackedChangeInfo;
|
|
1287
|
+
/** Inserted content */
|
|
955
1288
|
content: (Run | Hyperlink)[];
|
|
956
1289
|
};
|
|
957
1290
|
/**
|
|
958
1291
|
* Deletion wrapper (w:del) — runs deleted by tracked changes
|
|
959
1292
|
*/
|
|
960
1293
|
type Deletion = {
|
|
961
|
-
type: "deletion";
|
|
962
|
-
|
|
1294
|
+
type: "deletion";
|
|
1295
|
+
/** Tracked change metadata */
|
|
1296
|
+
info: TrackedChangeInfo;
|
|
1297
|
+
/** Deleted content */
|
|
963
1298
|
content: (Run | Hyperlink)[];
|
|
964
1299
|
};
|
|
965
1300
|
/**
|
|
966
1301
|
* Move-from wrapper (w:moveFrom) — content moved away from this position
|
|
967
1302
|
*/
|
|
968
1303
|
type MoveFrom = {
|
|
969
|
-
type: "moveFrom";
|
|
970
|
-
|
|
1304
|
+
type: "moveFrom";
|
|
1305
|
+
/** Tracked change metadata */
|
|
1306
|
+
info: TrackedChangeInfo;
|
|
1307
|
+
/** Moved content */
|
|
971
1308
|
content: (Run | Hyperlink)[];
|
|
972
1309
|
};
|
|
973
1310
|
/**
|
|
974
1311
|
* Move-to wrapper (w:moveTo) — content moved into this position
|
|
975
1312
|
*/
|
|
976
1313
|
type MoveTo = {
|
|
977
|
-
type: "moveTo";
|
|
978
|
-
|
|
1314
|
+
type: "moveTo";
|
|
1315
|
+
/** Tracked change metadata */
|
|
1316
|
+
info: TrackedChangeInfo;
|
|
1317
|
+
/** Moved content */
|
|
979
1318
|
content: (Run | Hyperlink)[];
|
|
980
1319
|
};
|
|
981
1320
|
/**
|
|
@@ -1018,66 +1357,88 @@ type TrackedRunChange = Insertion | Deletion | MoveFrom | MoveTo;
|
|
|
1018
1357
|
* Run property change (w:rPrChange)
|
|
1019
1358
|
*/
|
|
1020
1359
|
type RunPropertyChange = {
|
|
1021
|
-
type: "runPropertyChange";
|
|
1022
|
-
|
|
1023
|
-
|
|
1360
|
+
type: "runPropertyChange";
|
|
1361
|
+
/** Tracked change metadata */
|
|
1362
|
+
info: PropertyChangeInfo;
|
|
1363
|
+
/** Run properties before the tracked change */
|
|
1364
|
+
previousFormatting?: TextFormatting;
|
|
1365
|
+
/** Run properties after the tracked change (editor model convenience) */
|
|
1024
1366
|
currentFormatting?: TextFormatting;
|
|
1025
1367
|
};
|
|
1026
1368
|
/**
|
|
1027
1369
|
* Paragraph property change (w:pPrChange)
|
|
1028
1370
|
*/
|
|
1029
1371
|
type ParagraphPropertyChange = {
|
|
1030
|
-
type: "paragraphPropertyChange";
|
|
1031
|
-
|
|
1032
|
-
|
|
1372
|
+
type: "paragraphPropertyChange";
|
|
1373
|
+
/** Tracked change metadata */
|
|
1374
|
+
info: PropertyChangeInfo;
|
|
1375
|
+
/** Paragraph properties before the tracked change */
|
|
1376
|
+
previousFormatting?: ParagraphFormatting;
|
|
1377
|
+
/** Paragraph properties after the tracked change (editor model convenience) */
|
|
1033
1378
|
currentFormatting?: ParagraphFormatting;
|
|
1034
1379
|
};
|
|
1035
1380
|
/**
|
|
1036
1381
|
* Table property change (w:tblPrChange)
|
|
1037
1382
|
*/
|
|
1038
1383
|
type TablePropertyChange = {
|
|
1039
|
-
type: "tablePropertyChange";
|
|
1040
|
-
|
|
1041
|
-
|
|
1384
|
+
type: "tablePropertyChange";
|
|
1385
|
+
/** Tracked change metadata */
|
|
1386
|
+
info: PropertyChangeInfo;
|
|
1387
|
+
/** Table properties before the tracked change */
|
|
1388
|
+
previousFormatting?: TableFormatting;
|
|
1389
|
+
/** Table properties after the tracked change (editor model convenience) */
|
|
1042
1390
|
currentFormatting?: TableFormatting;
|
|
1043
1391
|
};
|
|
1044
1392
|
/**
|
|
1045
1393
|
* Table row property change (w:trPrChange)
|
|
1046
1394
|
*/
|
|
1047
1395
|
type TableRowPropertyChange = {
|
|
1048
|
-
type: "tableRowPropertyChange";
|
|
1049
|
-
|
|
1050
|
-
|
|
1396
|
+
type: "tableRowPropertyChange";
|
|
1397
|
+
/** Tracked change metadata */
|
|
1398
|
+
info: PropertyChangeInfo;
|
|
1399
|
+
/** Row properties before the tracked change */
|
|
1400
|
+
previousFormatting?: TableRowFormatting;
|
|
1401
|
+
/** Row properties after the tracked change (editor model convenience) */
|
|
1051
1402
|
currentFormatting?: TableRowFormatting;
|
|
1052
1403
|
};
|
|
1053
1404
|
/**
|
|
1054
1405
|
* Table cell property change (w:tcPrChange)
|
|
1055
1406
|
*/
|
|
1056
1407
|
type TableCellPropertyChange = {
|
|
1057
|
-
type: "tableCellPropertyChange";
|
|
1058
|
-
|
|
1059
|
-
|
|
1408
|
+
type: "tableCellPropertyChange";
|
|
1409
|
+
/** Tracked change metadata */
|
|
1410
|
+
info: PropertyChangeInfo;
|
|
1411
|
+
/** Cell properties before the tracked change */
|
|
1412
|
+
previousFormatting?: TableCellFormatting;
|
|
1413
|
+
/** Cell properties after the tracked change (editor model convenience) */
|
|
1060
1414
|
currentFormatting?: TableCellFormatting;
|
|
1061
1415
|
};
|
|
1062
1416
|
/**
|
|
1063
1417
|
* Section property change (w:sectPrChange)
|
|
1064
1418
|
*/
|
|
1065
1419
|
type SectionPropertyChange = {
|
|
1066
|
-
type: "sectionPropertyChange";
|
|
1067
|
-
|
|
1068
|
-
|
|
1420
|
+
type: "sectionPropertyChange";
|
|
1421
|
+
/** Tracked change metadata */
|
|
1422
|
+
info: PropertyChangeInfo;
|
|
1423
|
+
/** Section properties before the tracked change */
|
|
1424
|
+
previousProperties?: SectionProperties;
|
|
1425
|
+
/** Section properties after the tracked change (editor model convenience) */
|
|
1069
1426
|
currentProperties?: SectionProperties;
|
|
1070
1427
|
};
|
|
1071
1428
|
/**
|
|
1072
1429
|
* Table structural tracked change metadata (row/cell insert/delete/merge)
|
|
1073
1430
|
*/
|
|
1074
1431
|
type TableStructuralChangeInfo = {
|
|
1075
|
-
type: "tableRowInsertion" | "tableRowDeletion" | "tableCellInsertion" | "tableCellDeletion";
|
|
1432
|
+
type: "tableRowInsertion" | "tableRowDeletion" | "tableCellInsertion" | "tableCellDeletion";
|
|
1433
|
+
/** Tracked change metadata */
|
|
1076
1434
|
info: TrackedChangeInfo;
|
|
1077
1435
|
} | {
|
|
1078
|
-
type: "tableCellMerge";
|
|
1079
|
-
|
|
1080
|
-
|
|
1436
|
+
type: "tableCellMerge";
|
|
1437
|
+
/** Tracked change metadata */
|
|
1438
|
+
info: TrackedChangeInfo;
|
|
1439
|
+
/** Vertical merge state applied by the revision. */
|
|
1440
|
+
verticalMerge?: "continue" | "rest";
|
|
1441
|
+
/** Vertical merge state that existed before the revision. */
|
|
1081
1442
|
verticalMergeOriginal?: "continue" | "rest";
|
|
1082
1443
|
};
|
|
1083
1444
|
/**
|
|
@@ -1096,17 +1457,24 @@ type SdtType = "richText" | "plainText" | "date" | "dropdown" | "comboBox" | "ch
|
|
|
1096
1457
|
* `w:sdtEndPr`) lossless.
|
|
1097
1458
|
*/
|
|
1098
1459
|
type SdtProperties = {
|
|
1099
|
-
/** SDT type (projection; round-trip uses `rawPropertiesXml`). */
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1460
|
+
/** SDT type (projection; round-trip uses `rawPropertiesXml`). */
|
|
1461
|
+
sdtType: SdtType;
|
|
1462
|
+
/** Numeric id (`w:id/@w:val`). */
|
|
1463
|
+
id?: number;
|
|
1464
|
+
/** Alias (friendly name, `w:alias`). */
|
|
1465
|
+
alias?: string;
|
|
1466
|
+
/** Tag (developer identifier, `w:tag`). */
|
|
1467
|
+
tag?: string;
|
|
1468
|
+
/** Lock setting (`w:lock`). */
|
|
1103
1469
|
lock?: "sdtLocked" | "contentLocked" | "sdtContentLocked" | "unlocked";
|
|
1104
1470
|
/**
|
|
1105
1471
|
* Placeholder building-block name (`w:placeholder/w:docPart@w:val`) — a
|
|
1106
1472
|
* reference to a glossary docPart, not the literal placeholder text.
|
|
1107
1473
|
*/
|
|
1108
|
-
placeholder?: string;
|
|
1109
|
-
|
|
1474
|
+
placeholder?: string;
|
|
1475
|
+
/** Whether the placeholder is currently shown (`w:showingPlcHdr`). */
|
|
1476
|
+
showingPlaceholder?: boolean;
|
|
1477
|
+
/** Date display format (`w:date/w:dateFormat@w:val`). */
|
|
1110
1478
|
dateFormat?: string;
|
|
1111
1479
|
/**
|
|
1112
1480
|
* Bound date value (`w:date/@w:fullDate`), ISO 8601. Independent of
|
|
@@ -1114,7 +1482,8 @@ type SdtProperties = {
|
|
|
1114
1482
|
* formatted version like "2 June 2026" while this stays as
|
|
1115
1483
|
* `2026-06-02T00:00:00Z` so Word's date binding round-trips losslessly.
|
|
1116
1484
|
*/
|
|
1117
|
-
dateValueISO?: string;
|
|
1485
|
+
dateValueISO?: string;
|
|
1486
|
+
/** Dropdown/combobox list items. */
|
|
1118
1487
|
listItems?: {
|
|
1119
1488
|
displayText: string;
|
|
1120
1489
|
value: string;
|
|
@@ -1126,14 +1495,16 @@ type SdtProperties = {
|
|
|
1126
1495
|
* matching the body's display text against `listItems`, which picked
|
|
1127
1496
|
* the wrong entry when two items shared a `displayText`.
|
|
1128
1497
|
*/
|
|
1129
|
-
dropdownLastValue?: string;
|
|
1498
|
+
dropdownLastValue?: string;
|
|
1499
|
+
/** Checkbox checked state (`w14:checkbox/w14:checked`). */
|
|
1130
1500
|
checked?: boolean;
|
|
1131
1501
|
/**
|
|
1132
1502
|
* Verbatim `<w:sdtPr>…</w:sdtPr>` captured at parse time. Replayed on
|
|
1133
1503
|
* serialize so unmodeled OOXML features (data binding, repeating sections,
|
|
1134
1504
|
* `@lastValue`, custom XML mappings) survive round-trip.
|
|
1135
1505
|
*/
|
|
1136
|
-
rawPropertiesXml?: string;
|
|
1506
|
+
rawPropertiesXml?: string;
|
|
1507
|
+
/** Verbatim `<w:sdtEndPr>…</w:sdtEndPr>` captured at parse time. */
|
|
1137
1508
|
rawEndPropertiesXml?: string;
|
|
1138
1509
|
/**
|
|
1139
1510
|
* Verbatim XML for any non-content direct children of `<w:sdt>` that
|
|
@@ -1144,7 +1515,8 @@ type SdtProperties = {
|
|
|
1144
1515
|
* changes that span an SDT boundary round-trip without losing a
|
|
1145
1516
|
* delimiter.
|
|
1146
1517
|
*/
|
|
1147
|
-
rawSdtChildrenBeforeContent?: string;
|
|
1518
|
+
rawSdtChildrenBeforeContent?: string;
|
|
1519
|
+
/** Verbatim XML for non-content sdt children that appear AFTER `<w:sdtContent>`. */
|
|
1148
1520
|
rawSdtChildrenAfterContent?: string;
|
|
1149
1521
|
};
|
|
1150
1522
|
/**
|
|
@@ -1156,8 +1528,10 @@ type SdtProperties = {
|
|
|
1156
1528
|
* content do not lose their wrapper on round-trip.
|
|
1157
1529
|
*/
|
|
1158
1530
|
type InlineSdt = {
|
|
1159
|
-
type: "inlineSdt";
|
|
1160
|
-
|
|
1531
|
+
type: "inlineSdt";
|
|
1532
|
+
/** SDT properties */
|
|
1533
|
+
properties: SdtProperties;
|
|
1534
|
+
/** Inline content held inside the control */
|
|
1161
1535
|
content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | Insertion | Deletion | MoveFrom | MoveTo | MathEquation)[];
|
|
1162
1536
|
};
|
|
1163
1537
|
/**
|
|
@@ -1168,8 +1542,10 @@ type InlineSdt = {
|
|
|
1168
1542
|
* whose row is itself a content control.
|
|
1169
1543
|
*/
|
|
1170
1544
|
type BlockSdt = {
|
|
1171
|
-
type: "blockSdt";
|
|
1172
|
-
properties
|
|
1545
|
+
type: "blockSdt";
|
|
1546
|
+
/** SDT properties (raw XML in `properties.rawPropertiesXml` round-trips losslessly). */
|
|
1547
|
+
properties: SdtProperties;
|
|
1548
|
+
/** Block content inside the control. */
|
|
1173
1549
|
content: BlockContent[];
|
|
1174
1550
|
};
|
|
1175
1551
|
/**
|
|
@@ -1193,15 +1569,24 @@ type ParagraphMarkChange = {
|
|
|
1193
1569
|
info: TrackedChangeInfo;
|
|
1194
1570
|
};
|
|
1195
1571
|
type Paragraph = {
|
|
1196
|
-
type: "paragraph";
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1572
|
+
type: "paragraph";
|
|
1573
|
+
/** Unique paragraph ID */
|
|
1574
|
+
paraId?: string;
|
|
1575
|
+
/** Text ID */
|
|
1576
|
+
textId?: string;
|
|
1577
|
+
/** Paragraph formatting */
|
|
1578
|
+
formatting?: ParagraphFormatting;
|
|
1579
|
+
/** Paragraph-level tracked property changes (w:pPrChange) */
|
|
1580
|
+
propertyChanges?: ParagraphPropertyChange[];
|
|
1581
|
+
/** Paragraph-mark insertion / deletion (w:pPr / w:rPr / w:ins | w:del) */
|
|
1582
|
+
pPrMark?: ParagraphMarkChange;
|
|
1583
|
+
/** Paragraph content */
|
|
1584
|
+
content: ParagraphContent[];
|
|
1585
|
+
/** Computed list rendering (if this is a list item) */
|
|
1586
|
+
listRendering?: ListRendering;
|
|
1587
|
+
/** Word's cached layout says this paragraph started on a new rendered page. */
|
|
1588
|
+
renderedPageBreakBefore?: boolean;
|
|
1589
|
+
/** Section properties (if this paragraph ends a section) */
|
|
1205
1590
|
sectionProperties?: SectionProperties;
|
|
1206
1591
|
};
|
|
1207
1592
|
/**
|
|
@@ -1223,8 +1608,10 @@ type FooterReference = {
|
|
|
1223
1608
|
* Header or footer content
|
|
1224
1609
|
*/
|
|
1225
1610
|
type HeaderFooter = {
|
|
1226
|
-
type: "header" | "footer";
|
|
1227
|
-
|
|
1611
|
+
type: "header" | "footer";
|
|
1612
|
+
/** Header/footer type */
|
|
1613
|
+
hdrFtrType: HeaderFooterType;
|
|
1614
|
+
/** Content (paragraphs, tables, block-level content controls). */
|
|
1228
1615
|
content: BlockContent[];
|
|
1229
1616
|
/**
|
|
1230
1617
|
* Document watermark detected in this header part. Word emits
|
|
@@ -1258,8 +1645,10 @@ type HeaderFooter = {
|
|
|
1258
1645
|
*/
|
|
1259
1646
|
type Watermark = TextWatermark | PictureWatermark;
|
|
1260
1647
|
type TextWatermark = {
|
|
1261
|
-
kind: "text";
|
|
1262
|
-
|
|
1648
|
+
kind: "text";
|
|
1649
|
+
/** Visible string. Required. */
|
|
1650
|
+
text: string;
|
|
1651
|
+
/** Font family. Word's default is Calibri. */
|
|
1263
1652
|
font?: string;
|
|
1264
1653
|
/**
|
|
1265
1654
|
* Hex color (`"C0C0C0"`), `"auto"`, or `undefined` for the producer
|
|
@@ -1280,7 +1669,8 @@ type TextWatermark = {
|
|
|
1280
1669
|
opacity?: number;
|
|
1281
1670
|
};
|
|
1282
1671
|
type PictureWatermark = {
|
|
1283
|
-
kind: "picture";
|
|
1672
|
+
kind: "picture";
|
|
1673
|
+
/** Relationship id of the image part in `word/_rels/header*.xml.rels`. */
|
|
1284
1674
|
imageRId: string;
|
|
1285
1675
|
/**
|
|
1286
1676
|
* Stable identity of the image the `imageRId` resolved to in the header it
|
|
@@ -1296,7 +1686,8 @@ type PictureWatermark = {
|
|
|
1296
1686
|
* When true, {@link imageTarget} is an external (linked) URL written back
|
|
1297
1687
|
* with `TargetMode="External"`, not an embedded package path.
|
|
1298
1688
|
*/
|
|
1299
|
-
imageTargetExternal?: boolean;
|
|
1689
|
+
imageTargetExternal?: boolean;
|
|
1690
|
+
/** Optional scale factor (1.0 = native, 0.5 = half-size). */
|
|
1300
1691
|
scale?: number;
|
|
1301
1692
|
/**
|
|
1302
1693
|
* Display width in points from the VML shape, captured at parse so the
|
|
@@ -1305,7 +1696,8 @@ type PictureWatermark = {
|
|
|
1305
1696
|
* non-2:1 image). Absent for synthesized watermarks, which fall back to
|
|
1306
1697
|
* Word's default box scaled by `scale`.
|
|
1307
1698
|
*/
|
|
1308
|
-
widthPt?: number;
|
|
1699
|
+
widthPt?: number;
|
|
1700
|
+
/** Display height in points from the VML shape. See {@link widthPt}. */
|
|
1309
1701
|
heightPt?: number;
|
|
1310
1702
|
/**
|
|
1311
1703
|
* Whether Word's "washout" effect was applied (low contrast).
|
|
@@ -1348,8 +1740,10 @@ type EndnoteProperties = {
|
|
|
1348
1740
|
* Footnote (w:footnote)
|
|
1349
1741
|
*/
|
|
1350
1742
|
type Footnote = {
|
|
1351
|
-
type: "footnote";
|
|
1352
|
-
|
|
1743
|
+
type: "footnote";
|
|
1744
|
+
/** Footnote ID */
|
|
1745
|
+
id: number;
|
|
1746
|
+
/** Special footnote type */
|
|
1353
1747
|
noteType?: "normal" | "separator" | "continuationSeparator" | "continuationNotice";
|
|
1354
1748
|
/**
|
|
1355
1749
|
* Content. Note bodies may carry block-level `<w:sdt>` content
|
|
@@ -1364,8 +1758,10 @@ type Footnote = {
|
|
|
1364
1758
|
* Endnote (w:endnote)
|
|
1365
1759
|
*/
|
|
1366
1760
|
type Endnote = {
|
|
1367
|
-
type: "endnote";
|
|
1368
|
-
|
|
1761
|
+
type: "endnote";
|
|
1762
|
+
/** Endnote ID */
|
|
1763
|
+
id: number;
|
|
1764
|
+
/** Special endnote type */
|
|
1369
1765
|
noteType?: "normal" | "separator" | "continuationSeparator" | "continuationNotice";
|
|
1370
1766
|
/**
|
|
1371
1767
|
* Content. Like `Footnote.content`, may carry block-level `<w:sdt>`
|
|
@@ -1393,7 +1789,9 @@ type LineNumberRestart = "continuous" | "newPage" | "newSection";
|
|
|
1393
1789
|
* Column definition
|
|
1394
1790
|
*/
|
|
1395
1791
|
type Column = {
|
|
1396
|
-
/** Column width in twips */
|
|
1792
|
+
/** Column width in twips */
|
|
1793
|
+
width?: number;
|
|
1794
|
+
/** Space after column in twips */
|
|
1397
1795
|
space?: number;
|
|
1398
1796
|
};
|
|
1399
1797
|
/**
|
|
@@ -1401,70 +1799,111 @@ type Column = {
|
|
|
1401
1799
|
*/
|
|
1402
1800
|
type SectionTextDirection = "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | "tbLrV" | "tb" | "rl" | "lr" | "tbV" | "rlV" | "lrV";
|
|
1403
1801
|
type SectionProperties = {
|
|
1404
|
-
/** Page width in twips */
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1802
|
+
/** Page width in twips */
|
|
1803
|
+
pageWidth?: number;
|
|
1804
|
+
/** Page height in twips */
|
|
1805
|
+
pageHeight?: number;
|
|
1806
|
+
/** Page orientation */
|
|
1807
|
+
orientation?: PageOrientation;
|
|
1808
|
+
/** Top margin in twips */
|
|
1809
|
+
marginTop?: number;
|
|
1810
|
+
/** Bottom margin in twips */
|
|
1811
|
+
marginBottom?: number;
|
|
1812
|
+
/** Left margin in twips */
|
|
1813
|
+
marginLeft?: number;
|
|
1814
|
+
/** Right margin in twips */
|
|
1815
|
+
marginRight?: number;
|
|
1816
|
+
/** Header distance from top in twips */
|
|
1817
|
+
headerDistance?: number;
|
|
1818
|
+
/** Footer distance from bottom in twips */
|
|
1819
|
+
footerDistance?: number;
|
|
1820
|
+
/** Gutter margin in twips */
|
|
1821
|
+
gutter?: number;
|
|
1822
|
+
/** Number of columns */
|
|
1823
|
+
columnCount?: number;
|
|
1824
|
+
/** Space between columns in twips */
|
|
1825
|
+
columnSpace?: number;
|
|
1826
|
+
/** Equal width columns */
|
|
1827
|
+
equalWidth?: boolean;
|
|
1828
|
+
/** Separator line between columns */
|
|
1829
|
+
separator?: boolean;
|
|
1830
|
+
/** Individual column definitions */
|
|
1831
|
+
columns?: Column[];
|
|
1832
|
+
/** Section start type */
|
|
1833
|
+
sectionStart?: SectionStart;
|
|
1834
|
+
/** Vertical alignment of text */
|
|
1835
|
+
verticalAlign?: VerticalAlign;
|
|
1836
|
+
/** Section text direction */
|
|
1837
|
+
textDirection?: SectionTextDirection;
|
|
1838
|
+
/** Right-to-left section */
|
|
1839
|
+
bidi?: boolean;
|
|
1840
|
+
/** Header references */
|
|
1841
|
+
headerReferences?: HeaderReference[];
|
|
1842
|
+
/** Footer references */
|
|
1843
|
+
footerReferences?: FooterReference[];
|
|
1844
|
+
/** Different first page header/footer */
|
|
1845
|
+
titlePg?: boolean;
|
|
1846
|
+
/** Different odd/even page headers/footers */
|
|
1847
|
+
evenAndOddHeaders?: boolean;
|
|
1848
|
+
/** Line numbering settings */
|
|
1427
1849
|
lineNumbers?: {
|
|
1428
1850
|
start?: number;
|
|
1429
1851
|
countBy?: number;
|
|
1430
1852
|
distance?: number;
|
|
1431
1853
|
restart?: LineNumberRestart;
|
|
1432
|
-
};
|
|
1854
|
+
};
|
|
1855
|
+
/** Page numbering settings */
|
|
1433
1856
|
pageNumbering?: {
|
|
1434
1857
|
format?: string;
|
|
1435
1858
|
start?: number;
|
|
1436
1859
|
chapterStyle?: number;
|
|
1437
1860
|
chapterSeparator?: string;
|
|
1438
|
-
};
|
|
1861
|
+
};
|
|
1862
|
+
/** Page borders */
|
|
1439
1863
|
pageBorders?: {
|
|
1440
1864
|
top?: BorderSpec;
|
|
1441
1865
|
bottom?: BorderSpec;
|
|
1442
1866
|
left?: BorderSpec;
|
|
1443
|
-
right?: BorderSpec;
|
|
1444
|
-
|
|
1445
|
-
|
|
1867
|
+
right?: BorderSpec;
|
|
1868
|
+
/** Display setting */
|
|
1869
|
+
display?: "allPages" | "firstPage" | "notFirstPage";
|
|
1870
|
+
/** Offset from */
|
|
1871
|
+
offsetFrom?: "page" | "text";
|
|
1872
|
+
/** Z-order */
|
|
1446
1873
|
zOrder?: "front" | "back";
|
|
1447
|
-
};
|
|
1874
|
+
};
|
|
1875
|
+
/** Page background */
|
|
1448
1876
|
background?: {
|
|
1449
1877
|
color?: ColorValue;
|
|
1450
1878
|
themeColor?: ThemeColorSlot;
|
|
1451
1879
|
themeTint?: string;
|
|
1452
1880
|
themeShade?: string;
|
|
1453
|
-
};
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1881
|
+
};
|
|
1882
|
+
/** Footnote properties for this section */
|
|
1883
|
+
footnotePr?: FootnoteProperties;
|
|
1884
|
+
/** Number of footnote columns in this section (`w15:footnoteColumns`) */
|
|
1885
|
+
footnoteColumns?: number;
|
|
1886
|
+
/** Endnote properties for this section */
|
|
1887
|
+
endnotePr?: EndnoteProperties;
|
|
1888
|
+
/** Document grid */
|
|
1457
1889
|
docGrid?: {
|
|
1458
1890
|
type?: "default" | "lines" | "linesAndChars" | "snapToChars";
|
|
1459
1891
|
linePitch?: number;
|
|
1460
1892
|
charSpace?: number;
|
|
1461
|
-
};
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1893
|
+
};
|
|
1894
|
+
/** First page paper source */
|
|
1895
|
+
paperSrcFirst?: number;
|
|
1896
|
+
/** Other pages paper source */
|
|
1897
|
+
paperSrcOther?: number;
|
|
1898
|
+
/** Protected forms in this section */
|
|
1899
|
+
formProtection?: boolean;
|
|
1900
|
+
/** Suppress endnotes in this section */
|
|
1901
|
+
noEndnote?: boolean;
|
|
1902
|
+
/** Use right-to-left gutter in this section */
|
|
1903
|
+
rtlGutter?: boolean;
|
|
1904
|
+
/** Relationship id for printer settings */
|
|
1905
|
+
printerSettingsRelationshipId?: string;
|
|
1906
|
+
/** Section-level tracked property changes (w:sectPrChange) */
|
|
1468
1907
|
propertyChanges?: SectionPropertyChange[];
|
|
1469
1908
|
};
|
|
1470
1909
|
/**
|
|
@@ -1475,18 +1914,26 @@ type BlockContent = Paragraph | Table | BlockSdt;
|
|
|
1475
1914
|
* Section (implicit or explicit based on sectPr)
|
|
1476
1915
|
*/
|
|
1477
1916
|
type Section = {
|
|
1478
|
-
/** Section properties */
|
|
1479
|
-
|
|
1480
|
-
|
|
1917
|
+
/** Section properties */
|
|
1918
|
+
properties: SectionProperties;
|
|
1919
|
+
/** Content in this section */
|
|
1920
|
+
content: BlockContent[];
|
|
1921
|
+
/** Headers for this section */
|
|
1922
|
+
headers?: Map<HeaderFooterType, HeaderFooter>;
|
|
1923
|
+
/** Footers for this section */
|
|
1481
1924
|
footers?: Map<HeaderFooterType, HeaderFooter>;
|
|
1482
1925
|
};
|
|
1483
1926
|
/**
|
|
1484
1927
|
* Document body (w:body)
|
|
1485
1928
|
*/
|
|
1486
1929
|
type DocumentBody = {
|
|
1487
|
-
/** All content (paragraphs, tables) */
|
|
1488
|
-
|
|
1489
|
-
|
|
1930
|
+
/** All content (paragraphs, tables) */
|
|
1931
|
+
content: BlockContent[];
|
|
1932
|
+
/** Sections (derived from sectPr in paragraphs and final sectPr) */
|
|
1933
|
+
sections?: Section[];
|
|
1934
|
+
/** Final section properties (from body's sectPr) */
|
|
1935
|
+
finalSectionProperties?: SectionProperties;
|
|
1936
|
+
/** Comments from comments.xml */
|
|
1490
1937
|
comments?: Comment[];
|
|
1491
1938
|
};
|
|
1492
1939
|
//#endregion
|
|
@@ -1499,24 +1946,43 @@ type StyleType = "paragraph" | "character" | "numbering" | "table";
|
|
|
1499
1946
|
* Style definition
|
|
1500
1947
|
*/
|
|
1501
1948
|
type Style = {
|
|
1502
|
-
/** Style ID */
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1949
|
+
/** Style ID */
|
|
1950
|
+
styleId: string;
|
|
1951
|
+
/** Style type */
|
|
1952
|
+
type: StyleType;
|
|
1953
|
+
/** Display name */
|
|
1954
|
+
name?: string;
|
|
1955
|
+
/** Based on style ID */
|
|
1956
|
+
basedOn?: string;
|
|
1957
|
+
/** Next style after Enter (for paragraph styles) */
|
|
1958
|
+
next?: string;
|
|
1959
|
+
/** Linked style (paragraph/character pair) */
|
|
1960
|
+
link?: string;
|
|
1961
|
+
/** UI sort priority */
|
|
1962
|
+
uiPriority?: number;
|
|
1963
|
+
/** Hidden from UI */
|
|
1964
|
+
hidden?: boolean;
|
|
1965
|
+
/** Semi-hidden from UI */
|
|
1966
|
+
semiHidden?: boolean;
|
|
1967
|
+
/** Unhide when used */
|
|
1968
|
+
unhideWhenUsed?: boolean;
|
|
1969
|
+
/** Quick format in gallery */
|
|
1970
|
+
qFormat?: boolean;
|
|
1971
|
+
/** Is default style */
|
|
1972
|
+
default?: boolean;
|
|
1973
|
+
/** Personal style (custom) */
|
|
1974
|
+
personal?: boolean;
|
|
1975
|
+
/** Paragraph properties (for paragraph/table styles) */
|
|
1976
|
+
pPr?: ParagraphFormatting;
|
|
1977
|
+
/** Run properties */
|
|
1978
|
+
rPr?: TextFormatting;
|
|
1979
|
+
/** Table properties (for table styles) */
|
|
1980
|
+
tblPr?: TableFormatting;
|
|
1981
|
+
/** Table row properties */
|
|
1982
|
+
trPr?: TableRowFormatting;
|
|
1983
|
+
/** Table cell properties */
|
|
1984
|
+
tcPr?: TableCellFormatting;
|
|
1985
|
+
/** Conditional table style parts */
|
|
1520
1986
|
tblStylePr?: {
|
|
1521
1987
|
type: "band1Horz" | "band1Vert" | "band2Horz" | "band2Vert" | "firstCol" | "firstRow" | "lastCol" | "lastRow" | "neCell" | "nwCell" | "seCell" | "swCell" | "wholeTable";
|
|
1522
1988
|
pPr?: ParagraphFormatting;
|
|
@@ -1530,14 +1996,18 @@ type Style = {
|
|
|
1530
1996
|
* Document defaults (w:docDefaults)
|
|
1531
1997
|
*/
|
|
1532
1998
|
type DocDefaults = {
|
|
1533
|
-
/** Default run properties */
|
|
1999
|
+
/** Default run properties */
|
|
2000
|
+
rPr?: TextFormatting;
|
|
2001
|
+
/** Default paragraph properties */
|
|
1534
2002
|
pPr?: ParagraphFormatting;
|
|
1535
2003
|
};
|
|
1536
2004
|
/**
|
|
1537
2005
|
* Style definitions from styles.xml
|
|
1538
2006
|
*/
|
|
1539
2007
|
type StyleDefinitions = {
|
|
1540
|
-
/** Document defaults */
|
|
2008
|
+
/** Document defaults */
|
|
2009
|
+
docDefaults?: DocDefaults;
|
|
2010
|
+
/** Latent styles */
|
|
1541
2011
|
latentStyles?: {
|
|
1542
2012
|
defLockedState?: boolean;
|
|
1543
2013
|
defUIPriority?: number;
|
|
@@ -1545,49 +2015,67 @@ type StyleDefinitions = {
|
|
|
1545
2015
|
defUnhideWhenUsed?: boolean;
|
|
1546
2016
|
defQFormat?: boolean;
|
|
1547
2017
|
count?: number;
|
|
1548
|
-
};
|
|
2018
|
+
};
|
|
2019
|
+
/** Style definitions */
|
|
1549
2020
|
styles: Style[];
|
|
1550
2021
|
};
|
|
1551
2022
|
/**
|
|
1552
2023
|
* Theme color scheme (a:clrScheme)
|
|
1553
2024
|
*/
|
|
1554
2025
|
type ThemeColorScheme = {
|
|
1555
|
-
/** Dark 1 color (usually black) */
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
2026
|
+
/** Dark 1 color (usually black) */
|
|
2027
|
+
dk1?: string;
|
|
2028
|
+
/** Light 1 color (usually white) */
|
|
2029
|
+
lt1?: string;
|
|
2030
|
+
/** Dark 2 color */
|
|
2031
|
+
dk2?: string;
|
|
2032
|
+
/** Light 2 color */
|
|
2033
|
+
lt2?: string;
|
|
2034
|
+
/** Accent colors 1-6 */
|
|
1559
2035
|
accent1?: string;
|
|
1560
2036
|
accent2?: string;
|
|
1561
2037
|
accent3?: string;
|
|
1562
2038
|
accent4?: string;
|
|
1563
2039
|
accent5?: string;
|
|
1564
|
-
accent6?: string;
|
|
1565
|
-
|
|
2040
|
+
accent6?: string;
|
|
2041
|
+
/** Hyperlink color */
|
|
2042
|
+
hlink?: string;
|
|
2043
|
+
/** Followed hyperlink color */
|
|
1566
2044
|
folHlink?: string;
|
|
1567
2045
|
};
|
|
1568
2046
|
/**
|
|
1569
2047
|
* Theme font (with script variants)
|
|
1570
2048
|
*/
|
|
1571
2049
|
type ThemeFont = {
|
|
1572
|
-
/** Latin font */
|
|
1573
|
-
|
|
1574
|
-
|
|
2050
|
+
/** Latin font */
|
|
2051
|
+
latin?: string;
|
|
2052
|
+
/** East Asian font */
|
|
2053
|
+
ea?: string;
|
|
2054
|
+
/** Complex script font */
|
|
2055
|
+
cs?: string;
|
|
2056
|
+
/** Script-specific fonts */
|
|
1575
2057
|
fonts?: Record<string, string>;
|
|
1576
2058
|
};
|
|
1577
2059
|
/**
|
|
1578
2060
|
* Theme font scheme (a:fontScheme)
|
|
1579
2061
|
*/
|
|
1580
2062
|
type ThemeFontScheme = {
|
|
1581
|
-
/** Major font (headings) */
|
|
2063
|
+
/** Major font (headings) */
|
|
2064
|
+
majorFont?: ThemeFont;
|
|
2065
|
+
/** Minor font (body text) */
|
|
1582
2066
|
minorFont?: ThemeFont;
|
|
1583
2067
|
};
|
|
1584
2068
|
/**
|
|
1585
2069
|
* Theme (from theme1.xml)
|
|
1586
2070
|
*/
|
|
1587
2071
|
type Theme = {
|
|
1588
|
-
/** Theme name */
|
|
1589
|
-
|
|
1590
|
-
|
|
2072
|
+
/** Theme name */
|
|
2073
|
+
name?: string;
|
|
2074
|
+
/** Color scheme */
|
|
2075
|
+
colorScheme?: ThemeColorScheme;
|
|
2076
|
+
/** Font scheme */
|
|
2077
|
+
fontScheme?: ThemeFontScheme;
|
|
2078
|
+
/** Format scheme (fills, lines, effects) - simplified */
|
|
1591
2079
|
formatScheme?: {
|
|
1592
2080
|
name?: string;
|
|
1593
2081
|
};
|
|
@@ -1596,12 +2084,19 @@ type Theme = {
|
|
|
1596
2084
|
* Font info from fontTable.xml
|
|
1597
2085
|
*/
|
|
1598
2086
|
type FontInfo = {
|
|
1599
|
-
/** Font name */
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
2087
|
+
/** Font name */
|
|
2088
|
+
name: string;
|
|
2089
|
+
/** Alternate names */
|
|
2090
|
+
altName?: string;
|
|
2091
|
+
/** Panose-1 classification */
|
|
2092
|
+
panose1?: string;
|
|
2093
|
+
/** Character set */
|
|
2094
|
+
charset?: string;
|
|
2095
|
+
/** Font family type */
|
|
2096
|
+
family?: "decorative" | "modern" | "roman" | "script" | "swiss" | "auto";
|
|
2097
|
+
/** Pitch (fixed or variable) */
|
|
2098
|
+
pitch?: "default" | "fixed" | "variable";
|
|
2099
|
+
/** Signature */
|
|
1605
2100
|
sig?: {
|
|
1606
2101
|
usb0?: string;
|
|
1607
2102
|
usb1?: string;
|
|
@@ -1609,7 +2104,8 @@ type FontInfo = {
|
|
|
1609
2104
|
usb3?: string;
|
|
1610
2105
|
csb0?: string;
|
|
1611
2106
|
csb1?: string;
|
|
1612
|
-
};
|
|
2107
|
+
};
|
|
2108
|
+
/** Embedded font data reference */
|
|
1613
2109
|
embedRegular?: string;
|
|
1614
2110
|
embedBold?: string;
|
|
1615
2111
|
embedItalic?: string;
|
|
@@ -1629,9 +2125,13 @@ type RelationshipType = string;
|
|
|
1629
2125
|
* Relationship entry
|
|
1630
2126
|
*/
|
|
1631
2127
|
type Relationship = {
|
|
1632
|
-
/** Relationship ID (e.g., "rId1") */
|
|
1633
|
-
|
|
1634
|
-
|
|
2128
|
+
/** Relationship ID (e.g., "rId1") */
|
|
2129
|
+
id: string;
|
|
2130
|
+
/** Relationship type URI */
|
|
2131
|
+
type: RelationshipType;
|
|
2132
|
+
/** Target path or URL */
|
|
2133
|
+
target: string;
|
|
2134
|
+
/** Target mode */
|
|
1635
2135
|
targetMode?: "External" | "Internal";
|
|
1636
2136
|
};
|
|
1637
2137
|
/**
|
|
@@ -1642,11 +2142,17 @@ type RelationshipMap = Map<string, Relationship>;
|
|
|
1642
2142
|
* Media file from word/media/
|
|
1643
2143
|
*/
|
|
1644
2144
|
type MediaFile = {
|
|
1645
|
-
/** File path in ZIP */
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
2145
|
+
/** File path in ZIP */
|
|
2146
|
+
path: string;
|
|
2147
|
+
/** Original filename */
|
|
2148
|
+
filename?: string;
|
|
2149
|
+
/** MIME type */
|
|
2150
|
+
mimeType: string;
|
|
2151
|
+
/** Binary data */
|
|
2152
|
+
data: ArrayBuffer;
|
|
2153
|
+
/** Base64 encoded data for rendering */
|
|
2154
|
+
base64?: string;
|
|
2155
|
+
/** Data URL for direct use in src attributes */
|
|
1650
2156
|
dataUrl?: string;
|
|
1651
2157
|
};
|
|
1652
2158
|
//#endregion
|
|
@@ -1681,11 +2187,16 @@ type DocumentSettings = {
|
|
|
1681
2187
|
themeFontLang?: {
|
|
1682
2188
|
eastAsia?: string;
|
|
1683
2189
|
bidi?: string;
|
|
1684
|
-
};
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
2190
|
+
};
|
|
2191
|
+
/** Automatically hyphenate eligible paragraphs (`w:autoHyphenation`). */
|
|
2192
|
+
autoHyphenation?: boolean;
|
|
2193
|
+
/** Keep all-capital words unhyphenated (`w:doNotHyphenateCaps`). */
|
|
2194
|
+
doNotHyphenateCaps?: boolean;
|
|
2195
|
+
/** Maximum consecutive automatically hyphenated lines; zero means unlimited. */
|
|
2196
|
+
consecutiveHyphenLimit?: number;
|
|
2197
|
+
/** Legacy hyphenation zone (`w:hyphenationZone`) in twips; retained for compatibility tooling. */
|
|
2198
|
+
hyphenationZoneTwips?: number;
|
|
2199
|
+
/** Word/OOXML document-wide line-breaking overrides. */
|
|
1689
2200
|
lineBreakRules?: {
|
|
1690
2201
|
noLineBreaksBefore?: {
|
|
1691
2202
|
language?: string;
|
|
@@ -1696,7 +2207,8 @@ type DocumentSettings = {
|
|
|
1696
2207
|
characters: string;
|
|
1697
2208
|
};
|
|
1698
2209
|
useLegacyEthiopicAmharicRules?: boolean;
|
|
1699
|
-
};
|
|
2210
|
+
};
|
|
2211
|
+
/** Move a break-only paragraph mark onto the page after its hard page break. */
|
|
1700
2212
|
splitPageBreakAndParagraphMark?: boolean;
|
|
1701
2213
|
};
|
|
1702
2214
|
/** DOCX package conformance classes. */
|
|
@@ -1709,19 +2221,33 @@ declare const DOCX_CONFORMANCE_CLASSES: Readonly<{
|
|
|
1709
2221
|
type DocxConformanceClass = (typeof DOCX_CONFORMANCE_CLASSES)[keyof typeof DOCX_CONFORMANCE_CLASSES];
|
|
1710
2222
|
/** Complete DOCX package structure. */
|
|
1711
2223
|
type DocxPackage = {
|
|
1712
|
-
/** Conformance class detected from the main document namespace. */
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
2224
|
+
/** Conformance class detected from the main document namespace. */
|
|
2225
|
+
conformanceClass?: DocxConformanceClass;
|
|
2226
|
+
/** Document body */
|
|
2227
|
+
document: DocumentBody;
|
|
2228
|
+
/** Document-wide settings (`word/settings.xml`). */
|
|
2229
|
+
settings?: DocumentSettings;
|
|
2230
|
+
/** Style definitions */
|
|
2231
|
+
styles?: StyleDefinitions;
|
|
2232
|
+
/** Theme */
|
|
2233
|
+
theme?: Theme;
|
|
2234
|
+
/** Numbering definitions */
|
|
2235
|
+
numbering?: NumberingDefinitions;
|
|
2236
|
+
/** Font table */
|
|
2237
|
+
fontTable?: FontTable;
|
|
2238
|
+
/** Footnotes */
|
|
2239
|
+
footnotes?: Footnote[];
|
|
2240
|
+
/** Endnotes */
|
|
2241
|
+
endnotes?: Endnote[];
|
|
2242
|
+
/** Headers by relationship ID */
|
|
2243
|
+
headers?: Map<string, HeaderFooter>;
|
|
2244
|
+
/** Footers by relationship ID */
|
|
2245
|
+
footers?: Map<string, HeaderFooter>;
|
|
2246
|
+
/** Document relationships */
|
|
2247
|
+
relationships?: RelationshipMap;
|
|
2248
|
+
/** Media files */
|
|
2249
|
+
media?: Map<string, MediaFile>;
|
|
2250
|
+
/** Document properties */
|
|
1725
2251
|
properties?: {
|
|
1726
2252
|
title?: string;
|
|
1727
2253
|
subject?: string;
|
|
@@ -1738,11 +2264,16 @@ type DocxPackage = {
|
|
|
1738
2264
|
* Complete parsed DOCX document
|
|
1739
2265
|
*/
|
|
1740
2266
|
type Document = {
|
|
1741
|
-
/** DOCX package with all parsed content */
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
2267
|
+
/** DOCX package with all parsed content */
|
|
2268
|
+
package: DocxPackage;
|
|
2269
|
+
/** Original ArrayBuffer for round-trip */
|
|
2270
|
+
originalBuffer?: ArrayBuffer;
|
|
2271
|
+
/** Detected template variables ({{...}}) */
|
|
2272
|
+
templateVariables?: string[];
|
|
2273
|
+
/** Font families referenced in the document (extracted during parsing for deferred loading) */
|
|
2274
|
+
requiredFonts?: string[];
|
|
2275
|
+
/** Parsing warnings/errors */
|
|
1745
2276
|
warnings?: string[];
|
|
1746
2277
|
};
|
|
1747
2278
|
//#endregion
|
|
1748
|
-
export { ImageTransform as $,
|
|
2279
|
+
export { ImageTransform as $, TrackedChangeInfo as $t, ComplexField as A, TextEffect as An, SectionProperties as At, FooterReference as B, SoftHyphenContent as Bt, BookmarkStart as C, TableCellBorders as Cn, PropertyChangeInfo as Ct, CommentRangeEnd as D, TableMeasurement as Dn, SdtProperties as Dt, Comment as E, TableLook as En, RunPropertyChange as Et, EndnotePosition as F, KnownBorderStyle as Fn, ShapeFill as Ft, HeaderFooterType as G, TableCellPropertyChange as Gt, FootnotePosition as H, TabContent as Ht, EndnoteProperties as I, ShadingProperties as In, ShapeOutline as It, Image as J, TableRowPropertyChange as Jt, HeaderReference as K, TablePropertyChange as Kt, Field as L, ThemeColorSlot as Ln, ShapeTextBody as Lt, DocumentBody as M, UnderlineStyle as Mn, SectionStart as Mt, DrawingContent as N, BorderSpec as Nn, Shape as Nt, CommentRangeStart as O, TableRowFormatting as On, SdtType as Ot, Endnote as P, ColorValue as Pn, ShapeContent as Pt, ImageSize as Q, TextWatermark as Qt, FieldCharContent as R, ShapeType as Rt, BookmarkEnd as S, TableBorders as Sn, PositionalTab as St, Column as T, TableFormatting as Tn, RunContent as Tt, FootnoteProperties as U, Table as Ut, Footnote as V, SymbolContent as Vt, HeaderFooter as W, TableCell as Wt, ImagePadding as X, TextBox as Xt, ImageCrop as Y, TableStructuralChangeInfo as Yt, ImagePosition as Z, TextContent as Zt, ThemeColorScheme as _, ParagraphFormatting as _n, Paragraph as _t, DocxPackage as a, LevelSuffix as an, MAX_REVISION_ID as at, BlockContent as b, TabStop as bn, ParagraphPropertyChange as bt, FontTable as c, NumberFormat as cn, MoveFromRangeEnd as ct, RelationshipMap as d, CellMargins as dn, MoveToRangeEnd as dt, TrackedRunChange as en, ImageWrap as et, RelationshipType as f, ConditionalFormatStyle as fn, MoveToRangeStart as ft, Theme as g, ParagraphAlignment as gn, PageOrientation as gt, StyleType as h, LineSpacingRule as hn, NoteReferenceContent as ht, DocxConformanceClass as i, AbstractNumbering as in, LineNumberRestart as it, Deletion as j, TextFormatting as jn, SectionPropertyChange as jt, CommentReference as k, TableWidthType as kn, Section as kt, MediaFile as l, NumberingDefinitions as ln, MoveFromRangeStart as lt, StyleDefinitions as m, FloatingTableProperties as mn, NoteNumberRestart as mt, Document as n, Watermark as nn, Insertion as nt, DocDefaults as o, ListLevel as on, MathEquation as ot, Style as p, EmphasisMark as pn, NoBreakHyphenContent as pt, Hyperlink as q, TableRow as qt, DocumentSettings as r, normalizeRevisionId as rn, InstrTextContent as rt, FontInfo as s, ListRendering as sn, MoveFrom as st, DOCX_CONFORMANCE_CLASSES as t, VerticalAlign as tn, InlineSdt as tt, Relationship as u, NumberingInstance as un, MoveTo as ut, ThemeFont as v, SpacingExplicit as vn, ParagraphContent as vt, BreakContent as w, TableCellFormatting as wn, Run as wt, BlockSdt as x, TabStopAlignment as xn, PictureWatermark as xt, ThemeFontScheme as y, TabLeader as yn, ParagraphMarkChange as yt, FieldType as z, SimpleField as zt };
|