@stll/docx-core 0.5.0 → 0.5.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.
|
@@ -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,8 +643,10 @@ 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
|
/**
|
|
@@ -478,32 +659,40 @@ type TabContent = {
|
|
|
478
659
|
* Line break
|
|
479
660
|
*/
|
|
480
661
|
type BreakContent = {
|
|
481
|
-
type: "break";
|
|
482
|
-
|
|
662
|
+
type: "break";
|
|
663
|
+
/** Break type */
|
|
664
|
+
breakType?: "page" | "column" | "textWrapping";
|
|
665
|
+
/** Clear type for text wrapping break */
|
|
483
666
|
clear?: "none" | "left" | "right" | "all";
|
|
484
667
|
};
|
|
485
668
|
/**
|
|
486
669
|
* Symbol character (special font character)
|
|
487
670
|
*/
|
|
488
671
|
type SymbolContent = {
|
|
489
|
-
type: "symbol";
|
|
490
|
-
|
|
672
|
+
type: "symbol";
|
|
673
|
+
/** Font name */
|
|
674
|
+
font: string;
|
|
675
|
+
/** Character code */
|
|
491
676
|
char: string;
|
|
492
677
|
};
|
|
493
678
|
/**
|
|
494
679
|
* Footnote or endnote reference
|
|
495
680
|
*/
|
|
496
681
|
type NoteReferenceContent = {
|
|
497
|
-
type: "footnoteRef" | "endnoteRef";
|
|
682
|
+
type: "footnoteRef" | "endnoteRef";
|
|
683
|
+
/** Note ID */
|
|
498
684
|
id: number;
|
|
499
685
|
};
|
|
500
686
|
/**
|
|
501
687
|
* Field character (begin/separate/end)
|
|
502
688
|
*/
|
|
503
689
|
type FieldCharContent = {
|
|
504
|
-
type: "fieldChar";
|
|
505
|
-
|
|
506
|
-
|
|
690
|
+
type: "fieldChar";
|
|
691
|
+
/** Field character type */
|
|
692
|
+
charType: "begin" | "separate" | "end";
|
|
693
|
+
/** Field is locked */
|
|
694
|
+
fldLock?: boolean;
|
|
695
|
+
/** Field is dirty (needs update) */
|
|
507
696
|
dirty?: boolean;
|
|
508
697
|
/**
|
|
509
698
|
* Cached display value from a child `<w:numberingChange w:original="…"/>`.
|
|
@@ -518,7 +707,8 @@ type FieldCharContent = {
|
|
|
518
707
|
* Field instruction text
|
|
519
708
|
*/
|
|
520
709
|
type InstrTextContent = {
|
|
521
|
-
type: "instrText";
|
|
710
|
+
type: "instrText";
|
|
711
|
+
/** Field instruction */
|
|
522
712
|
text: string;
|
|
523
713
|
};
|
|
524
714
|
/**
|
|
@@ -541,15 +731,18 @@ type RenderedPageBreakContent = {
|
|
|
541
731
|
* Drawing/image reference
|
|
542
732
|
*/
|
|
543
733
|
type DrawingContent = {
|
|
544
|
-
type: "drawing";
|
|
545
|
-
|
|
734
|
+
type: "drawing";
|
|
735
|
+
/** Image data */
|
|
736
|
+
image: Image;
|
|
737
|
+
/** Original OOXML for package-preserving round-trips of unsupported drawing markup. */
|
|
546
738
|
rawXml?: string;
|
|
547
739
|
};
|
|
548
740
|
/**
|
|
549
741
|
* Shape reference
|
|
550
742
|
*/
|
|
551
743
|
type ShapeContent = {
|
|
552
|
-
type: "shape";
|
|
744
|
+
type: "shape";
|
|
745
|
+
/** Shape data */
|
|
553
746
|
shape: Shape;
|
|
554
747
|
};
|
|
555
748
|
/**
|
|
@@ -560,32 +753,46 @@ type RunContent = TextContent | TabContent | BreakContent | SymbolContent | Note
|
|
|
560
753
|
* A run is a contiguous region of text with the same formatting
|
|
561
754
|
*/
|
|
562
755
|
type Run = {
|
|
563
|
-
type: "run";
|
|
564
|
-
|
|
565
|
-
|
|
756
|
+
type: "run";
|
|
757
|
+
/** Text formatting properties */
|
|
758
|
+
formatting?: TextFormatting;
|
|
759
|
+
/** Run-level tracked property changes (w:rPrChange) */
|
|
760
|
+
propertyChanges?: RunPropertyChange[];
|
|
761
|
+
/** Run content (text, tabs, breaks, etc.) */
|
|
566
762
|
content: RunContent[];
|
|
567
763
|
};
|
|
568
764
|
/**
|
|
569
765
|
* Hyperlink (w:hyperlink)
|
|
570
766
|
*/
|
|
571
767
|
type Hyperlink = {
|
|
572
|
-
type: "hyperlink";
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
768
|
+
type: "hyperlink";
|
|
769
|
+
/** Relationship ID for external link */
|
|
770
|
+
rId?: string;
|
|
771
|
+
/** Resolved URL (from relationships) */
|
|
772
|
+
href?: string;
|
|
773
|
+
/** Internal bookmark anchor */
|
|
774
|
+
anchor?: string;
|
|
775
|
+
/** Tooltip text */
|
|
776
|
+
tooltip?: string;
|
|
777
|
+
/** Target frame */
|
|
778
|
+
target?: string;
|
|
779
|
+
/** Link history tracking */
|
|
780
|
+
history?: boolean;
|
|
781
|
+
/** Document location */
|
|
782
|
+
docLocation?: string;
|
|
783
|
+
/** Child runs */
|
|
580
784
|
children: (Run | BookmarkStart | BookmarkEnd)[];
|
|
581
785
|
};
|
|
582
786
|
/**
|
|
583
787
|
* Bookmark start marker (w:bookmarkStart)
|
|
584
788
|
*/
|
|
585
789
|
type BookmarkStart = {
|
|
586
|
-
type: "bookmarkStart";
|
|
587
|
-
|
|
588
|
-
|
|
790
|
+
type: "bookmarkStart";
|
|
791
|
+
/** Bookmark ID */
|
|
792
|
+
id: number;
|
|
793
|
+
/** Bookmark name */
|
|
794
|
+
name: string;
|
|
795
|
+
/** Column index for table bookmarks */
|
|
589
796
|
colFirst?: number;
|
|
590
797
|
colLast?: number;
|
|
591
798
|
};
|
|
@@ -593,7 +800,8 @@ type BookmarkStart = {
|
|
|
593
800
|
* Bookmark end marker (w:bookmarkEnd)
|
|
594
801
|
*/
|
|
595
802
|
type BookmarkEnd = {
|
|
596
|
-
type: "bookmarkEnd";
|
|
803
|
+
type: "bookmarkEnd";
|
|
804
|
+
/** Bookmark ID */
|
|
597
805
|
id: number;
|
|
598
806
|
};
|
|
599
807
|
/**
|
|
@@ -604,21 +812,30 @@ type FieldType = "PAGE" | "NUMPAGES" | "NUMWORDS" | "NUMCHARS" | "DATE" | "TIME"
|
|
|
604
812
|
* Simple field (w:fldSimple)
|
|
605
813
|
*/
|
|
606
814
|
type SimpleField = {
|
|
607
|
-
type: "simpleField";
|
|
608
|
-
instruction
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
815
|
+
type: "simpleField";
|
|
816
|
+
/** Field instruction (e.g., "PAGE \\* MERGEFORMAT") */
|
|
817
|
+
instruction: string;
|
|
818
|
+
/** Parsed field type */
|
|
819
|
+
fieldType: FieldType;
|
|
820
|
+
/** Current display value */
|
|
821
|
+
content: (Run | Hyperlink)[];
|
|
822
|
+
/** Field is locked */
|
|
823
|
+
fldLock?: boolean;
|
|
824
|
+
/** Field is dirty */
|
|
612
825
|
dirty?: boolean;
|
|
613
826
|
};
|
|
614
827
|
/**
|
|
615
828
|
* Complex field (w:fldChar begin/separate/end with w:instrText)
|
|
616
829
|
*/
|
|
617
830
|
type ComplexField = {
|
|
618
|
-
type: "complexField";
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
831
|
+
type: "complexField";
|
|
832
|
+
/** Field instruction */
|
|
833
|
+
instruction: string;
|
|
834
|
+
/** Parsed field type */
|
|
835
|
+
fieldType: FieldType;
|
|
836
|
+
/** Field code runs */
|
|
837
|
+
fieldCode: Run[];
|
|
838
|
+
/** Display result runs */
|
|
622
839
|
fieldResult: Run[];
|
|
623
840
|
/**
|
|
624
841
|
* Run formatting captured from the field's structural run(s) (`w:rPr` on the
|
|
@@ -626,8 +843,10 @@ type ComplexField = {
|
|
|
626
843
|
* no separate result run to read it from, e.g. a footer `PAGE` number whose
|
|
627
844
|
* formatting lives on the field run (eigenpal/docx-editor#909).
|
|
628
845
|
*/
|
|
629
|
-
formatting?: TextFormatting;
|
|
630
|
-
|
|
846
|
+
formatting?: TextFormatting;
|
|
847
|
+
/** Field is locked */
|
|
848
|
+
fldLock?: boolean;
|
|
849
|
+
/** Field is dirty */
|
|
631
850
|
dirty?: boolean;
|
|
632
851
|
};
|
|
633
852
|
type Field = SimpleField | ComplexField;
|
|
@@ -635,15 +854,19 @@ type Field = SimpleField | ComplexField;
|
|
|
635
854
|
* Image size specification
|
|
636
855
|
*/
|
|
637
856
|
type ImageSize = {
|
|
638
|
-
/** Width in EMUs (English Metric Units) */
|
|
857
|
+
/** Width in EMUs (English Metric Units) */
|
|
858
|
+
width: number;
|
|
859
|
+
/** Height in EMUs */
|
|
639
860
|
height: number;
|
|
640
861
|
};
|
|
641
862
|
/**
|
|
642
863
|
* Image wrap type for floating images
|
|
643
864
|
*/
|
|
644
865
|
type ImageWrap = {
|
|
645
|
-
type: "inline" | "square" | "tight" | "through" | "topAndBottom" | "behind" | "inFront";
|
|
646
|
-
|
|
866
|
+
type: "inline" | "square" | "tight" | "through" | "topAndBottom" | "behind" | "inFront";
|
|
867
|
+
/** Wrap text direction */
|
|
868
|
+
wrapText?: "bothSides" | "left" | "right" | "largest";
|
|
869
|
+
/** Distance from text */
|
|
647
870
|
distT?: number;
|
|
648
871
|
distB?: number;
|
|
649
872
|
distL?: number;
|
|
@@ -653,11 +876,13 @@ type ImageWrap = {
|
|
|
653
876
|
* Position for floating images
|
|
654
877
|
*/
|
|
655
878
|
type ImagePosition = {
|
|
656
|
-
/** Horizontal positioning */
|
|
879
|
+
/** Horizontal positioning */
|
|
880
|
+
horizontal: {
|
|
657
881
|
relativeTo: "character" | "column" | "insideMargin" | "leftMargin" | "margin" | "outsideMargin" | "page" | "rightMargin";
|
|
658
882
|
alignment?: "left" | "right" | "center" | "inside" | "outside";
|
|
659
883
|
posOffset?: number;
|
|
660
|
-
};
|
|
884
|
+
};
|
|
885
|
+
/** Vertical positioning */
|
|
661
886
|
vertical: {
|
|
662
887
|
relativeTo: "insideMargin" | "line" | "margin" | "outsideMargin" | "page" | "paragraph" | "topMargin" | "bottomMargin";
|
|
663
888
|
alignment?: "top" | "bottom" | "center" | "inside" | "outside";
|
|
@@ -668,8 +893,11 @@ type ImagePosition = {
|
|
|
668
893
|
* Image transformation
|
|
669
894
|
*/
|
|
670
895
|
type ImageTransform = {
|
|
671
|
-
/** Rotation in degrees */
|
|
672
|
-
|
|
896
|
+
/** Rotation in degrees */
|
|
897
|
+
rotation?: number;
|
|
898
|
+
/** Flip horizontal */
|
|
899
|
+
flipH?: boolean;
|
|
900
|
+
/** Flip vertical */
|
|
673
901
|
flipV?: boolean;
|
|
674
902
|
};
|
|
675
903
|
/**
|
|
@@ -698,20 +926,36 @@ type ImageCrop = {
|
|
|
698
926
|
* Embedded image (w:drawing)
|
|
699
927
|
*/
|
|
700
928
|
type Image = {
|
|
701
|
-
type: "image";
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
929
|
+
type: "image";
|
|
930
|
+
/** Unique ID */
|
|
931
|
+
id?: string;
|
|
932
|
+
/** Relationship ID for the image data */
|
|
933
|
+
rId: string;
|
|
934
|
+
/** Resolved image data (base64 or blob URL) */
|
|
935
|
+
src?: string;
|
|
936
|
+
/** Image MIME type */
|
|
937
|
+
mimeType?: string;
|
|
938
|
+
/** Original filename */
|
|
939
|
+
filename?: string;
|
|
940
|
+
/** Authored non-visual drawing name (`wp:docPr@name`) */
|
|
941
|
+
docPrName?: string;
|
|
942
|
+
/** Alt text for accessibility */
|
|
943
|
+
alt?: string;
|
|
944
|
+
/** Authored non-visual drawing title (`wp:docPr@title`) */
|
|
945
|
+
title?: string;
|
|
946
|
+
/** Image size */
|
|
947
|
+
size: ImageSize;
|
|
948
|
+
/** Original size before any transforms */
|
|
949
|
+
originalSize?: ImageSize;
|
|
950
|
+
/** Wrap settings */
|
|
951
|
+
wrap: ImageWrap;
|
|
952
|
+
/** Position for floating images */
|
|
953
|
+
position?: ImagePosition;
|
|
954
|
+
/** Image transformations */
|
|
955
|
+
transform?: ImageTransform;
|
|
956
|
+
/** Padding around image */
|
|
957
|
+
padding?: ImagePadding;
|
|
958
|
+
/** Source-bitmap crop (wp:srcRect), eigenpal #424 */
|
|
715
959
|
crop?: ImageCrop;
|
|
716
960
|
/**
|
|
717
961
|
* Opacity in [0, 1] (OOXML `a:alphaModFix amt`). Undefined or `1` means
|
|
@@ -731,10 +975,16 @@ type Image = {
|
|
|
731
975
|
* don't currently reposition, but we round-trip the flag so saving
|
|
732
976
|
* preserves the author's intent; undefined means "use the spec default".
|
|
733
977
|
*/
|
|
734
|
-
allowOverlap?: boolean;
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
978
|
+
allowOverlap?: boolean;
|
|
979
|
+
/** Whether this is a decorative image */
|
|
980
|
+
decorative?: boolean;
|
|
981
|
+
/** Hyperlink URL for clickable image */
|
|
982
|
+
hlinkHref?: string;
|
|
983
|
+
/** Relationship ID for the clickable image hyperlink */
|
|
984
|
+
hlinkRId?: string;
|
|
985
|
+
/** Image outline/border */
|
|
986
|
+
outline?: ShapeOutline;
|
|
987
|
+
/** Image effects */
|
|
738
988
|
effects?: {
|
|
739
989
|
brightness?: number;
|
|
740
990
|
contrast?: number;
|
|
@@ -749,8 +999,10 @@ type ShapeType = "rect" | "roundRect" | "ellipse" | "triangle" | "rtTriangle" |
|
|
|
749
999
|
* Shape fill type
|
|
750
1000
|
*/
|
|
751
1001
|
type ShapeFill = {
|
|
752
|
-
type: "none" | "solid" | "gradient" | "pattern" | "picture";
|
|
753
|
-
|
|
1002
|
+
type: "none" | "solid" | "gradient" | "pattern" | "picture";
|
|
1003
|
+
/** Solid fill color */
|
|
1004
|
+
color?: ColorValue;
|
|
1005
|
+
/** Gradient stops for gradient fill */
|
|
754
1006
|
gradient?: {
|
|
755
1007
|
type: "linear" | "radial" | "rectangular" | "path";
|
|
756
1008
|
angle?: number;
|
|
@@ -764,16 +1016,23 @@ type ShapeFill = {
|
|
|
764
1016
|
* Shape outline/stroke
|
|
765
1017
|
*/
|
|
766
1018
|
type ShapeOutline = {
|
|
767
|
-
/** Line width in EMUs */
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
1019
|
+
/** Line width in EMUs */
|
|
1020
|
+
width?: number;
|
|
1021
|
+
/** Line color */
|
|
1022
|
+
color?: ColorValue;
|
|
1023
|
+
/** Line style */
|
|
1024
|
+
style?: "solid" | "dot" | "dash" | "lgDash" | "dashDot" | "lgDashDot" | "lgDashDotDot" | "sysDot" | "sysDash" | "sysDashDot" | "sysDashDotDot";
|
|
1025
|
+
/** Line cap */
|
|
1026
|
+
cap?: "flat" | "round" | "square";
|
|
1027
|
+
/** Line join */
|
|
1028
|
+
join?: "bevel" | "miter" | "round";
|
|
1029
|
+
/** Head arrow */
|
|
772
1030
|
headEnd?: {
|
|
773
1031
|
type: "none" | "triangle" | "stealth" | "diamond" | "oval" | "arrow";
|
|
774
1032
|
width?: "sm" | "med" | "lg";
|
|
775
1033
|
length?: "sm" | "med" | "lg";
|
|
776
|
-
};
|
|
1034
|
+
};
|
|
1035
|
+
/** Tail arrow */
|
|
777
1036
|
tailEnd?: {
|
|
778
1037
|
type: "none" | "triangle" | "stealth" | "diamond" | "oval" | "arrow";
|
|
779
1038
|
width?: "sm" | "med" | "lg";
|
|
@@ -784,49 +1043,76 @@ type ShapeOutline = {
|
|
|
784
1043
|
* Text body inside a shape
|
|
785
1044
|
*/
|
|
786
1045
|
type ShapeTextBody = {
|
|
787
|
-
/** Text direction */
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
1046
|
+
/** Text direction */
|
|
1047
|
+
vertical?: boolean;
|
|
1048
|
+
/** Rotation */
|
|
1049
|
+
rotation?: number;
|
|
1050
|
+
/** Anchor/vertical alignment */
|
|
1051
|
+
anchor?: "top" | "middle" | "bottom" | "distributed" | "justified";
|
|
1052
|
+
/** Anchor center */
|
|
1053
|
+
anchorCenter?: boolean;
|
|
1054
|
+
/** Auto fit */
|
|
1055
|
+
autoFit?: "none" | "normal" | "shape";
|
|
1056
|
+
/** Text margins */
|
|
792
1057
|
margins?: {
|
|
793
1058
|
top?: number;
|
|
794
1059
|
bottom?: number;
|
|
795
1060
|
left?: number;
|
|
796
1061
|
right?: number;
|
|
797
|
-
};
|
|
1062
|
+
};
|
|
1063
|
+
/** Block content inside the shape */
|
|
798
1064
|
content: (Paragraph | Table)[];
|
|
799
1065
|
};
|
|
800
1066
|
/**
|
|
801
1067
|
* Shape/drawing object (wps:wsp)
|
|
802
1068
|
*/
|
|
803
1069
|
type Shape = {
|
|
804
|
-
type: "shape";
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
1070
|
+
type: "shape";
|
|
1071
|
+
/** Shape type preset */
|
|
1072
|
+
shapeType: ShapeType;
|
|
1073
|
+
/** Unique ID */
|
|
1074
|
+
id?: string;
|
|
1075
|
+
/** Name */
|
|
1076
|
+
name?: string;
|
|
1077
|
+
/** Size in EMUs */
|
|
1078
|
+
size: ImageSize;
|
|
1079
|
+
/** Position for floating shapes */
|
|
1080
|
+
position?: ImagePosition;
|
|
1081
|
+
/** Wrap settings */
|
|
1082
|
+
wrap?: ImageWrap;
|
|
1083
|
+
/** Fill */
|
|
1084
|
+
fill?: ShapeFill;
|
|
1085
|
+
/** Outline/stroke */
|
|
1086
|
+
outline?: ShapeOutline;
|
|
1087
|
+
/** Transform */
|
|
1088
|
+
transform?: ImageTransform;
|
|
1089
|
+
/** Text content inside the shape */
|
|
1090
|
+
textBody?: ShapeTextBody;
|
|
1091
|
+
/** Custom geometry points */
|
|
815
1092
|
customGeometry?: string;
|
|
816
1093
|
};
|
|
817
1094
|
/**
|
|
818
1095
|
* Text box (floating text container)
|
|
819
1096
|
*/
|
|
820
1097
|
type TextBox = {
|
|
821
|
-
type: "textBox";
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
1098
|
+
type: "textBox";
|
|
1099
|
+
/** Unique ID */
|
|
1100
|
+
id?: string;
|
|
1101
|
+
/** Size */
|
|
1102
|
+
size: ImageSize;
|
|
1103
|
+
/** Position */
|
|
1104
|
+
position?: ImagePosition;
|
|
1105
|
+
/** Wrap settings */
|
|
1106
|
+
wrap?: ImageWrap;
|
|
1107
|
+
/** Fill */
|
|
1108
|
+
fill?: ShapeFill;
|
|
1109
|
+
/** Outline */
|
|
1110
|
+
outline?: ShapeOutline;
|
|
1111
|
+
/** Text and table content */
|
|
1112
|
+
content: (Paragraph | Table)[];
|
|
1113
|
+
/** Text fitting behavior */
|
|
1114
|
+
autoFit?: ShapeTextBody["autoFit"];
|
|
1115
|
+
/** Internal margins */
|
|
830
1116
|
margins?: {
|
|
831
1117
|
top?: number;
|
|
832
1118
|
bottom?: number;
|
|
@@ -838,42 +1124,61 @@ type TextBox = {
|
|
|
838
1124
|
* Table cell
|
|
839
1125
|
*/
|
|
840
1126
|
type TableCell = {
|
|
841
|
-
type: "tableCell";
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
1127
|
+
type: "tableCell";
|
|
1128
|
+
/** Cell formatting */
|
|
1129
|
+
formatting?: TableCellFormatting;
|
|
1130
|
+
/** Cell-level tracked property changes (w:tcPrChange) */
|
|
1131
|
+
propertyChanges?: TableCellPropertyChange[];
|
|
1132
|
+
/** Tracked structural changes (cell insert/delete/merge) */
|
|
1133
|
+
structuralChange?: TableStructuralChangeInfo;
|
|
1134
|
+
/** Cell content (paragraphs, tables, etc.) */
|
|
845
1135
|
content: (Paragraph | Table)[];
|
|
846
1136
|
};
|
|
847
1137
|
/**
|
|
848
1138
|
* Table row
|
|
849
1139
|
*/
|
|
850
1140
|
type TableRow = {
|
|
851
|
-
type: "tableRow";
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
1141
|
+
type: "tableRow";
|
|
1142
|
+
/** Row formatting */
|
|
1143
|
+
formatting?: TableRowFormatting;
|
|
1144
|
+
/** Row-level tracked property changes (w:trPrChange) */
|
|
1145
|
+
propertyChanges?: TableRowPropertyChange[];
|
|
1146
|
+
/** Tracked structural changes (row insert/delete) */
|
|
1147
|
+
structuralChange?: TableStructuralChangeInfo;
|
|
1148
|
+
/** Cells in this row */
|
|
855
1149
|
cells: TableCell[];
|
|
856
1150
|
};
|
|
857
1151
|
/**
|
|
858
1152
|
* Table (w:tbl)
|
|
859
1153
|
*/
|
|
860
1154
|
type Table = {
|
|
861
|
-
type: "table";
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
1155
|
+
type: "table";
|
|
1156
|
+
/** Table formatting */
|
|
1157
|
+
formatting?: TableFormatting;
|
|
1158
|
+
/** Table-level tracked property changes (w:tblPrChange) */
|
|
1159
|
+
propertyChanges?: TablePropertyChange[];
|
|
1160
|
+
/** Column widths in twips */
|
|
1161
|
+
columnWidths?: number[];
|
|
1162
|
+
/** Table rows */
|
|
865
1163
|
rows: TableRow[];
|
|
866
1164
|
};
|
|
867
1165
|
/**
|
|
868
1166
|
* A comment (w:comment) from comments.xml
|
|
869
1167
|
*/
|
|
870
1168
|
type Comment = {
|
|
871
|
-
/** Comment ID (matches commentRangeStart/End) */
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
1169
|
+
/** Comment ID (matches commentRangeStart/End) */
|
|
1170
|
+
id: number;
|
|
1171
|
+
/** Author name */
|
|
1172
|
+
author: string;
|
|
1173
|
+
/** Author initials */
|
|
1174
|
+
initials?: string;
|
|
1175
|
+
/** Date */
|
|
1176
|
+
date?: string;
|
|
1177
|
+
/** Comment content (paragraphs) */
|
|
1178
|
+
content: Paragraph[];
|
|
1179
|
+
/** Parent comment ID (for replies) */
|
|
1180
|
+
parentId?: number;
|
|
1181
|
+
/** Whether the comment is resolved/done */
|
|
877
1182
|
done?: boolean;
|
|
878
1183
|
};
|
|
879
1184
|
/**
|
|
@@ -902,9 +1207,12 @@ type CommentReference = {
|
|
|
902
1207
|
* Math equation content (m:oMath or m:oMathPara)
|
|
903
1208
|
*/
|
|
904
1209
|
type MathEquation = {
|
|
905
|
-
type: "mathEquation";
|
|
906
|
-
|
|
907
|
-
|
|
1210
|
+
type: "mathEquation";
|
|
1211
|
+
/** Whether this is a block (oMathPara) or inline (oMath) equation */
|
|
1212
|
+
display: "inline" | "block";
|
|
1213
|
+
/** Raw OMML XML for round-trip preservation */
|
|
1214
|
+
ommlXml: string;
|
|
1215
|
+
/** Plain text representation for accessibility/fallback */
|
|
908
1216
|
plainText?: string;
|
|
909
1217
|
};
|
|
910
1218
|
/**
|
|
@@ -931,8 +1239,11 @@ declare function normalizeRevisionId(id: number): number;
|
|
|
931
1239
|
* Tracked change metadata (w:ins, w:del attributes)
|
|
932
1240
|
*/
|
|
933
1241
|
type TrackedChangeInfo = {
|
|
934
|
-
/** Revision ID */
|
|
935
|
-
|
|
1242
|
+
/** Revision ID */
|
|
1243
|
+
id: number;
|
|
1244
|
+
/** Author who made the change */
|
|
1245
|
+
author: string;
|
|
1246
|
+
/** Date of the change */
|
|
936
1247
|
date?: string;
|
|
937
1248
|
/**
|
|
938
1249
|
* Author initials (w:initials). Optional attribution used by the review UI
|
|
@@ -944,38 +1255,47 @@ type TrackedChangeInfo = {
|
|
|
944
1255
|
* Generic tracked property-change wrapper metadata (w:*PrChange)
|
|
945
1256
|
*/
|
|
946
1257
|
type PropertyChangeInfo = {
|
|
947
|
-
/** Optional revision session ID */
|
|
1258
|
+
/** Optional revision session ID */
|
|
1259
|
+
rsid?: string;
|
|
948
1260
|
} & TrackedChangeInfo;
|
|
949
1261
|
/**
|
|
950
1262
|
* Insertion wrapper (w:ins) — runs inserted by tracked changes
|
|
951
1263
|
*/
|
|
952
1264
|
type Insertion = {
|
|
953
|
-
type: "insertion";
|
|
954
|
-
|
|
1265
|
+
type: "insertion";
|
|
1266
|
+
/** Tracked change metadata */
|
|
1267
|
+
info: TrackedChangeInfo;
|
|
1268
|
+
/** Inserted content */
|
|
955
1269
|
content: (Run | Hyperlink)[];
|
|
956
1270
|
};
|
|
957
1271
|
/**
|
|
958
1272
|
* Deletion wrapper (w:del) — runs deleted by tracked changes
|
|
959
1273
|
*/
|
|
960
1274
|
type Deletion = {
|
|
961
|
-
type: "deletion";
|
|
962
|
-
|
|
1275
|
+
type: "deletion";
|
|
1276
|
+
/** Tracked change metadata */
|
|
1277
|
+
info: TrackedChangeInfo;
|
|
1278
|
+
/** Deleted content */
|
|
963
1279
|
content: (Run | Hyperlink)[];
|
|
964
1280
|
};
|
|
965
1281
|
/**
|
|
966
1282
|
* Move-from wrapper (w:moveFrom) — content moved away from this position
|
|
967
1283
|
*/
|
|
968
1284
|
type MoveFrom = {
|
|
969
|
-
type: "moveFrom";
|
|
970
|
-
|
|
1285
|
+
type: "moveFrom";
|
|
1286
|
+
/** Tracked change metadata */
|
|
1287
|
+
info: TrackedChangeInfo;
|
|
1288
|
+
/** Moved content */
|
|
971
1289
|
content: (Run | Hyperlink)[];
|
|
972
1290
|
};
|
|
973
1291
|
/**
|
|
974
1292
|
* Move-to wrapper (w:moveTo) — content moved into this position
|
|
975
1293
|
*/
|
|
976
1294
|
type MoveTo = {
|
|
977
|
-
type: "moveTo";
|
|
978
|
-
|
|
1295
|
+
type: "moveTo";
|
|
1296
|
+
/** Tracked change metadata */
|
|
1297
|
+
info: TrackedChangeInfo;
|
|
1298
|
+
/** Moved content */
|
|
979
1299
|
content: (Run | Hyperlink)[];
|
|
980
1300
|
};
|
|
981
1301
|
/**
|
|
@@ -1018,66 +1338,88 @@ type TrackedRunChange = Insertion | Deletion | MoveFrom | MoveTo;
|
|
|
1018
1338
|
* Run property change (w:rPrChange)
|
|
1019
1339
|
*/
|
|
1020
1340
|
type RunPropertyChange = {
|
|
1021
|
-
type: "runPropertyChange";
|
|
1022
|
-
|
|
1023
|
-
|
|
1341
|
+
type: "runPropertyChange";
|
|
1342
|
+
/** Tracked change metadata */
|
|
1343
|
+
info: PropertyChangeInfo;
|
|
1344
|
+
/** Run properties before the tracked change */
|
|
1345
|
+
previousFormatting?: TextFormatting;
|
|
1346
|
+
/** Run properties after the tracked change (editor model convenience) */
|
|
1024
1347
|
currentFormatting?: TextFormatting;
|
|
1025
1348
|
};
|
|
1026
1349
|
/**
|
|
1027
1350
|
* Paragraph property change (w:pPrChange)
|
|
1028
1351
|
*/
|
|
1029
1352
|
type ParagraphPropertyChange = {
|
|
1030
|
-
type: "paragraphPropertyChange";
|
|
1031
|
-
|
|
1032
|
-
|
|
1353
|
+
type: "paragraphPropertyChange";
|
|
1354
|
+
/** Tracked change metadata */
|
|
1355
|
+
info: PropertyChangeInfo;
|
|
1356
|
+
/** Paragraph properties before the tracked change */
|
|
1357
|
+
previousFormatting?: ParagraphFormatting;
|
|
1358
|
+
/** Paragraph properties after the tracked change (editor model convenience) */
|
|
1033
1359
|
currentFormatting?: ParagraphFormatting;
|
|
1034
1360
|
};
|
|
1035
1361
|
/**
|
|
1036
1362
|
* Table property change (w:tblPrChange)
|
|
1037
1363
|
*/
|
|
1038
1364
|
type TablePropertyChange = {
|
|
1039
|
-
type: "tablePropertyChange";
|
|
1040
|
-
|
|
1041
|
-
|
|
1365
|
+
type: "tablePropertyChange";
|
|
1366
|
+
/** Tracked change metadata */
|
|
1367
|
+
info: PropertyChangeInfo;
|
|
1368
|
+
/** Table properties before the tracked change */
|
|
1369
|
+
previousFormatting?: TableFormatting;
|
|
1370
|
+
/** Table properties after the tracked change (editor model convenience) */
|
|
1042
1371
|
currentFormatting?: TableFormatting;
|
|
1043
1372
|
};
|
|
1044
1373
|
/**
|
|
1045
1374
|
* Table row property change (w:trPrChange)
|
|
1046
1375
|
*/
|
|
1047
1376
|
type TableRowPropertyChange = {
|
|
1048
|
-
type: "tableRowPropertyChange";
|
|
1049
|
-
|
|
1050
|
-
|
|
1377
|
+
type: "tableRowPropertyChange";
|
|
1378
|
+
/** Tracked change metadata */
|
|
1379
|
+
info: PropertyChangeInfo;
|
|
1380
|
+
/** Row properties before the tracked change */
|
|
1381
|
+
previousFormatting?: TableRowFormatting;
|
|
1382
|
+
/** Row properties after the tracked change (editor model convenience) */
|
|
1051
1383
|
currentFormatting?: TableRowFormatting;
|
|
1052
1384
|
};
|
|
1053
1385
|
/**
|
|
1054
1386
|
* Table cell property change (w:tcPrChange)
|
|
1055
1387
|
*/
|
|
1056
1388
|
type TableCellPropertyChange = {
|
|
1057
|
-
type: "tableCellPropertyChange";
|
|
1058
|
-
|
|
1059
|
-
|
|
1389
|
+
type: "tableCellPropertyChange";
|
|
1390
|
+
/** Tracked change metadata */
|
|
1391
|
+
info: PropertyChangeInfo;
|
|
1392
|
+
/** Cell properties before the tracked change */
|
|
1393
|
+
previousFormatting?: TableCellFormatting;
|
|
1394
|
+
/** Cell properties after the tracked change (editor model convenience) */
|
|
1060
1395
|
currentFormatting?: TableCellFormatting;
|
|
1061
1396
|
};
|
|
1062
1397
|
/**
|
|
1063
1398
|
* Section property change (w:sectPrChange)
|
|
1064
1399
|
*/
|
|
1065
1400
|
type SectionPropertyChange = {
|
|
1066
|
-
type: "sectionPropertyChange";
|
|
1067
|
-
|
|
1068
|
-
|
|
1401
|
+
type: "sectionPropertyChange";
|
|
1402
|
+
/** Tracked change metadata */
|
|
1403
|
+
info: PropertyChangeInfo;
|
|
1404
|
+
/** Section properties before the tracked change */
|
|
1405
|
+
previousProperties?: SectionProperties;
|
|
1406
|
+
/** Section properties after the tracked change (editor model convenience) */
|
|
1069
1407
|
currentProperties?: SectionProperties;
|
|
1070
1408
|
};
|
|
1071
1409
|
/**
|
|
1072
1410
|
* Table structural tracked change metadata (row/cell insert/delete/merge)
|
|
1073
1411
|
*/
|
|
1074
1412
|
type TableStructuralChangeInfo = {
|
|
1075
|
-
type: "tableRowInsertion" | "tableRowDeletion" | "tableCellInsertion" | "tableCellDeletion";
|
|
1413
|
+
type: "tableRowInsertion" | "tableRowDeletion" | "tableCellInsertion" | "tableCellDeletion";
|
|
1414
|
+
/** Tracked change metadata */
|
|
1076
1415
|
info: TrackedChangeInfo;
|
|
1077
1416
|
} | {
|
|
1078
|
-
type: "tableCellMerge";
|
|
1079
|
-
|
|
1080
|
-
|
|
1417
|
+
type: "tableCellMerge";
|
|
1418
|
+
/** Tracked change metadata */
|
|
1419
|
+
info: TrackedChangeInfo;
|
|
1420
|
+
/** Vertical merge state applied by the revision. */
|
|
1421
|
+
verticalMerge?: "continue" | "rest";
|
|
1422
|
+
/** Vertical merge state that existed before the revision. */
|
|
1081
1423
|
verticalMergeOriginal?: "continue" | "rest";
|
|
1082
1424
|
};
|
|
1083
1425
|
/**
|
|
@@ -1096,17 +1438,24 @@ type SdtType = "richText" | "plainText" | "date" | "dropdown" | "comboBox" | "ch
|
|
|
1096
1438
|
* `w:sdtEndPr`) lossless.
|
|
1097
1439
|
*/
|
|
1098
1440
|
type SdtProperties = {
|
|
1099
|
-
/** SDT type (projection; round-trip uses `rawPropertiesXml`). */
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1441
|
+
/** SDT type (projection; round-trip uses `rawPropertiesXml`). */
|
|
1442
|
+
sdtType: SdtType;
|
|
1443
|
+
/** Numeric id (`w:id/@w:val`). */
|
|
1444
|
+
id?: number;
|
|
1445
|
+
/** Alias (friendly name, `w:alias`). */
|
|
1446
|
+
alias?: string;
|
|
1447
|
+
/** Tag (developer identifier, `w:tag`). */
|
|
1448
|
+
tag?: string;
|
|
1449
|
+
/** Lock setting (`w:lock`). */
|
|
1103
1450
|
lock?: "sdtLocked" | "contentLocked" | "sdtContentLocked" | "unlocked";
|
|
1104
1451
|
/**
|
|
1105
1452
|
* Placeholder building-block name (`w:placeholder/w:docPart@w:val`) — a
|
|
1106
1453
|
* reference to a glossary docPart, not the literal placeholder text.
|
|
1107
1454
|
*/
|
|
1108
|
-
placeholder?: string;
|
|
1109
|
-
|
|
1455
|
+
placeholder?: string;
|
|
1456
|
+
/** Whether the placeholder is currently shown (`w:showingPlcHdr`). */
|
|
1457
|
+
showingPlaceholder?: boolean;
|
|
1458
|
+
/** Date display format (`w:date/w:dateFormat@w:val`). */
|
|
1110
1459
|
dateFormat?: string;
|
|
1111
1460
|
/**
|
|
1112
1461
|
* Bound date value (`w:date/@w:fullDate`), ISO 8601. Independent of
|
|
@@ -1114,7 +1463,8 @@ type SdtProperties = {
|
|
|
1114
1463
|
* formatted version like "2 June 2026" while this stays as
|
|
1115
1464
|
* `2026-06-02T00:00:00Z` so Word's date binding round-trips losslessly.
|
|
1116
1465
|
*/
|
|
1117
|
-
dateValueISO?: string;
|
|
1466
|
+
dateValueISO?: string;
|
|
1467
|
+
/** Dropdown/combobox list items. */
|
|
1118
1468
|
listItems?: {
|
|
1119
1469
|
displayText: string;
|
|
1120
1470
|
value: string;
|
|
@@ -1126,14 +1476,16 @@ type SdtProperties = {
|
|
|
1126
1476
|
* matching the body's display text against `listItems`, which picked
|
|
1127
1477
|
* the wrong entry when two items shared a `displayText`.
|
|
1128
1478
|
*/
|
|
1129
|
-
dropdownLastValue?: string;
|
|
1479
|
+
dropdownLastValue?: string;
|
|
1480
|
+
/** Checkbox checked state (`w14:checkbox/w14:checked`). */
|
|
1130
1481
|
checked?: boolean;
|
|
1131
1482
|
/**
|
|
1132
1483
|
* Verbatim `<w:sdtPr>…</w:sdtPr>` captured at parse time. Replayed on
|
|
1133
1484
|
* serialize so unmodeled OOXML features (data binding, repeating sections,
|
|
1134
1485
|
* `@lastValue`, custom XML mappings) survive round-trip.
|
|
1135
1486
|
*/
|
|
1136
|
-
rawPropertiesXml?: string;
|
|
1487
|
+
rawPropertiesXml?: string;
|
|
1488
|
+
/** Verbatim `<w:sdtEndPr>…</w:sdtEndPr>` captured at parse time. */
|
|
1137
1489
|
rawEndPropertiesXml?: string;
|
|
1138
1490
|
/**
|
|
1139
1491
|
* Verbatim XML for any non-content direct children of `<w:sdt>` that
|
|
@@ -1144,7 +1496,8 @@ type SdtProperties = {
|
|
|
1144
1496
|
* changes that span an SDT boundary round-trip without losing a
|
|
1145
1497
|
* delimiter.
|
|
1146
1498
|
*/
|
|
1147
|
-
rawSdtChildrenBeforeContent?: string;
|
|
1499
|
+
rawSdtChildrenBeforeContent?: string;
|
|
1500
|
+
/** Verbatim XML for non-content sdt children that appear AFTER `<w:sdtContent>`. */
|
|
1148
1501
|
rawSdtChildrenAfterContent?: string;
|
|
1149
1502
|
};
|
|
1150
1503
|
/**
|
|
@@ -1156,8 +1509,10 @@ type SdtProperties = {
|
|
|
1156
1509
|
* content do not lose their wrapper on round-trip.
|
|
1157
1510
|
*/
|
|
1158
1511
|
type InlineSdt = {
|
|
1159
|
-
type: "inlineSdt";
|
|
1160
|
-
|
|
1512
|
+
type: "inlineSdt";
|
|
1513
|
+
/** SDT properties */
|
|
1514
|
+
properties: SdtProperties;
|
|
1515
|
+
/** Inline content held inside the control */
|
|
1161
1516
|
content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | Insertion | Deletion | MoveFrom | MoveTo | MathEquation)[];
|
|
1162
1517
|
};
|
|
1163
1518
|
/**
|
|
@@ -1168,8 +1523,10 @@ type InlineSdt = {
|
|
|
1168
1523
|
* whose row is itself a content control.
|
|
1169
1524
|
*/
|
|
1170
1525
|
type BlockSdt = {
|
|
1171
|
-
type: "blockSdt";
|
|
1172
|
-
properties
|
|
1526
|
+
type: "blockSdt";
|
|
1527
|
+
/** SDT properties (raw XML in `properties.rawPropertiesXml` round-trips losslessly). */
|
|
1528
|
+
properties: SdtProperties;
|
|
1529
|
+
/** Block content inside the control. */
|
|
1173
1530
|
content: BlockContent[];
|
|
1174
1531
|
};
|
|
1175
1532
|
/**
|
|
@@ -1193,15 +1550,24 @@ type ParagraphMarkChange = {
|
|
|
1193
1550
|
info: TrackedChangeInfo;
|
|
1194
1551
|
};
|
|
1195
1552
|
type Paragraph = {
|
|
1196
|
-
type: "paragraph";
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1553
|
+
type: "paragraph";
|
|
1554
|
+
/** Unique paragraph ID */
|
|
1555
|
+
paraId?: string;
|
|
1556
|
+
/** Text ID */
|
|
1557
|
+
textId?: string;
|
|
1558
|
+
/** Paragraph formatting */
|
|
1559
|
+
formatting?: ParagraphFormatting;
|
|
1560
|
+
/** Paragraph-level tracked property changes (w:pPrChange) */
|
|
1561
|
+
propertyChanges?: ParagraphPropertyChange[];
|
|
1562
|
+
/** Paragraph-mark insertion / deletion (w:pPr / w:rPr / w:ins | w:del) */
|
|
1563
|
+
pPrMark?: ParagraphMarkChange;
|
|
1564
|
+
/** Paragraph content */
|
|
1565
|
+
content: ParagraphContent[];
|
|
1566
|
+
/** Computed list rendering (if this is a list item) */
|
|
1567
|
+
listRendering?: ListRendering;
|
|
1568
|
+
/** Word's cached layout says this paragraph started on a new rendered page. */
|
|
1569
|
+
renderedPageBreakBefore?: boolean;
|
|
1570
|
+
/** Section properties (if this paragraph ends a section) */
|
|
1205
1571
|
sectionProperties?: SectionProperties;
|
|
1206
1572
|
};
|
|
1207
1573
|
/**
|
|
@@ -1223,8 +1589,10 @@ type FooterReference = {
|
|
|
1223
1589
|
* Header or footer content
|
|
1224
1590
|
*/
|
|
1225
1591
|
type HeaderFooter = {
|
|
1226
|
-
type: "header" | "footer";
|
|
1227
|
-
|
|
1592
|
+
type: "header" | "footer";
|
|
1593
|
+
/** Header/footer type */
|
|
1594
|
+
hdrFtrType: HeaderFooterType;
|
|
1595
|
+
/** Content (paragraphs, tables, block-level content controls). */
|
|
1228
1596
|
content: BlockContent[];
|
|
1229
1597
|
/**
|
|
1230
1598
|
* Document watermark detected in this header part. Word emits
|
|
@@ -1258,8 +1626,10 @@ type HeaderFooter = {
|
|
|
1258
1626
|
*/
|
|
1259
1627
|
type Watermark = TextWatermark | PictureWatermark;
|
|
1260
1628
|
type TextWatermark = {
|
|
1261
|
-
kind: "text";
|
|
1262
|
-
|
|
1629
|
+
kind: "text";
|
|
1630
|
+
/** Visible string. Required. */
|
|
1631
|
+
text: string;
|
|
1632
|
+
/** Font family. Word's default is Calibri. */
|
|
1263
1633
|
font?: string;
|
|
1264
1634
|
/**
|
|
1265
1635
|
* Hex color (`"C0C0C0"`), `"auto"`, or `undefined` for the producer
|
|
@@ -1280,7 +1650,8 @@ type TextWatermark = {
|
|
|
1280
1650
|
opacity?: number;
|
|
1281
1651
|
};
|
|
1282
1652
|
type PictureWatermark = {
|
|
1283
|
-
kind: "picture";
|
|
1653
|
+
kind: "picture";
|
|
1654
|
+
/** Relationship id of the image part in `word/_rels/header*.xml.rels`. */
|
|
1284
1655
|
imageRId: string;
|
|
1285
1656
|
/**
|
|
1286
1657
|
* Stable identity of the image the `imageRId` resolved to in the header it
|
|
@@ -1296,7 +1667,8 @@ type PictureWatermark = {
|
|
|
1296
1667
|
* When true, {@link imageTarget} is an external (linked) URL written back
|
|
1297
1668
|
* with `TargetMode="External"`, not an embedded package path.
|
|
1298
1669
|
*/
|
|
1299
|
-
imageTargetExternal?: boolean;
|
|
1670
|
+
imageTargetExternal?: boolean;
|
|
1671
|
+
/** Optional scale factor (1.0 = native, 0.5 = half-size). */
|
|
1300
1672
|
scale?: number;
|
|
1301
1673
|
/**
|
|
1302
1674
|
* Display width in points from the VML shape, captured at parse so the
|
|
@@ -1305,7 +1677,8 @@ type PictureWatermark = {
|
|
|
1305
1677
|
* non-2:1 image). Absent for synthesized watermarks, which fall back to
|
|
1306
1678
|
* Word's default box scaled by `scale`.
|
|
1307
1679
|
*/
|
|
1308
|
-
widthPt?: number;
|
|
1680
|
+
widthPt?: number;
|
|
1681
|
+
/** Display height in points from the VML shape. See {@link widthPt}. */
|
|
1309
1682
|
heightPt?: number;
|
|
1310
1683
|
/**
|
|
1311
1684
|
* Whether Word's "washout" effect was applied (low contrast).
|
|
@@ -1348,8 +1721,10 @@ type EndnoteProperties = {
|
|
|
1348
1721
|
* Footnote (w:footnote)
|
|
1349
1722
|
*/
|
|
1350
1723
|
type Footnote = {
|
|
1351
|
-
type: "footnote";
|
|
1352
|
-
|
|
1724
|
+
type: "footnote";
|
|
1725
|
+
/** Footnote ID */
|
|
1726
|
+
id: number;
|
|
1727
|
+
/** Special footnote type */
|
|
1353
1728
|
noteType?: "normal" | "separator" | "continuationSeparator" | "continuationNotice";
|
|
1354
1729
|
/**
|
|
1355
1730
|
* Content. Note bodies may carry block-level `<w:sdt>` content
|
|
@@ -1364,8 +1739,10 @@ type Footnote = {
|
|
|
1364
1739
|
* Endnote (w:endnote)
|
|
1365
1740
|
*/
|
|
1366
1741
|
type Endnote = {
|
|
1367
|
-
type: "endnote";
|
|
1368
|
-
|
|
1742
|
+
type: "endnote";
|
|
1743
|
+
/** Endnote ID */
|
|
1744
|
+
id: number;
|
|
1745
|
+
/** Special endnote type */
|
|
1369
1746
|
noteType?: "normal" | "separator" | "continuationSeparator" | "continuationNotice";
|
|
1370
1747
|
/**
|
|
1371
1748
|
* Content. Like `Footnote.content`, may carry block-level `<w:sdt>`
|
|
@@ -1393,7 +1770,9 @@ type LineNumberRestart = "continuous" | "newPage" | "newSection";
|
|
|
1393
1770
|
* Column definition
|
|
1394
1771
|
*/
|
|
1395
1772
|
type Column = {
|
|
1396
|
-
/** Column width in twips */
|
|
1773
|
+
/** Column width in twips */
|
|
1774
|
+
width?: number;
|
|
1775
|
+
/** Space after column in twips */
|
|
1397
1776
|
space?: number;
|
|
1398
1777
|
};
|
|
1399
1778
|
/**
|
|
@@ -1401,70 +1780,111 @@ type Column = {
|
|
|
1401
1780
|
*/
|
|
1402
1781
|
type SectionTextDirection = "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | "tbLrV" | "tb" | "rl" | "lr" | "tbV" | "rlV" | "lrV";
|
|
1403
1782
|
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
|
-
|
|
1783
|
+
/** Page width in twips */
|
|
1784
|
+
pageWidth?: number;
|
|
1785
|
+
/** Page height in twips */
|
|
1786
|
+
pageHeight?: number;
|
|
1787
|
+
/** Page orientation */
|
|
1788
|
+
orientation?: PageOrientation;
|
|
1789
|
+
/** Top margin in twips */
|
|
1790
|
+
marginTop?: number;
|
|
1791
|
+
/** Bottom margin in twips */
|
|
1792
|
+
marginBottom?: number;
|
|
1793
|
+
/** Left margin in twips */
|
|
1794
|
+
marginLeft?: number;
|
|
1795
|
+
/** Right margin in twips */
|
|
1796
|
+
marginRight?: number;
|
|
1797
|
+
/** Header distance from top in twips */
|
|
1798
|
+
headerDistance?: number;
|
|
1799
|
+
/** Footer distance from bottom in twips */
|
|
1800
|
+
footerDistance?: number;
|
|
1801
|
+
/** Gutter margin in twips */
|
|
1802
|
+
gutter?: number;
|
|
1803
|
+
/** Number of columns */
|
|
1804
|
+
columnCount?: number;
|
|
1805
|
+
/** Space between columns in twips */
|
|
1806
|
+
columnSpace?: number;
|
|
1807
|
+
/** Equal width columns */
|
|
1808
|
+
equalWidth?: boolean;
|
|
1809
|
+
/** Separator line between columns */
|
|
1810
|
+
separator?: boolean;
|
|
1811
|
+
/** Individual column definitions */
|
|
1812
|
+
columns?: Column[];
|
|
1813
|
+
/** Section start type */
|
|
1814
|
+
sectionStart?: SectionStart;
|
|
1815
|
+
/** Vertical alignment of text */
|
|
1816
|
+
verticalAlign?: VerticalAlign;
|
|
1817
|
+
/** Section text direction */
|
|
1818
|
+
textDirection?: SectionTextDirection;
|
|
1819
|
+
/** Right-to-left section */
|
|
1820
|
+
bidi?: boolean;
|
|
1821
|
+
/** Header references */
|
|
1822
|
+
headerReferences?: HeaderReference[];
|
|
1823
|
+
/** Footer references */
|
|
1824
|
+
footerReferences?: FooterReference[];
|
|
1825
|
+
/** Different first page header/footer */
|
|
1826
|
+
titlePg?: boolean;
|
|
1827
|
+
/** Different odd/even page headers/footers */
|
|
1828
|
+
evenAndOddHeaders?: boolean;
|
|
1829
|
+
/** Line numbering settings */
|
|
1427
1830
|
lineNumbers?: {
|
|
1428
1831
|
start?: number;
|
|
1429
1832
|
countBy?: number;
|
|
1430
1833
|
distance?: number;
|
|
1431
1834
|
restart?: LineNumberRestart;
|
|
1432
|
-
};
|
|
1835
|
+
};
|
|
1836
|
+
/** Page numbering settings */
|
|
1433
1837
|
pageNumbering?: {
|
|
1434
1838
|
format?: string;
|
|
1435
1839
|
start?: number;
|
|
1436
1840
|
chapterStyle?: number;
|
|
1437
1841
|
chapterSeparator?: string;
|
|
1438
|
-
};
|
|
1842
|
+
};
|
|
1843
|
+
/** Page borders */
|
|
1439
1844
|
pageBorders?: {
|
|
1440
1845
|
top?: BorderSpec;
|
|
1441
1846
|
bottom?: BorderSpec;
|
|
1442
1847
|
left?: BorderSpec;
|
|
1443
|
-
right?: BorderSpec;
|
|
1444
|
-
|
|
1445
|
-
|
|
1848
|
+
right?: BorderSpec;
|
|
1849
|
+
/** Display setting */
|
|
1850
|
+
display?: "allPages" | "firstPage" | "notFirstPage";
|
|
1851
|
+
/** Offset from */
|
|
1852
|
+
offsetFrom?: "page" | "text";
|
|
1853
|
+
/** Z-order */
|
|
1446
1854
|
zOrder?: "front" | "back";
|
|
1447
|
-
};
|
|
1855
|
+
};
|
|
1856
|
+
/** Page background */
|
|
1448
1857
|
background?: {
|
|
1449
1858
|
color?: ColorValue;
|
|
1450
1859
|
themeColor?: ThemeColorSlot;
|
|
1451
1860
|
themeTint?: string;
|
|
1452
1861
|
themeShade?: string;
|
|
1453
|
-
};
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1862
|
+
};
|
|
1863
|
+
/** Footnote properties for this section */
|
|
1864
|
+
footnotePr?: FootnoteProperties;
|
|
1865
|
+
/** Number of footnote columns in this section (`w15:footnoteColumns`) */
|
|
1866
|
+
footnoteColumns?: number;
|
|
1867
|
+
/** Endnote properties for this section */
|
|
1868
|
+
endnotePr?: EndnoteProperties;
|
|
1869
|
+
/** Document grid */
|
|
1457
1870
|
docGrid?: {
|
|
1458
1871
|
type?: "default" | "lines" | "linesAndChars" | "snapToChars";
|
|
1459
1872
|
linePitch?: number;
|
|
1460
1873
|
charSpace?: number;
|
|
1461
|
-
};
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1874
|
+
};
|
|
1875
|
+
/** First page paper source */
|
|
1876
|
+
paperSrcFirst?: number;
|
|
1877
|
+
/** Other pages paper source */
|
|
1878
|
+
paperSrcOther?: number;
|
|
1879
|
+
/** Protected forms in this section */
|
|
1880
|
+
formProtection?: boolean;
|
|
1881
|
+
/** Suppress endnotes in this section */
|
|
1882
|
+
noEndnote?: boolean;
|
|
1883
|
+
/** Use right-to-left gutter in this section */
|
|
1884
|
+
rtlGutter?: boolean;
|
|
1885
|
+
/** Relationship id for printer settings */
|
|
1886
|
+
printerSettingsRelationshipId?: string;
|
|
1887
|
+
/** Section-level tracked property changes (w:sectPrChange) */
|
|
1468
1888
|
propertyChanges?: SectionPropertyChange[];
|
|
1469
1889
|
};
|
|
1470
1890
|
/**
|
|
@@ -1475,18 +1895,26 @@ type BlockContent = Paragraph | Table | BlockSdt;
|
|
|
1475
1895
|
* Section (implicit or explicit based on sectPr)
|
|
1476
1896
|
*/
|
|
1477
1897
|
type Section = {
|
|
1478
|
-
/** Section properties */
|
|
1479
|
-
|
|
1480
|
-
|
|
1898
|
+
/** Section properties */
|
|
1899
|
+
properties: SectionProperties;
|
|
1900
|
+
/** Content in this section */
|
|
1901
|
+
content: BlockContent[];
|
|
1902
|
+
/** Headers for this section */
|
|
1903
|
+
headers?: Map<HeaderFooterType, HeaderFooter>;
|
|
1904
|
+
/** Footers for this section */
|
|
1481
1905
|
footers?: Map<HeaderFooterType, HeaderFooter>;
|
|
1482
1906
|
};
|
|
1483
1907
|
/**
|
|
1484
1908
|
* Document body (w:body)
|
|
1485
1909
|
*/
|
|
1486
1910
|
type DocumentBody = {
|
|
1487
|
-
/** All content (paragraphs, tables) */
|
|
1488
|
-
|
|
1489
|
-
|
|
1911
|
+
/** All content (paragraphs, tables) */
|
|
1912
|
+
content: BlockContent[];
|
|
1913
|
+
/** Sections (derived from sectPr in paragraphs and final sectPr) */
|
|
1914
|
+
sections?: Section[];
|
|
1915
|
+
/** Final section properties (from body's sectPr) */
|
|
1916
|
+
finalSectionProperties?: SectionProperties;
|
|
1917
|
+
/** Comments from comments.xml */
|
|
1490
1918
|
comments?: Comment[];
|
|
1491
1919
|
};
|
|
1492
1920
|
//#endregion
|
|
@@ -1499,24 +1927,43 @@ type StyleType = "paragraph" | "character" | "numbering" | "table";
|
|
|
1499
1927
|
* Style definition
|
|
1500
1928
|
*/
|
|
1501
1929
|
type Style = {
|
|
1502
|
-
/** Style ID */
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1930
|
+
/** Style ID */
|
|
1931
|
+
styleId: string;
|
|
1932
|
+
/** Style type */
|
|
1933
|
+
type: StyleType;
|
|
1934
|
+
/** Display name */
|
|
1935
|
+
name?: string;
|
|
1936
|
+
/** Based on style ID */
|
|
1937
|
+
basedOn?: string;
|
|
1938
|
+
/** Next style after Enter (for paragraph styles) */
|
|
1939
|
+
next?: string;
|
|
1940
|
+
/** Linked style (paragraph/character pair) */
|
|
1941
|
+
link?: string;
|
|
1942
|
+
/** UI sort priority */
|
|
1943
|
+
uiPriority?: number;
|
|
1944
|
+
/** Hidden from UI */
|
|
1945
|
+
hidden?: boolean;
|
|
1946
|
+
/** Semi-hidden from UI */
|
|
1947
|
+
semiHidden?: boolean;
|
|
1948
|
+
/** Unhide when used */
|
|
1949
|
+
unhideWhenUsed?: boolean;
|
|
1950
|
+
/** Quick format in gallery */
|
|
1951
|
+
qFormat?: boolean;
|
|
1952
|
+
/** Is default style */
|
|
1953
|
+
default?: boolean;
|
|
1954
|
+
/** Personal style (custom) */
|
|
1955
|
+
personal?: boolean;
|
|
1956
|
+
/** Paragraph properties (for paragraph/table styles) */
|
|
1957
|
+
pPr?: ParagraphFormatting;
|
|
1958
|
+
/** Run properties */
|
|
1959
|
+
rPr?: TextFormatting;
|
|
1960
|
+
/** Table properties (for table styles) */
|
|
1961
|
+
tblPr?: TableFormatting;
|
|
1962
|
+
/** Table row properties */
|
|
1963
|
+
trPr?: TableRowFormatting;
|
|
1964
|
+
/** Table cell properties */
|
|
1965
|
+
tcPr?: TableCellFormatting;
|
|
1966
|
+
/** Conditional table style parts */
|
|
1520
1967
|
tblStylePr?: {
|
|
1521
1968
|
type: "band1Horz" | "band1Vert" | "band2Horz" | "band2Vert" | "firstCol" | "firstRow" | "lastCol" | "lastRow" | "neCell" | "nwCell" | "seCell" | "swCell" | "wholeTable";
|
|
1522
1969
|
pPr?: ParagraphFormatting;
|
|
@@ -1530,14 +1977,18 @@ type Style = {
|
|
|
1530
1977
|
* Document defaults (w:docDefaults)
|
|
1531
1978
|
*/
|
|
1532
1979
|
type DocDefaults = {
|
|
1533
|
-
/** Default run properties */
|
|
1980
|
+
/** Default run properties */
|
|
1981
|
+
rPr?: TextFormatting;
|
|
1982
|
+
/** Default paragraph properties */
|
|
1534
1983
|
pPr?: ParagraphFormatting;
|
|
1535
1984
|
};
|
|
1536
1985
|
/**
|
|
1537
1986
|
* Style definitions from styles.xml
|
|
1538
1987
|
*/
|
|
1539
1988
|
type StyleDefinitions = {
|
|
1540
|
-
/** Document defaults */
|
|
1989
|
+
/** Document defaults */
|
|
1990
|
+
docDefaults?: DocDefaults;
|
|
1991
|
+
/** Latent styles */
|
|
1541
1992
|
latentStyles?: {
|
|
1542
1993
|
defLockedState?: boolean;
|
|
1543
1994
|
defUIPriority?: number;
|
|
@@ -1545,49 +1996,67 @@ type StyleDefinitions = {
|
|
|
1545
1996
|
defUnhideWhenUsed?: boolean;
|
|
1546
1997
|
defQFormat?: boolean;
|
|
1547
1998
|
count?: number;
|
|
1548
|
-
};
|
|
1999
|
+
};
|
|
2000
|
+
/** Style definitions */
|
|
1549
2001
|
styles: Style[];
|
|
1550
2002
|
};
|
|
1551
2003
|
/**
|
|
1552
2004
|
* Theme color scheme (a:clrScheme)
|
|
1553
2005
|
*/
|
|
1554
2006
|
type ThemeColorScheme = {
|
|
1555
|
-
/** Dark 1 color (usually black) */
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
2007
|
+
/** Dark 1 color (usually black) */
|
|
2008
|
+
dk1?: string;
|
|
2009
|
+
/** Light 1 color (usually white) */
|
|
2010
|
+
lt1?: string;
|
|
2011
|
+
/** Dark 2 color */
|
|
2012
|
+
dk2?: string;
|
|
2013
|
+
/** Light 2 color */
|
|
2014
|
+
lt2?: string;
|
|
2015
|
+
/** Accent colors 1-6 */
|
|
1559
2016
|
accent1?: string;
|
|
1560
2017
|
accent2?: string;
|
|
1561
2018
|
accent3?: string;
|
|
1562
2019
|
accent4?: string;
|
|
1563
2020
|
accent5?: string;
|
|
1564
|
-
accent6?: string;
|
|
1565
|
-
|
|
2021
|
+
accent6?: string;
|
|
2022
|
+
/** Hyperlink color */
|
|
2023
|
+
hlink?: string;
|
|
2024
|
+
/** Followed hyperlink color */
|
|
1566
2025
|
folHlink?: string;
|
|
1567
2026
|
};
|
|
1568
2027
|
/**
|
|
1569
2028
|
* Theme font (with script variants)
|
|
1570
2029
|
*/
|
|
1571
2030
|
type ThemeFont = {
|
|
1572
|
-
/** Latin font */
|
|
1573
|
-
|
|
1574
|
-
|
|
2031
|
+
/** Latin font */
|
|
2032
|
+
latin?: string;
|
|
2033
|
+
/** East Asian font */
|
|
2034
|
+
ea?: string;
|
|
2035
|
+
/** Complex script font */
|
|
2036
|
+
cs?: string;
|
|
2037
|
+
/** Script-specific fonts */
|
|
1575
2038
|
fonts?: Record<string, string>;
|
|
1576
2039
|
};
|
|
1577
2040
|
/**
|
|
1578
2041
|
* Theme font scheme (a:fontScheme)
|
|
1579
2042
|
*/
|
|
1580
2043
|
type ThemeFontScheme = {
|
|
1581
|
-
/** Major font (headings) */
|
|
2044
|
+
/** Major font (headings) */
|
|
2045
|
+
majorFont?: ThemeFont;
|
|
2046
|
+
/** Minor font (body text) */
|
|
1582
2047
|
minorFont?: ThemeFont;
|
|
1583
2048
|
};
|
|
1584
2049
|
/**
|
|
1585
2050
|
* Theme (from theme1.xml)
|
|
1586
2051
|
*/
|
|
1587
2052
|
type Theme = {
|
|
1588
|
-
/** Theme name */
|
|
1589
|
-
|
|
1590
|
-
|
|
2053
|
+
/** Theme name */
|
|
2054
|
+
name?: string;
|
|
2055
|
+
/** Color scheme */
|
|
2056
|
+
colorScheme?: ThemeColorScheme;
|
|
2057
|
+
/** Font scheme */
|
|
2058
|
+
fontScheme?: ThemeFontScheme;
|
|
2059
|
+
/** Format scheme (fills, lines, effects) - simplified */
|
|
1591
2060
|
formatScheme?: {
|
|
1592
2061
|
name?: string;
|
|
1593
2062
|
};
|
|
@@ -1596,12 +2065,19 @@ type Theme = {
|
|
|
1596
2065
|
* Font info from fontTable.xml
|
|
1597
2066
|
*/
|
|
1598
2067
|
type FontInfo = {
|
|
1599
|
-
/** Font name */
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
2068
|
+
/** Font name */
|
|
2069
|
+
name: string;
|
|
2070
|
+
/** Alternate names */
|
|
2071
|
+
altName?: string;
|
|
2072
|
+
/** Panose-1 classification */
|
|
2073
|
+
panose1?: string;
|
|
2074
|
+
/** Character set */
|
|
2075
|
+
charset?: string;
|
|
2076
|
+
/** Font family type */
|
|
2077
|
+
family?: "decorative" | "modern" | "roman" | "script" | "swiss" | "auto";
|
|
2078
|
+
/** Pitch (fixed or variable) */
|
|
2079
|
+
pitch?: "default" | "fixed" | "variable";
|
|
2080
|
+
/** Signature */
|
|
1605
2081
|
sig?: {
|
|
1606
2082
|
usb0?: string;
|
|
1607
2083
|
usb1?: string;
|
|
@@ -1609,7 +2085,8 @@ type FontInfo = {
|
|
|
1609
2085
|
usb3?: string;
|
|
1610
2086
|
csb0?: string;
|
|
1611
2087
|
csb1?: string;
|
|
1612
|
-
};
|
|
2088
|
+
};
|
|
2089
|
+
/** Embedded font data reference */
|
|
1613
2090
|
embedRegular?: string;
|
|
1614
2091
|
embedBold?: string;
|
|
1615
2092
|
embedItalic?: string;
|
|
@@ -1629,9 +2106,13 @@ type RelationshipType = string;
|
|
|
1629
2106
|
* Relationship entry
|
|
1630
2107
|
*/
|
|
1631
2108
|
type Relationship = {
|
|
1632
|
-
/** Relationship ID (e.g., "rId1") */
|
|
1633
|
-
|
|
1634
|
-
|
|
2109
|
+
/** Relationship ID (e.g., "rId1") */
|
|
2110
|
+
id: string;
|
|
2111
|
+
/** Relationship type URI */
|
|
2112
|
+
type: RelationshipType;
|
|
2113
|
+
/** Target path or URL */
|
|
2114
|
+
target: string;
|
|
2115
|
+
/** Target mode */
|
|
1635
2116
|
targetMode?: "External" | "Internal";
|
|
1636
2117
|
};
|
|
1637
2118
|
/**
|
|
@@ -1642,11 +2123,17 @@ type RelationshipMap = Map<string, Relationship>;
|
|
|
1642
2123
|
* Media file from word/media/
|
|
1643
2124
|
*/
|
|
1644
2125
|
type MediaFile = {
|
|
1645
|
-
/** File path in ZIP */
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
2126
|
+
/** File path in ZIP */
|
|
2127
|
+
path: string;
|
|
2128
|
+
/** Original filename */
|
|
2129
|
+
filename?: string;
|
|
2130
|
+
/** MIME type */
|
|
2131
|
+
mimeType: string;
|
|
2132
|
+
/** Binary data */
|
|
2133
|
+
data: ArrayBuffer;
|
|
2134
|
+
/** Base64 encoded data for rendering */
|
|
2135
|
+
base64?: string;
|
|
2136
|
+
/** Data URL for direct use in src attributes */
|
|
1650
2137
|
dataUrl?: string;
|
|
1651
2138
|
};
|
|
1652
2139
|
//#endregion
|
|
@@ -1681,11 +2168,16 @@ type DocumentSettings = {
|
|
|
1681
2168
|
themeFontLang?: {
|
|
1682
2169
|
eastAsia?: string;
|
|
1683
2170
|
bidi?: string;
|
|
1684
|
-
};
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
2171
|
+
};
|
|
2172
|
+
/** Automatically hyphenate eligible paragraphs (`w:autoHyphenation`). */
|
|
2173
|
+
autoHyphenation?: boolean;
|
|
2174
|
+
/** Keep all-capital words unhyphenated (`w:doNotHyphenateCaps`). */
|
|
2175
|
+
doNotHyphenateCaps?: boolean;
|
|
2176
|
+
/** Maximum consecutive automatically hyphenated lines; zero means unlimited. */
|
|
2177
|
+
consecutiveHyphenLimit?: number;
|
|
2178
|
+
/** Legacy hyphenation zone (`w:hyphenationZone`) in twips; retained for compatibility tooling. */
|
|
2179
|
+
hyphenationZoneTwips?: number;
|
|
2180
|
+
/** Word/OOXML document-wide line-breaking overrides. */
|
|
1689
2181
|
lineBreakRules?: {
|
|
1690
2182
|
noLineBreaksBefore?: {
|
|
1691
2183
|
language?: string;
|
|
@@ -1696,7 +2188,8 @@ type DocumentSettings = {
|
|
|
1696
2188
|
characters: string;
|
|
1697
2189
|
};
|
|
1698
2190
|
useLegacyEthiopicAmharicRules?: boolean;
|
|
1699
|
-
};
|
|
2191
|
+
};
|
|
2192
|
+
/** Move a break-only paragraph mark onto the page after its hard page break. */
|
|
1700
2193
|
splitPageBreakAndParagraphMark?: boolean;
|
|
1701
2194
|
};
|
|
1702
2195
|
/** DOCX package conformance classes. */
|
|
@@ -1709,19 +2202,33 @@ declare const DOCX_CONFORMANCE_CLASSES: Readonly<{
|
|
|
1709
2202
|
type DocxConformanceClass = (typeof DOCX_CONFORMANCE_CLASSES)[keyof typeof DOCX_CONFORMANCE_CLASSES];
|
|
1710
2203
|
/** Complete DOCX package structure. */
|
|
1711
2204
|
type DocxPackage = {
|
|
1712
|
-
/** Conformance class detected from the main document namespace. */
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
2205
|
+
/** Conformance class detected from the main document namespace. */
|
|
2206
|
+
conformanceClass?: DocxConformanceClass;
|
|
2207
|
+
/** Document body */
|
|
2208
|
+
document: DocumentBody;
|
|
2209
|
+
/** Document-wide settings (`word/settings.xml`). */
|
|
2210
|
+
settings?: DocumentSettings;
|
|
2211
|
+
/** Style definitions */
|
|
2212
|
+
styles?: StyleDefinitions;
|
|
2213
|
+
/** Theme */
|
|
2214
|
+
theme?: Theme;
|
|
2215
|
+
/** Numbering definitions */
|
|
2216
|
+
numbering?: NumberingDefinitions;
|
|
2217
|
+
/** Font table */
|
|
2218
|
+
fontTable?: FontTable;
|
|
2219
|
+
/** Footnotes */
|
|
2220
|
+
footnotes?: Footnote[];
|
|
2221
|
+
/** Endnotes */
|
|
2222
|
+
endnotes?: Endnote[];
|
|
2223
|
+
/** Headers by relationship ID */
|
|
2224
|
+
headers?: Map<string, HeaderFooter>;
|
|
2225
|
+
/** Footers by relationship ID */
|
|
2226
|
+
footers?: Map<string, HeaderFooter>;
|
|
2227
|
+
/** Document relationships */
|
|
2228
|
+
relationships?: RelationshipMap;
|
|
2229
|
+
/** Media files */
|
|
2230
|
+
media?: Map<string, MediaFile>;
|
|
2231
|
+
/** Document properties */
|
|
1725
2232
|
properties?: {
|
|
1726
2233
|
title?: string;
|
|
1727
2234
|
subject?: string;
|
|
@@ -1738,10 +2245,15 @@ type DocxPackage = {
|
|
|
1738
2245
|
* Complete parsed DOCX document
|
|
1739
2246
|
*/
|
|
1740
2247
|
type Document = {
|
|
1741
|
-
/** DOCX package with all parsed content */
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
2248
|
+
/** DOCX package with all parsed content */
|
|
2249
|
+
package: DocxPackage;
|
|
2250
|
+
/** Original ArrayBuffer for round-trip */
|
|
2251
|
+
originalBuffer?: ArrayBuffer;
|
|
2252
|
+
/** Detected template variables ({{...}}) */
|
|
2253
|
+
templateVariables?: string[];
|
|
2254
|
+
/** Font families referenced in the document (extracted during parsing for deferred loading) */
|
|
2255
|
+
requiredFonts?: string[];
|
|
2256
|
+
/** Parsing warnings/errors */
|
|
1745
2257
|
warnings?: string[];
|
|
1746
2258
|
};
|
|
1747
2259
|
//#endregion
|