@postnzt/docx-js-editor 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/ClipboardManager-C0rTRkVQ.d.ts +464 -0
  2. package/dist/ClipboardManager-CgpKW2At.d.mts +464 -0
  3. package/dist/DocumentAgent-BqA9EJ3F.d.mts +442 -0
  4. package/dist/DocumentAgent-CRCXiBT7.d.ts +442 -0
  5. package/dist/FindReplaceDialog-KNJETYJX.js +1 -0
  6. package/dist/FindReplaceDialog-YW3R4FHM.mjs +1 -0
  7. package/dist/FootnotePropertiesDialog-452A4UT5.js +1 -0
  8. package/dist/FootnotePropertiesDialog-H24AC5XK.mjs +1 -0
  9. package/dist/HyperlinkDialog-GBAYMTUE.js +1 -0
  10. package/dist/HyperlinkDialog-HNYTXDCB.mjs +1 -0
  11. package/dist/ImagePositionDialog-B4RLP2W5.mjs +1 -0
  12. package/dist/ImagePositionDialog-M65BYQQE.js +1 -0
  13. package/dist/ImagePropertiesDialog-JOGW3WDU.mjs +1 -0
  14. package/dist/ImagePropertiesDialog-O4WQSF5M.js +1 -0
  15. package/dist/PageSetupDialog-2GIBTKMJ.js +1 -0
  16. package/dist/PageSetupDialog-Q7SHEZIJ.mjs +1 -0
  17. package/dist/TablePropertiesDialog-LMXWX3FI.mjs +1 -0
  18. package/dist/TablePropertiesDialog-WOZ4ES3H.js +1 -0
  19. package/dist/agentApi-BVHzyk2l.d.mts +2239 -0
  20. package/dist/agentApi-BVHzyk2l.d.ts +2239 -0
  21. package/dist/chunk-2HDYCD2Q.mjs +1 -0
  22. package/dist/chunk-377ZVTSE.js +2 -0
  23. package/dist/chunk-37SLIJPH.mjs +58 -0
  24. package/dist/chunk-4VUZBV2S.js +1 -0
  25. package/dist/chunk-6WPRCJ5A.mjs +1 -0
  26. package/dist/chunk-7MGFEP2R.mjs +26 -0
  27. package/dist/chunk-7QTNB64A.mjs +9 -0
  28. package/dist/chunk-AARNCPWR.js +1 -0
  29. package/dist/chunk-AU5NVRHP.js +2 -0
  30. package/dist/chunk-BP3V2HDD.js +261 -0
  31. package/dist/chunk-BUEMG4NW.js +1 -0
  32. package/dist/chunk-DC65PJYE.js +4 -0
  33. package/dist/chunk-DLVLK5FT.mjs +24 -0
  34. package/dist/chunk-EV3CM6TU.js +1 -0
  35. package/dist/chunk-FVUGBRDD.js +1 -0
  36. package/dist/chunk-GZOCOWWB.mjs +2 -0
  37. package/dist/chunk-H5NTJZO4.js +1 -0
  38. package/dist/chunk-IFPN3NT3.js +3 -0
  39. package/dist/chunk-KCOGY3V2.js +10 -0
  40. package/dist/chunk-KUL2SDYC.js +26 -0
  41. package/dist/chunk-LFZXSNOF.mjs +261 -0
  42. package/dist/chunk-LYBG4YI7.mjs +1 -0
  43. package/dist/chunk-M5F4SK3W.mjs +1 -0
  44. package/dist/chunk-P7WEP4JU.js +9 -0
  45. package/dist/chunk-PB7VMDDP.js +24 -0
  46. package/dist/chunk-QAZ4233N.mjs +1 -0
  47. package/dist/chunk-QSUPYUOP.js +2 -0
  48. package/dist/chunk-QTSXJRP6.mjs +1 -0
  49. package/dist/chunk-QVPR2W5S.js +1 -0
  50. package/dist/chunk-RTFUE3KK.mjs +10 -0
  51. package/dist/chunk-SCYTWBF5.mjs +111 -0
  52. package/dist/chunk-SE5EN2QL.js +1 -0
  53. package/dist/chunk-T6X4C2QO.js +111 -0
  54. package/dist/chunk-TAUMSKRE.mjs +1 -0
  55. package/dist/chunk-W53SI3XW.mjs +1 -0
  56. package/dist/chunk-WOHFANC5.mjs +3 -0
  57. package/dist/chunk-X5A54T6S.mjs +4 -0
  58. package/dist/chunk-YKBSKEBS.mjs +2 -0
  59. package/dist/chunk-Z26WOH6R.mjs +2 -0
  60. package/dist/chunk-ZJNGMDRE.js +58 -0
  61. package/dist/clipboard-Cu80iVDh.d.ts +1181 -0
  62. package/dist/clipboard-dFROLI95.d.mts +1181 -0
  63. package/dist/colorResolver-BwI_Uxp3.d.mts +662 -0
  64. package/dist/colorResolver-Dlmk3itT.d.ts +662 -0
  65. package/dist/core-plugins-reexport.d.mts +31 -0
  66. package/dist/core-plugins-reexport.d.ts +31 -0
  67. package/dist/core-plugins-reexport.js +1 -0
  68. package/dist/core-plugins-reexport.mjs +1 -0
  69. package/dist/core-reexport.d.mts +309 -0
  70. package/dist/core-reexport.d.ts +309 -0
  71. package/dist/core-reexport.js +1 -0
  72. package/dist/core-reexport.mjs +1 -0
  73. package/dist/executor-L2MVKMXO.js +1 -0
  74. package/dist/executor-XKBCCVNY.mjs +1 -0
  75. package/dist/fontLoader-BI9ZoACv.d.ts +176 -0
  76. package/dist/fontLoader-DicgJidU.d.mts +176 -0
  77. package/dist/headless-reexport.d.mts +195 -0
  78. package/dist/headless-reexport.d.ts +195 -0
  79. package/dist/headless-reexport.js +4 -0
  80. package/dist/headless-reexport.mjs +4 -0
  81. package/dist/index.css +1 -0
  82. package/dist/index.d.mts +480 -0
  83. package/dist/index.d.ts +480 -0
  84. package/dist/index.js +112 -0
  85. package/dist/index.mjs +112 -0
  86. package/dist/lib-BCT2DRYI.mjs +1 -0
  87. package/dist/lib-U35UU4OU.js +1 -0
  88. package/dist/mcp-reexport.d.mts +156 -0
  89. package/dist/mcp-reexport.d.ts +156 -0
  90. package/dist/mcp-reexport.js +16 -0
  91. package/dist/mcp-reexport.mjs +16 -0
  92. package/dist/processTemplate-5ZST2Q5L.js +1 -0
  93. package/dist/processTemplate-LRHXOWMZ.mjs +1 -0
  94. package/dist/react-Cl2n0F5S.d.ts +1091 -0
  95. package/dist/react-DZlAKNXg.d.mts +1091 -0
  96. package/dist/react.css +1 -0
  97. package/dist/react.d.mts +10 -0
  98. package/dist/react.d.ts +10 -0
  99. package/dist/react.js +1 -0
  100. package/dist/react.mjs +1 -0
  101. package/dist/registry-D4FQ9aKX.d.mts +165 -0
  102. package/dist/registry-DrYyUXQr.d.ts +165 -0
  103. package/dist/selectionRects-DEX5THEG.js +1 -0
  104. package/dist/selectionRects-SQTAHMCH.mjs +1 -0
  105. package/dist/styles.css +1 -0
  106. package/dist/types-B3LkfO0u.d.mts +310 -0
  107. package/dist/types-igZ1x_e4.d.ts +310 -0
  108. package/dist/ui.d.mts +2005 -0
  109. package/dist/ui.d.ts +2005 -0
  110. package/dist/ui.js +1 -0
  111. package/dist/ui.mjs +1 -0
  112. package/dist/variableDetector-CIqTek7A.d.mts +204 -0
  113. package/dist/variableDetector-CkYvLv62.d.ts +204 -0
  114. package/i18n/de.json +745 -0
  115. package/i18n/en.json +745 -0
  116. package/i18n/pl.json +745 -0
  117. package/package.json +127 -0
@@ -0,0 +1,2239 @@
1
+ /**
2
+ * Color & Styling Primitives
3
+ *
4
+ * Basic types used throughout OOXML for colors, borders, and shading.
5
+ */
6
+ /**
7
+ * Theme color slots from theme1.xml
8
+ */
9
+ type ThemeColorSlot = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'background1' | 'text1' | 'background2' | 'text2';
10
+ /**
11
+ * Color value - can be direct RGB, theme reference, or auto
12
+ */
13
+ interface ColorValue {
14
+ /** RGB hex value without # (e.g., "FF0000") */
15
+ rgb?: string;
16
+ /** Theme color slot reference */
17
+ themeColor?: ThemeColorSlot;
18
+ /** Tint modifier (0-255 as hex string, e.g., "80") - makes color lighter */
19
+ themeTint?: string;
20
+ /** Shade modifier (0-255 as hex string) - makes color darker */
21
+ themeShade?: string;
22
+ /** Auto color - context-dependent (usually black for text) */
23
+ auto?: boolean;
24
+ }
25
+ /**
26
+ * Border specification for any border (paragraph, table, page)
27
+ */
28
+ interface BorderSpec {
29
+ /** Border style */
30
+ style: 'none' | 'single' | 'double' | 'dotted' | 'dashed' | 'thick' | 'triple' | 'thinThickSmallGap' | 'thickThinSmallGap' | 'thinThickMediumGap' | 'thickThinMediumGap' | 'thinThickLargeGap' | 'thickThinLargeGap' | 'wave' | 'doubleWave' | 'dashSmallGap' | 'dashDotStroked' | 'threeDEmboss' | 'threeDEngrave' | 'outset' | 'inset' | 'nil';
31
+ /** Color of the border */
32
+ color?: ColorValue;
33
+ /** Width in eighths of a point (1/8 pt) */
34
+ size?: number;
35
+ /** Spacing from text in points */
36
+ space?: number;
37
+ /** Shadow effect */
38
+ shadow?: boolean;
39
+ /** Frame effect */
40
+ frame?: boolean;
41
+ }
42
+ /**
43
+ * Shading/background properties
44
+ */
45
+ interface ShadingProperties {
46
+ /** Pattern fill color */
47
+ color?: ColorValue;
48
+ /** Background fill color */
49
+ fill?: ColorValue;
50
+ /** Shading pattern type */
51
+ 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';
52
+ }
53
+
54
+ /**
55
+ * Text, Paragraph, and Table Formatting Types
56
+ *
57
+ * Properties that control how text, paragraphs, and table structures
58
+ * are formatted in OOXML (w:rPr, w:pPr, w:tblPr, etc.).
59
+ */
60
+
61
+ /**
62
+ * Underline style options
63
+ */
64
+ type UnderlineStyle = 'none' | 'single' | 'words' | 'double' | 'thick' | 'dotted' | 'dottedHeavy' | 'dash' | 'dashedHeavy' | 'dashLong' | 'dashLongHeavy' | 'dotDash' | 'dashDotHeavy' | 'dotDotDash' | 'dashDotDotHeavy' | 'wave' | 'wavyHeavy' | 'wavyDouble';
65
+ /**
66
+ * Text effect animations
67
+ */
68
+ type TextEffect = 'none' | 'blinkBackground' | 'lights' | 'antsBlack' | 'antsRed' | 'shimmer' | 'sparkle';
69
+ /**
70
+ * Emphasis mark type
71
+ */
72
+ type EmphasisMark = 'none' | 'dot' | 'comma' | 'circle' | 'underDot';
73
+ /**
74
+ * Complete text formatting properties (w:rPr)
75
+ */
76
+ interface TextFormatting {
77
+ /** Bold (w:b) */
78
+ bold?: boolean;
79
+ /** Bold complex script (w:bCs) */
80
+ boldCs?: boolean;
81
+ /** Italic (w:i) */
82
+ italic?: boolean;
83
+ /** Italic complex script (w:iCs) */
84
+ italicCs?: boolean;
85
+ /** Underline style and color (w:u) */
86
+ underline?: {
87
+ style: UnderlineStyle;
88
+ color?: ColorValue;
89
+ };
90
+ /** Strikethrough (w:strike) */
91
+ strike?: boolean;
92
+ /** Double strikethrough (w:dstrike) */
93
+ doubleStrike?: boolean;
94
+ /** Superscript/subscript (w:vertAlign) */
95
+ vertAlign?: 'baseline' | 'superscript' | 'subscript';
96
+ /** Small caps (w:smallCaps) */
97
+ smallCaps?: boolean;
98
+ /** All caps (w:caps) */
99
+ allCaps?: boolean;
100
+ /** Hidden text (w:vanish) */
101
+ hidden?: boolean;
102
+ /** Text color (w:color) */
103
+ color?: ColorValue;
104
+ /** Highlight/background color (w:highlight) */
105
+ highlight?: 'black' | 'blue' | 'cyan' | 'darkBlue' | 'darkCyan' | 'darkGray' | 'darkGreen' | 'darkMagenta' | 'darkRed' | 'darkYellow' | 'green' | 'lightGray' | 'magenta' | 'none' | 'red' | 'white' | 'yellow';
106
+ /** Character shading (w:shd) */
107
+ shading?: ShadingProperties;
108
+ /** Font size in half-points (w:sz) - e.g., 24 = 12pt */
109
+ fontSize?: number;
110
+ /** Font size complex script (w:szCs) */
111
+ fontSizeCs?: number;
112
+ /** Font family (w:rFonts) */
113
+ fontFamily?: {
114
+ ascii?: string;
115
+ hAnsi?: string;
116
+ eastAsia?: string;
117
+ cs?: string;
118
+ /** Theme font reference */
119
+ asciiTheme?: 'majorAscii' | 'majorHAnsi' | 'majorEastAsia' | 'majorBidi' | 'minorAscii' | 'minorHAnsi' | 'minorEastAsia' | 'minorBidi';
120
+ hAnsiTheme?: string;
121
+ eastAsiaTheme?: string;
122
+ csTheme?: string;
123
+ };
124
+ /** Character spacing in twips (w:spacing) */
125
+ spacing?: number;
126
+ /** Raised/lowered text position in half-points (w:position) */
127
+ position?: number;
128
+ /** Horizontal text scale percentage (w:w) */
129
+ scale?: number;
130
+ /** Kerning threshold in half-points (w:kern) */
131
+ kerning?: number;
132
+ /** Text effect animation (w:effect) */
133
+ effect?: TextEffect;
134
+ /** Emphasis mark (w:em) */
135
+ emphasisMark?: EmphasisMark;
136
+ /** Emboss effect (w:emboss) */
137
+ emboss?: boolean;
138
+ /** Imprint/engrave effect (w:imprint) */
139
+ imprint?: boolean;
140
+ /** Outline effect (w:outline) */
141
+ outline?: boolean;
142
+ /** Shadow effect (w:shadow) */
143
+ shadow?: boolean;
144
+ /** Right-to-left text (w:rtl) */
145
+ rtl?: boolean;
146
+ /** Complex script formatting (w:cs) */
147
+ cs?: boolean;
148
+ /** Character style ID (w:rStyle) */
149
+ styleId?: string;
150
+ }
151
+ /**
152
+ * Tab stop alignment
153
+ */
154
+ type TabStopAlignment = 'left' | 'center' | 'right' | 'decimal' | 'bar' | 'clear' | 'num';
155
+ /**
156
+ * Tab leader character
157
+ */
158
+ type TabLeader = 'none' | 'dot' | 'hyphen' | 'underscore' | 'heavy' | 'middleDot';
159
+ /**
160
+ * Tab stop definition
161
+ */
162
+ interface TabStop {
163
+ /** Position in twips from left margin */
164
+ position: number;
165
+ /** Alignment at tab stop */
166
+ alignment: TabStopAlignment;
167
+ /** Leader character */
168
+ leader?: TabLeader;
169
+ }
170
+ /**
171
+ * Line spacing rule
172
+ */
173
+ type LineSpacingRule = 'auto' | 'exact' | 'atLeast';
174
+ /**
175
+ * Paragraph alignment/justification
176
+ */
177
+ type ParagraphAlignment = 'left' | 'center' | 'right' | 'both' | 'distribute' | 'mediumKashida' | 'highKashida' | 'lowKashida' | 'thaiDistribute';
178
+ /**
179
+ * Complete paragraph formatting properties (w:pPr)
180
+ */
181
+ interface ParagraphFormatting {
182
+ /** Paragraph alignment (w:jc) */
183
+ alignment?: ParagraphAlignment;
184
+ /** Text direction (w:bidi) */
185
+ bidi?: boolean;
186
+ /** Spacing before in twips (w:spacing/@w:before) */
187
+ spaceBefore?: number;
188
+ /** Spacing after in twips (w:spacing/@w:after) */
189
+ spaceAfter?: number;
190
+ /** Line spacing value (w:spacing/@w:line) */
191
+ lineSpacing?: number;
192
+ /** Line spacing rule (w:spacing/@w:lineRule) */
193
+ lineSpacingRule?: LineSpacingRule;
194
+ /** Auto space before (w:spacing/@w:beforeAutospacing) */
195
+ beforeAutospacing?: boolean;
196
+ /** Auto space after (w:spacing/@w:afterAutospacing) */
197
+ afterAutospacing?: boolean;
198
+ /** Left indent in twips (w:ind/@w:left) */
199
+ indentLeft?: number;
200
+ /** Right indent in twips (w:ind/@w:right) */
201
+ indentRight?: number;
202
+ /** First line indent in twips - positive for indent, negative for hanging (w:ind/@w:firstLine or @w:hanging) */
203
+ indentFirstLine?: number;
204
+ /** Whether first line is hanging indent */
205
+ hangingIndent?: boolean;
206
+ /** Paragraph borders (w:pBdr) */
207
+ borders?: {
208
+ top?: BorderSpec;
209
+ bottom?: BorderSpec;
210
+ left?: BorderSpec;
211
+ right?: BorderSpec;
212
+ between?: BorderSpec;
213
+ bar?: BorderSpec;
214
+ };
215
+ /** Paragraph shading (w:shd) */
216
+ shading?: ShadingProperties;
217
+ /** Custom tab stops (w:tabs) */
218
+ tabs?: TabStop[];
219
+ /** Keep with next paragraph (w:keepNext) */
220
+ keepNext?: boolean;
221
+ /** Keep lines together (w:keepLines) */
222
+ keepLines?: boolean;
223
+ /** Widow/orphan control (w:widowControl) */
224
+ widowControl?: boolean;
225
+ /** Page break before (w:pageBreakBefore) */
226
+ pageBreakBefore?: boolean;
227
+ /** Contextual spacing — suppress space between paragraphs of the same style (w:contextualSpacing) */
228
+ contextualSpacing?: boolean;
229
+ /** Numbering properties (w:numPr) */
230
+ numPr?: {
231
+ /** Numbering definition ID (w:numId) */
232
+ numId?: number;
233
+ /** List level (0-8) (w:ilvl) */
234
+ ilvl?: number;
235
+ };
236
+ /** Outline level 0-9 (w:outlineLvl) */
237
+ outlineLevel?: number;
238
+ /** Paragraph style ID (w:pStyle) */
239
+ styleId?: string;
240
+ /** Text frame properties (w:framePr) */
241
+ frame?: {
242
+ width?: number;
243
+ height?: number;
244
+ hAnchor?: 'text' | 'margin' | 'page';
245
+ vAnchor?: 'text' | 'margin' | 'page';
246
+ x?: number;
247
+ y?: number;
248
+ xAlign?: 'left' | 'center' | 'right' | 'inside' | 'outside';
249
+ yAlign?: 'top' | 'center' | 'bottom' | 'inside' | 'outside' | 'inline';
250
+ wrap?: 'around' | 'auto' | 'none' | 'notBeside' | 'through' | 'tight';
251
+ };
252
+ /** Suppress line numbers (w:suppressLineNumbers) */
253
+ suppressLineNumbers?: boolean;
254
+ /** Suppress auto hyphens (w:suppressAutoHyphens) */
255
+ suppressAutoHyphens?: boolean;
256
+ /** Run properties to apply to all runs (w:rPr) */
257
+ runProperties?: TextFormatting;
258
+ }
259
+ /**
260
+ * Table width type
261
+ */
262
+ type TableWidthType = 'auto' | 'dxa' | 'nil' | 'pct';
263
+ /**
264
+ * Table measurement (width or height)
265
+ */
266
+ interface TableMeasurement {
267
+ /** Value in twips (for dxa) or fifths of a percent (for pct) */
268
+ value: number;
269
+ /** Measurement type */
270
+ type: TableWidthType;
271
+ }
272
+ /**
273
+ * Table borders
274
+ */
275
+ interface TableBorders {
276
+ top?: BorderSpec;
277
+ bottom?: BorderSpec;
278
+ left?: BorderSpec;
279
+ right?: BorderSpec;
280
+ insideH?: BorderSpec;
281
+ insideV?: BorderSpec;
282
+ }
283
+ /**
284
+ * Cell margins
285
+ */
286
+ interface CellMargins {
287
+ top?: TableMeasurement;
288
+ bottom?: TableMeasurement;
289
+ left?: TableMeasurement;
290
+ right?: TableMeasurement;
291
+ }
292
+ /**
293
+ * Table look flags (for table styles)
294
+ */
295
+ interface TableLook {
296
+ firstColumn?: boolean;
297
+ firstRow?: boolean;
298
+ lastColumn?: boolean;
299
+ lastRow?: boolean;
300
+ noHBand?: boolean;
301
+ noVBand?: boolean;
302
+ }
303
+ /**
304
+ * Floating table properties
305
+ */
306
+ interface FloatingTableProperties {
307
+ /** Horizontal anchor */
308
+ horzAnchor?: 'margin' | 'page' | 'text';
309
+ /** Vertical anchor */
310
+ vertAnchor?: 'margin' | 'page' | 'text';
311
+ /** Horizontal position */
312
+ tblpX?: number;
313
+ tblpXSpec?: 'left' | 'center' | 'right' | 'inside' | 'outside';
314
+ /** Vertical position */
315
+ tblpY?: number;
316
+ tblpYSpec?: 'top' | 'center' | 'bottom' | 'inside' | 'outside' | 'inline';
317
+ /** Distance from surrounding text */
318
+ topFromText?: number;
319
+ bottomFromText?: number;
320
+ leftFromText?: number;
321
+ rightFromText?: number;
322
+ }
323
+ /**
324
+ * Table formatting properties (w:tblPr)
325
+ */
326
+ interface TableFormatting {
327
+ /** Table width */
328
+ width?: TableMeasurement;
329
+ /** Table justification */
330
+ justification?: 'left' | 'center' | 'right';
331
+ /** Cell spacing */
332
+ cellSpacing?: TableMeasurement;
333
+ /** Table indent from left margin */
334
+ indent?: TableMeasurement;
335
+ /** Table borders */
336
+ borders?: TableBorders;
337
+ /** Default cell margins */
338
+ cellMargins?: CellMargins;
339
+ /** Table layout */
340
+ layout?: 'fixed' | 'autofit';
341
+ /** Table style ID */
342
+ styleId?: string;
343
+ /** Table look (conditional formatting flags) */
344
+ look?: TableLook;
345
+ /** Shading/background */
346
+ shading?: ShadingProperties;
347
+ /** Overlap for floating tables */
348
+ overlap?: 'never' | 'overlap';
349
+ /** Floating table properties */
350
+ floating?: FloatingTableProperties;
351
+ /** Right to left table */
352
+ bidi?: boolean;
353
+ }
354
+ /**
355
+ * Table row formatting properties (w:trPr)
356
+ */
357
+ interface TableRowFormatting {
358
+ /** Row height */
359
+ height?: TableMeasurement;
360
+ /** Height rule */
361
+ heightRule?: 'auto' | 'atLeast' | 'exact';
362
+ /** Header row (repeats on each page) */
363
+ header?: boolean;
364
+ /** Allow row to break across pages */
365
+ cantSplit?: boolean;
366
+ /** Row justification */
367
+ justification?: 'left' | 'center' | 'right';
368
+ /** Hidden row */
369
+ hidden?: boolean;
370
+ /** Conditional format style */
371
+ conditionalFormat?: ConditionalFormatStyle;
372
+ }
373
+ /**
374
+ * Conditional format style
375
+ */
376
+ interface ConditionalFormatStyle {
377
+ /** First row */
378
+ firstRow?: boolean;
379
+ /** Last row */
380
+ lastRow?: boolean;
381
+ /** First column */
382
+ firstColumn?: boolean;
383
+ /** Last column */
384
+ lastColumn?: boolean;
385
+ /** Odd horizontal band */
386
+ oddHBand?: boolean;
387
+ /** Even horizontal band */
388
+ evenHBand?: boolean;
389
+ /** Odd vertical band */
390
+ oddVBand?: boolean;
391
+ /** Even vertical band */
392
+ evenVBand?: boolean;
393
+ /** Northwest corner */
394
+ nwCell?: boolean;
395
+ /** Northeast corner */
396
+ neCell?: boolean;
397
+ /** Southwest corner */
398
+ swCell?: boolean;
399
+ /** Southeast corner */
400
+ seCell?: boolean;
401
+ }
402
+ /**
403
+ * Table cell formatting properties (w:tcPr)
404
+ */
405
+ interface TableCellFormatting {
406
+ /** Cell width */
407
+ width?: TableMeasurement;
408
+ /** Cell borders */
409
+ borders?: TableBorders;
410
+ /** Cell margins (override table default) */
411
+ margins?: CellMargins;
412
+ /** Cell shading/background */
413
+ shading?: ShadingProperties;
414
+ /** Vertical alignment */
415
+ verticalAlign?: 'top' | 'center' | 'bottom';
416
+ /** Text direction */
417
+ textDirection?: 'lr' | 'lrV' | 'rl' | 'rlV' | 'tb' | 'tbV' | 'tbRl' | 'tbRlV' | 'btLr';
418
+ /** Grid span (horizontal merge) */
419
+ gridSpan?: number;
420
+ /** Vertical merge */
421
+ vMerge?: 'restart' | 'continue';
422
+ /** Fit text to cell width */
423
+ fitText?: boolean;
424
+ /** Wrap text */
425
+ noWrap?: boolean;
426
+ /** Hide cell marker */
427
+ hideMark?: boolean;
428
+ /** Conditional format style */
429
+ conditionalFormat?: ConditionalFormatStyle;
430
+ }
431
+
432
+ /**
433
+ * Lists & Numbering Types
434
+ *
435
+ * Types for bullet lists, numbered lists, and numbering definitions.
436
+ */
437
+
438
+ /**
439
+ * Number format type
440
+ */
441
+ type NumberFormat = 'decimal' | 'upperRoman' | 'lowerRoman' | 'upperLetter' | 'lowerLetter' | 'ordinal' | 'cardinalText' | 'ordinalText' | 'hex' | 'chicago' | 'ideographDigital' | 'japaneseCounting' | 'aiueo' | 'iroha' | 'decimalFullWidth' | 'decimalHalfWidth' | 'japaneseLegal' | 'japaneseDigitalTenThousand' | 'decimalEnclosedCircle' | 'decimalFullWidth2' | 'aiueoFullWidth' | 'irohaFullWidth' | 'decimalZero' | 'bullet' | 'ganada' | 'chosung' | 'decimalEnclosedFullstop' | 'decimalEnclosedParen' | 'decimalEnclosedCircleChinese' | 'ideographEnclosedCircle' | 'ideographTraditional' | 'ideographZodiac' | 'ideographZodiacTraditional' | 'taiwaneseCounting' | 'ideographLegalTraditional' | 'taiwaneseCountingThousand' | 'taiwaneseDigital' | 'chineseCounting' | 'chineseLegalSimplified' | 'chineseCountingThousand' | 'koreanDigital' | 'koreanCounting' | 'koreanLegal' | 'koreanDigital2' | 'vietnameseCounting' | 'russianLower' | 'russianUpper' | 'none' | 'numberInDash' | 'hebrew1' | 'hebrew2' | 'arabicAlpha' | 'arabicAbjad' | 'hindiVowels' | 'hindiConsonants' | 'hindiNumbers' | 'hindiCounting' | 'thaiLetters' | 'thaiNumbers' | 'thaiCounting';
442
+ /**
443
+ * Multi-level suffix (what follows the number)
444
+ */
445
+ type LevelSuffix = 'tab' | 'space' | 'nothing';
446
+ /**
447
+ * List level definition
448
+ */
449
+ interface ListLevel {
450
+ /** Level index (0-8) */
451
+ ilvl: number;
452
+ /** Starting number */
453
+ start?: number;
454
+ /** Number format */
455
+ numFmt: NumberFormat;
456
+ /** Level text (e.g., "%1." or "•") */
457
+ lvlText: string;
458
+ /** Justification */
459
+ lvlJc?: 'left' | 'center' | 'right';
460
+ /** Suffix after number */
461
+ suffix?: LevelSuffix;
462
+ /** Paragraph properties for this level */
463
+ pPr?: ParagraphFormatting;
464
+ /** Run properties for the number/bullet */
465
+ rPr?: TextFormatting;
466
+ /** Restart numbering from higher level */
467
+ lvlRestart?: number;
468
+ /** Is legal numbering style */
469
+ isLgl?: boolean;
470
+ /** Legacy settings */
471
+ legacy?: {
472
+ legacy?: boolean;
473
+ legacySpace?: number;
474
+ legacyIndent?: number;
475
+ };
476
+ }
477
+ /**
478
+ * Abstract numbering definition (w:abstractNum)
479
+ */
480
+ interface AbstractNumbering {
481
+ /** Abstract numbering ID */
482
+ abstractNumId: number;
483
+ /** Multi-level type */
484
+ multiLevelType?: 'hybridMultilevel' | 'multilevel' | 'singleLevel';
485
+ /** Numbering style link */
486
+ numStyleLink?: string;
487
+ /** Style link */
488
+ styleLink?: string;
489
+ /** Level definitions */
490
+ levels: ListLevel[];
491
+ /** Name */
492
+ name?: string;
493
+ }
494
+ /**
495
+ * Numbering instance (w:num)
496
+ */
497
+ interface NumberingInstance {
498
+ /** Numbering ID (referenced by paragraphs) */
499
+ numId: number;
500
+ /** Reference to abstract numbering */
501
+ abstractNumId: number;
502
+ /** Level overrides */
503
+ levelOverrides?: Array<{
504
+ ilvl: number;
505
+ startOverride?: number;
506
+ lvl?: ListLevel;
507
+ }>;
508
+ }
509
+ /**
510
+ * Computed list rendering info
511
+ */
512
+ interface ListRendering {
513
+ /** Computed marker text (e.g., "1.", "a)", "•") */
514
+ marker: string;
515
+ /** List level (0-8) */
516
+ level: number;
517
+ /** Numbering ID */
518
+ numId: number;
519
+ /** Whether this is a bullet or numbered list */
520
+ isBullet: boolean;
521
+ /** Number format type (decimal, lowerRoman, upperRoman, etc.) */
522
+ numFmt?: NumberFormat;
523
+ /** Whether the list marker is hidden (w:vanish on level rPr) */
524
+ markerHidden?: boolean;
525
+ /** Marker font family from numbering level rPr (ascii name) */
526
+ markerFontFamily?: string;
527
+ /** Marker font size from numbering level rPr, in points */
528
+ markerFontSize?: number;
529
+ }
530
+ /**
531
+ * Complete numbering definitions
532
+ */
533
+ interface NumberingDefinitions {
534
+ /** Abstract numbering definitions */
535
+ abstractNums: AbstractNumbering[];
536
+ /** Numbering instances */
537
+ nums: NumberingInstance[];
538
+ }
539
+
540
+ /**
541
+ * Document Content Model
542
+ *
543
+ * All content-bearing types: runs, hyperlinks, bookmarks, fields,
544
+ * images, shapes, tables, lists, paragraphs, headers/footers,
545
+ * footnotes/endnotes, and sections.
546
+ *
547
+ * These types form a deeply interrelated tree (Paragraph ↔ Table ↔ ShapeTextBody)
548
+ * and are kept together to avoid circular import issues.
549
+ */
550
+
551
+ /**
552
+ * Plain text content
553
+ */
554
+ interface TextContent {
555
+ type: 'text';
556
+ /** The text string */
557
+ text: string;
558
+ /** Preserve whitespace (xml:space="preserve") */
559
+ preserveSpace?: boolean;
560
+ }
561
+ /**
562
+ * Tab character
563
+ */
564
+ interface TabContent {
565
+ type: 'tab';
566
+ }
567
+ /**
568
+ * Line break
569
+ */
570
+ interface BreakContent {
571
+ type: 'break';
572
+ /** Break type */
573
+ breakType?: 'page' | 'column' | 'textWrapping';
574
+ /** Clear type for text wrapping break */
575
+ clear?: 'none' | 'left' | 'right' | 'all';
576
+ }
577
+ /**
578
+ * Symbol character (special font character)
579
+ */
580
+ interface SymbolContent {
581
+ type: 'symbol';
582
+ /** Font name */
583
+ font: string;
584
+ /** Character code */
585
+ char: string;
586
+ }
587
+ /**
588
+ * Footnote or endnote reference
589
+ */
590
+ interface NoteReferenceContent {
591
+ type: 'footnoteRef' | 'endnoteRef';
592
+ /** Note ID */
593
+ id: number;
594
+ }
595
+ /**
596
+ * Field character (begin/separate/end)
597
+ */
598
+ interface FieldCharContent {
599
+ type: 'fieldChar';
600
+ /** Field character type */
601
+ charType: 'begin' | 'separate' | 'end';
602
+ /** Field is locked */
603
+ fldLock?: boolean;
604
+ /** Field is dirty (needs update) */
605
+ dirty?: boolean;
606
+ }
607
+ /**
608
+ * Field instruction text
609
+ */
610
+ interface InstrTextContent {
611
+ type: 'instrText';
612
+ /** Field instruction */
613
+ text: string;
614
+ }
615
+ /**
616
+ * Soft hyphen
617
+ */
618
+ interface SoftHyphenContent {
619
+ type: 'softHyphen';
620
+ }
621
+ /**
622
+ * Non-breaking hyphen
623
+ */
624
+ interface NoBreakHyphenContent {
625
+ type: 'noBreakHyphen';
626
+ }
627
+ /**
628
+ * Drawing/image reference
629
+ */
630
+ interface DrawingContent {
631
+ type: 'drawing';
632
+ /** Image data */
633
+ image: Image;
634
+ }
635
+ /**
636
+ * Shape reference
637
+ */
638
+ interface ShapeContent {
639
+ type: 'shape';
640
+ /** Shape data */
641
+ shape: Shape;
642
+ }
643
+ /**
644
+ * All possible run content types
645
+ */
646
+ type RunContent = TextContent | TabContent | BreakContent | SymbolContent | NoteReferenceContent | FieldCharContent | InstrTextContent | SoftHyphenContent | NoBreakHyphenContent | DrawingContent | ShapeContent;
647
+ /**
648
+ * A run is a contiguous region of text with the same formatting
649
+ */
650
+ interface Run {
651
+ type: 'run';
652
+ /** Text formatting properties */
653
+ formatting?: TextFormatting;
654
+ /** Run-level tracked property changes (w:rPrChange) */
655
+ propertyChanges?: RunPropertyChange[];
656
+ /** Run content (text, tabs, breaks, etc.) */
657
+ content: RunContent[];
658
+ }
659
+ /**
660
+ * Hyperlink (w:hyperlink)
661
+ */
662
+ interface Hyperlink {
663
+ type: 'hyperlink';
664
+ /** Relationship ID for external link */
665
+ rId?: string;
666
+ /** Resolved URL (from relationships) */
667
+ href?: string;
668
+ /** Internal bookmark anchor */
669
+ anchor?: string;
670
+ /** Tooltip text */
671
+ tooltip?: string;
672
+ /** Target frame */
673
+ target?: string;
674
+ /** Link history tracking */
675
+ history?: boolean;
676
+ /** Document location */
677
+ docLocation?: string;
678
+ /** Child runs */
679
+ children: (Run | BookmarkStart | BookmarkEnd)[];
680
+ }
681
+ /**
682
+ * Bookmark start marker (w:bookmarkStart)
683
+ */
684
+ interface BookmarkStart {
685
+ type: 'bookmarkStart';
686
+ /** Bookmark ID */
687
+ id: number;
688
+ /** Bookmark name */
689
+ name: string;
690
+ /** Column index for table bookmarks */
691
+ colFirst?: number;
692
+ colLast?: number;
693
+ }
694
+ /**
695
+ * Bookmark end marker (w:bookmarkEnd)
696
+ */
697
+ interface BookmarkEnd {
698
+ type: 'bookmarkEnd';
699
+ /** Bookmark ID */
700
+ id: number;
701
+ }
702
+ /**
703
+ * Known field types
704
+ */
705
+ type FieldType = 'PAGE' | 'NUMPAGES' | 'NUMWORDS' | 'NUMCHARS' | 'DATE' | 'TIME' | 'CREATEDATE' | 'SAVEDATE' | 'PRINTDATE' | 'AUTHOR' | 'TITLE' | 'SUBJECT' | 'KEYWORDS' | 'COMMENTS' | 'FILENAME' | 'FILESIZE' | 'TEMPLATE' | 'DOCPROPERTY' | 'DOCVARIABLE' | 'REF' | 'PAGEREF' | 'NOTEREF' | 'HYPERLINK' | 'TOC' | 'TOA' | 'INDEX' | 'SEQ' | 'STYLEREF' | 'AUTONUM' | 'AUTONUMLGL' | 'AUTONUMOUT' | 'IF' | 'MERGEFIELD' | 'NEXT' | 'NEXTIF' | 'ASK' | 'SET' | 'QUOTE' | 'INCLUDETEXT' | 'INCLUDEPICTURE' | 'SYMBOL' | 'ADVANCE' | 'EDITTIME' | 'REVNUM' | 'SECTION' | 'SECTIONPAGES' | 'USERADDRESS' | 'USERNAME' | 'USERINITIALS' | 'UNKNOWN';
706
+ /**
707
+ * Simple field (w:fldSimple)
708
+ */
709
+ interface SimpleField {
710
+ type: 'simpleField';
711
+ /** Field instruction (e.g., "PAGE \\* MERGEFORMAT") */
712
+ instruction: string;
713
+ /** Parsed field type */
714
+ fieldType: FieldType;
715
+ /** Current display value */
716
+ content: (Run | Hyperlink)[];
717
+ /** Field is locked */
718
+ fldLock?: boolean;
719
+ /** Field is dirty */
720
+ dirty?: boolean;
721
+ }
722
+ /**
723
+ * Complex field (w:fldChar begin/separate/end with w:instrText)
724
+ */
725
+ interface ComplexField {
726
+ type: 'complexField';
727
+ /** Field instruction */
728
+ instruction: string;
729
+ /** Parsed field type */
730
+ fieldType: FieldType;
731
+ /** Field code runs */
732
+ fieldCode: Run[];
733
+ /** Display result runs */
734
+ fieldResult: Run[];
735
+ /** Field is locked */
736
+ fldLock?: boolean;
737
+ /** Field is dirty */
738
+ dirty?: boolean;
739
+ }
740
+ type Field = SimpleField | ComplexField;
741
+ /**
742
+ * Image size specification
743
+ */
744
+ interface ImageSize {
745
+ /** Width in EMUs (English Metric Units) */
746
+ width: number;
747
+ /** Height in EMUs */
748
+ height: number;
749
+ }
750
+ /**
751
+ * Image wrap type for floating images
752
+ */
753
+ interface ImageWrap {
754
+ type: 'inline' | 'square' | 'tight' | 'through' | 'topAndBottom' | 'behind' | 'inFront';
755
+ /** Wrap text direction */
756
+ wrapText?: 'bothSides' | 'left' | 'right' | 'largest';
757
+ /** Distance from text */
758
+ distT?: number;
759
+ distB?: number;
760
+ distL?: number;
761
+ distR?: number;
762
+ }
763
+ /**
764
+ * Position for floating images
765
+ */
766
+ interface ImagePosition {
767
+ /** Horizontal positioning */
768
+ horizontal: {
769
+ relativeTo: 'character' | 'column' | 'insideMargin' | 'leftMargin' | 'margin' | 'outsideMargin' | 'page' | 'rightMargin';
770
+ alignment?: 'left' | 'right' | 'center' | 'inside' | 'outside';
771
+ posOffset?: number;
772
+ };
773
+ /** Vertical positioning */
774
+ vertical: {
775
+ relativeTo: 'insideMargin' | 'line' | 'margin' | 'outsideMargin' | 'page' | 'paragraph' | 'topMargin' | 'bottomMargin';
776
+ alignment?: 'top' | 'bottom' | 'center' | 'inside' | 'outside';
777
+ posOffset?: number;
778
+ };
779
+ }
780
+ /**
781
+ * Image transformation
782
+ */
783
+ interface ImageTransform {
784
+ /** Rotation in degrees */
785
+ rotation?: number;
786
+ /** Flip horizontal */
787
+ flipH?: boolean;
788
+ /** Flip vertical */
789
+ flipV?: boolean;
790
+ }
791
+ /**
792
+ * Image padding/margins
793
+ */
794
+ interface ImagePadding {
795
+ top?: number;
796
+ bottom?: number;
797
+ left?: number;
798
+ right?: number;
799
+ }
800
+ /**
801
+ * Embedded image (w:drawing)
802
+ */
803
+ interface Image {
804
+ type: 'image';
805
+ /** Unique ID */
806
+ id?: string;
807
+ /** Relationship ID for the image data */
808
+ rId: string;
809
+ /** Resolved image data (base64 or blob URL) */
810
+ src?: string;
811
+ /** Image MIME type */
812
+ mimeType?: string;
813
+ /** Original filename */
814
+ filename?: string;
815
+ /** Alt text for accessibility */
816
+ alt?: string;
817
+ /** Title/description */
818
+ title?: string;
819
+ /** Image size */
820
+ size: ImageSize;
821
+ /** Original size before any transforms */
822
+ originalSize?: ImageSize;
823
+ /** Wrap settings */
824
+ wrap: ImageWrap;
825
+ /** Position for floating images */
826
+ position?: ImagePosition;
827
+ /** Image transformations */
828
+ transform?: ImageTransform;
829
+ /** Padding around image */
830
+ padding?: ImagePadding;
831
+ /** Whether this is a decorative image */
832
+ decorative?: boolean;
833
+ /** Hyperlink URL for clickable image */
834
+ hlinkHref?: string;
835
+ /** Image outline/border */
836
+ outline?: ShapeOutline;
837
+ /** Image effects */
838
+ effects?: {
839
+ brightness?: number;
840
+ contrast?: number;
841
+ saturation?: number;
842
+ };
843
+ }
844
+ /**
845
+ * Shape types
846
+ */
847
+ type ShapeType = 'rect' | 'roundRect' | 'ellipse' | 'triangle' | 'rtTriangle' | 'parallelogram' | 'trapezoid' | 'pentagon' | 'hexagon' | 'heptagon' | 'octagon' | 'decagon' | 'dodecagon' | 'star4' | 'star5' | 'star6' | 'star7' | 'star8' | 'star10' | 'star12' | 'star16' | 'star24' | 'star32' | 'line' | 'straightConnector1' | 'bentConnector2' | 'bentConnector3' | 'bentConnector4' | 'bentConnector5' | 'curvedConnector2' | 'curvedConnector3' | 'curvedConnector4' | 'curvedConnector5' | 'rightArrow' | 'leftArrow' | 'upArrow' | 'downArrow' | 'leftRightArrow' | 'upDownArrow' | 'quadArrow' | 'leftRightUpArrow' | 'bentArrow' | 'uturnArrow' | 'leftUpArrow' | 'bentUpArrow' | 'curvedRightArrow' | 'curvedLeftArrow' | 'curvedUpArrow' | 'curvedDownArrow' | 'stripedRightArrow' | 'notchedRightArrow' | 'homePlate' | 'chevron' | 'rightArrowCallout' | 'downArrowCallout' | 'leftArrowCallout' | 'upArrowCallout' | 'leftRightArrowCallout' | 'quadArrowCallout' | 'circularArrow' | 'flowChartProcess' | 'flowChartAlternateProcess' | 'flowChartDecision' | 'flowChartInputOutput' | 'flowChartPredefinedProcess' | 'flowChartInternalStorage' | 'flowChartDocument' | 'flowChartMultidocument' | 'flowChartTerminator' | 'flowChartPreparation' | 'flowChartManualInput' | 'flowChartManualOperation' | 'flowChartConnector' | 'flowChartOffpageConnector' | 'flowChartPunchedCard' | 'flowChartPunchedTape' | 'flowChartSummingJunction' | 'flowChartOr' | 'flowChartCollate' | 'flowChartSort' | 'flowChartExtract' | 'flowChartMerge' | 'flowChartOnlineStorage' | 'flowChartDelay' | 'flowChartMagneticTape' | 'flowChartMagneticDisk' | 'flowChartMagneticDrum' | 'flowChartDisplay' | 'wedgeRectCallout' | 'wedgeRoundRectCallout' | 'wedgeEllipseCallout' | 'cloudCallout' | 'borderCallout1' | 'borderCallout2' | 'borderCallout3' | 'accentCallout1' | 'accentCallout2' | 'accentCallout3' | 'callout1' | 'callout2' | 'callout3' | 'accentBorderCallout1' | 'accentBorderCallout2' | 'accentBorderCallout3' | 'actionButtonBlank' | 'actionButtonHome' | 'actionButtonHelp' | 'actionButtonInformation' | 'actionButtonBackPrevious' | 'actionButtonForwardNext' | 'actionButtonBeginning' | 'actionButtonEnd' | 'actionButtonReturn' | 'actionButtonDocument' | 'actionButtonSound' | 'actionButtonMovie' | 'irregularSeal1' | 'irregularSeal2' | 'frame' | 'halfFrame' | 'corner' | 'diagStripe' | 'chord' | 'arc' | 'bracketPair' | 'bracePair' | 'leftBracket' | 'rightBracket' | 'leftBrace' | 'rightBrace' | 'can' | 'cube' | 'bevel' | 'donut' | 'noSmoking' | 'blockArc' | 'foldedCorner' | 'smileyFace' | 'heart' | 'lightningBolt' | 'sun' | 'moon' | 'cloud' | 'snip1Rect' | 'snip2SameRect' | 'snip2DiagRect' | 'snipRoundRect' | 'round1Rect' | 'round2SameRect' | 'round2DiagRect' | 'plaque' | 'teardrop' | 'mathPlus' | 'mathMinus' | 'mathMultiply' | 'mathDivide' | 'mathEqual' | 'mathNotEqual' | 'gear6' | 'gear9' | 'funnel' | 'pieWedge' | 'pie' | 'leftCircularArrow' | 'leftRightCircularArrow' | 'swooshArrow' | 'textBox';
848
+ /**
849
+ * Shape fill type
850
+ */
851
+ interface ShapeFill {
852
+ type: 'none' | 'solid' | 'gradient' | 'pattern' | 'picture';
853
+ /** Solid fill color */
854
+ color?: ColorValue;
855
+ /** Gradient stops for gradient fill */
856
+ gradient?: {
857
+ type: 'linear' | 'radial' | 'rectangular' | 'path';
858
+ angle?: number;
859
+ stops: Array<{
860
+ position: number;
861
+ color: ColorValue;
862
+ }>;
863
+ };
864
+ }
865
+ /**
866
+ * Shape outline/stroke
867
+ */
868
+ interface ShapeOutline {
869
+ /** Line width in EMUs */
870
+ width?: number;
871
+ /** Line color */
872
+ color?: ColorValue;
873
+ /** Line style */
874
+ style?: 'solid' | 'dot' | 'dash' | 'lgDash' | 'dashDot' | 'lgDashDot' | 'lgDashDotDot' | 'sysDot' | 'sysDash' | 'sysDashDot' | 'sysDashDotDot';
875
+ /** Line cap */
876
+ cap?: 'flat' | 'round' | 'square';
877
+ /** Line join */
878
+ join?: 'bevel' | 'miter' | 'round';
879
+ /** Head arrow */
880
+ headEnd?: {
881
+ type: 'none' | 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow';
882
+ width?: 'sm' | 'med' | 'lg';
883
+ length?: 'sm' | 'med' | 'lg';
884
+ };
885
+ /** Tail arrow */
886
+ tailEnd?: {
887
+ type: 'none' | 'triangle' | 'stealth' | 'diamond' | 'oval' | 'arrow';
888
+ width?: 'sm' | 'med' | 'lg';
889
+ length?: 'sm' | 'med' | 'lg';
890
+ };
891
+ }
892
+ /**
893
+ * Text body inside a shape
894
+ */
895
+ interface ShapeTextBody {
896
+ /** Text direction */
897
+ vertical?: boolean;
898
+ /** Rotation */
899
+ rotation?: number;
900
+ /** Anchor/vertical alignment */
901
+ anchor?: 'top' | 'middle' | 'bottom' | 'distributed' | 'justified';
902
+ /** Anchor center */
903
+ anchorCenter?: boolean;
904
+ /** Auto fit */
905
+ autoFit?: 'none' | 'normal' | 'shape';
906
+ /** Text margins */
907
+ margins?: {
908
+ top?: number;
909
+ bottom?: number;
910
+ left?: number;
911
+ right?: number;
912
+ };
913
+ /** Paragraphs inside the shape */
914
+ content: Paragraph[];
915
+ }
916
+ /**
917
+ * Shape/drawing object (wps:wsp)
918
+ */
919
+ interface Shape {
920
+ type: 'shape';
921
+ /** Shape type preset */
922
+ shapeType: ShapeType;
923
+ /** Unique ID */
924
+ id?: string;
925
+ /** Name */
926
+ name?: string;
927
+ /** Size in EMUs */
928
+ size: ImageSize;
929
+ /** Position for floating shapes */
930
+ position?: ImagePosition;
931
+ /** Wrap settings */
932
+ wrap?: ImageWrap;
933
+ /** Fill */
934
+ fill?: ShapeFill;
935
+ /** Outline/stroke */
936
+ outline?: ShapeOutline;
937
+ /** Transform */
938
+ transform?: ImageTransform;
939
+ /** Text content inside the shape */
940
+ textBody?: ShapeTextBody;
941
+ /** Custom geometry points */
942
+ customGeometry?: string;
943
+ }
944
+ /**
945
+ * Text box (floating text container)
946
+ */
947
+ interface TextBox {
948
+ type: 'textBox';
949
+ /** Unique ID */
950
+ id?: string;
951
+ /** Size */
952
+ size: ImageSize;
953
+ /** Position */
954
+ position?: ImagePosition;
955
+ /** Wrap settings */
956
+ wrap?: ImageWrap;
957
+ /** Fill */
958
+ fill?: ShapeFill;
959
+ /** Outline */
960
+ outline?: ShapeOutline;
961
+ /** Text content */
962
+ content: Paragraph[];
963
+ /** Internal margins */
964
+ margins?: {
965
+ top?: number;
966
+ bottom?: number;
967
+ left?: number;
968
+ right?: number;
969
+ };
970
+ }
971
+ /**
972
+ * Table cell
973
+ */
974
+ interface TableCell {
975
+ type: 'tableCell';
976
+ /** Cell formatting */
977
+ formatting?: TableCellFormatting;
978
+ /** Cell-level tracked property changes (w:tcPrChange) */
979
+ propertyChanges?: TableCellPropertyChange[];
980
+ /** Tracked structural changes (cell insert/delete/merge) */
981
+ structuralChange?: TableStructuralChangeInfo;
982
+ /** Cell content (paragraphs, tables, etc.) */
983
+ content: (Paragraph | Table)[];
984
+ }
985
+ /**
986
+ * Table row
987
+ */
988
+ interface TableRow {
989
+ type: 'tableRow';
990
+ /** Row formatting */
991
+ formatting?: TableRowFormatting;
992
+ /** Row-level tracked property changes (w:trPrChange) */
993
+ propertyChanges?: TableRowPropertyChange[];
994
+ /** Tracked structural changes (row insert/delete) */
995
+ structuralChange?: TableStructuralChangeInfo;
996
+ /** Cells in this row */
997
+ cells: TableCell[];
998
+ }
999
+ /**
1000
+ * Table (w:tbl)
1001
+ */
1002
+ interface Table {
1003
+ type: 'table';
1004
+ /** Table formatting */
1005
+ formatting?: TableFormatting;
1006
+ /** Table-level tracked property changes (w:tblPrChange) */
1007
+ propertyChanges?: TablePropertyChange[];
1008
+ /** Column widths in twips */
1009
+ columnWidths?: number[];
1010
+ /** Table rows */
1011
+ rows: TableRow[];
1012
+ }
1013
+ /**
1014
+ * A comment (w:comment) from comments.xml
1015
+ */
1016
+ interface Comment {
1017
+ /** Comment ID (matches commentRangeStart/End) */
1018
+ id: number;
1019
+ /** Author name */
1020
+ author: string;
1021
+ /** Author initials */
1022
+ initials?: string;
1023
+ /** Date */
1024
+ date?: string;
1025
+ /** Comment content (paragraphs) */
1026
+ content: Paragraph[];
1027
+ /** Parent comment ID (for replies) */
1028
+ parentId?: number;
1029
+ /** Whether the comment is resolved/done */
1030
+ done?: boolean;
1031
+ }
1032
+ /**
1033
+ * Comment range start marker in paragraph content
1034
+ */
1035
+ interface CommentRangeStart {
1036
+ type: 'commentRangeStart';
1037
+ id: number;
1038
+ }
1039
+ /**
1040
+ * Comment range end marker in paragraph content
1041
+ */
1042
+ interface CommentRangeEnd {
1043
+ type: 'commentRangeEnd';
1044
+ id: number;
1045
+ }
1046
+ /**
1047
+ * Math equation content (m:oMath or m:oMathPara)
1048
+ */
1049
+ interface MathEquation {
1050
+ type: 'mathEquation';
1051
+ /** Whether this is a block (oMathPara) or inline (oMath) equation */
1052
+ display: 'inline' | 'block';
1053
+ /** Raw OMML XML for round-trip preservation */
1054
+ ommlXml: string;
1055
+ /** Plain text representation for accessibility/fallback */
1056
+ plainText?: string;
1057
+ }
1058
+ /**
1059
+ * Tracked change metadata (w:ins, w:del attributes)
1060
+ */
1061
+ interface TrackedChangeInfo {
1062
+ /** Revision ID */
1063
+ id: number;
1064
+ /** Author who made the change */
1065
+ author: string;
1066
+ /** Date of the change */
1067
+ date?: string;
1068
+ }
1069
+ /**
1070
+ * Generic tracked property-change wrapper metadata (w:*PrChange)
1071
+ */
1072
+ interface PropertyChangeInfo extends TrackedChangeInfo {
1073
+ /** Optional revision session ID */
1074
+ rsid?: string;
1075
+ }
1076
+ /**
1077
+ * Insertion wrapper (w:ins) — runs inserted by tracked changes
1078
+ */
1079
+ interface Insertion {
1080
+ type: 'insertion';
1081
+ /** Tracked change metadata */
1082
+ info: TrackedChangeInfo;
1083
+ /** Inserted content */
1084
+ content: (Run | Hyperlink)[];
1085
+ }
1086
+ /**
1087
+ * Deletion wrapper (w:del) — runs deleted by tracked changes
1088
+ */
1089
+ interface Deletion {
1090
+ type: 'deletion';
1091
+ /** Tracked change metadata */
1092
+ info: TrackedChangeInfo;
1093
+ /** Deleted content */
1094
+ content: (Run | Hyperlink)[];
1095
+ }
1096
+ /**
1097
+ * Move-from wrapper (w:moveFrom) — content moved away from this position
1098
+ */
1099
+ interface MoveFrom {
1100
+ type: 'moveFrom';
1101
+ /** Tracked change metadata */
1102
+ info: TrackedChangeInfo;
1103
+ /** Moved content */
1104
+ content: (Run | Hyperlink)[];
1105
+ }
1106
+ /**
1107
+ * Move-to wrapper (w:moveTo) — content moved into this position
1108
+ */
1109
+ interface MoveTo {
1110
+ type: 'moveTo';
1111
+ /** Tracked change metadata */
1112
+ info: TrackedChangeInfo;
1113
+ /** Moved content */
1114
+ content: (Run | Hyperlink)[];
1115
+ }
1116
+ /**
1117
+ * Move-from range start marker (w:moveFromRangeStart) — ECMA-376 §17.13.5.22
1118
+ * Pairs with moveFromRangeEnd to delimit the source of a move in the document.
1119
+ */
1120
+ interface MoveFromRangeStart {
1121
+ type: 'moveFromRangeStart';
1122
+ id: number;
1123
+ name: string;
1124
+ }
1125
+ /**
1126
+ * Move-from range end marker (w:moveFromRangeEnd)
1127
+ */
1128
+ interface MoveFromRangeEnd {
1129
+ type: 'moveFromRangeEnd';
1130
+ id: number;
1131
+ }
1132
+ /**
1133
+ * Move-to range start marker (w:moveToRangeStart) — ECMA-376 §17.13.5.24
1134
+ * Pairs with moveToRangeEnd to delimit the destination of a move.
1135
+ */
1136
+ interface MoveToRangeStart {
1137
+ type: 'moveToRangeStart';
1138
+ id: number;
1139
+ name: string;
1140
+ }
1141
+ /**
1142
+ * Move-to range end marker (w:moveToRangeEnd)
1143
+ */
1144
+ interface MoveToRangeEnd {
1145
+ type: 'moveToRangeEnd';
1146
+ id: number;
1147
+ }
1148
+ /**
1149
+ * Run-level tracked wrappers represented in WordprocessingML.
1150
+ */
1151
+ type TrackedRunChange = Insertion | Deletion | MoveFrom | MoveTo;
1152
+ /**
1153
+ * Run property change (w:rPrChange)
1154
+ */
1155
+ interface RunPropertyChange {
1156
+ type: 'runPropertyChange';
1157
+ /** Tracked change metadata */
1158
+ info: PropertyChangeInfo;
1159
+ /** Run properties before the tracked change */
1160
+ previousFormatting?: TextFormatting;
1161
+ /** Run properties after the tracked change (editor model convenience) */
1162
+ currentFormatting?: TextFormatting;
1163
+ }
1164
+ /**
1165
+ * Paragraph property change (w:pPrChange)
1166
+ */
1167
+ interface ParagraphPropertyChange {
1168
+ type: 'paragraphPropertyChange';
1169
+ /** Tracked change metadata */
1170
+ info: PropertyChangeInfo;
1171
+ /** Paragraph properties before the tracked change */
1172
+ previousFormatting?: ParagraphFormatting;
1173
+ /** Paragraph properties after the tracked change (editor model convenience) */
1174
+ currentFormatting?: ParagraphFormatting;
1175
+ }
1176
+ /**
1177
+ * Table property change (w:tblPrChange)
1178
+ */
1179
+ interface TablePropertyChange {
1180
+ type: 'tablePropertyChange';
1181
+ /** Tracked change metadata */
1182
+ info: PropertyChangeInfo;
1183
+ /** Table properties before the tracked change */
1184
+ previousFormatting?: TableFormatting;
1185
+ /** Table properties after the tracked change (editor model convenience) */
1186
+ currentFormatting?: TableFormatting;
1187
+ }
1188
+ /**
1189
+ * Table row property change (w:trPrChange)
1190
+ */
1191
+ interface TableRowPropertyChange {
1192
+ type: 'tableRowPropertyChange';
1193
+ /** Tracked change metadata */
1194
+ info: PropertyChangeInfo;
1195
+ /** Row properties before the tracked change */
1196
+ previousFormatting?: TableRowFormatting;
1197
+ /** Row properties after the tracked change (editor model convenience) */
1198
+ currentFormatting?: TableRowFormatting;
1199
+ }
1200
+ /**
1201
+ * Table cell property change (w:tcPrChange)
1202
+ */
1203
+ interface TableCellPropertyChange {
1204
+ type: 'tableCellPropertyChange';
1205
+ /** Tracked change metadata */
1206
+ info: PropertyChangeInfo;
1207
+ /** Cell properties before the tracked change */
1208
+ previousFormatting?: TableCellFormatting;
1209
+ /** Cell properties after the tracked change (editor model convenience) */
1210
+ currentFormatting?: TableCellFormatting;
1211
+ }
1212
+ /**
1213
+ * Table structural tracked change metadata (row/cell insert/delete/merge)
1214
+ */
1215
+ interface TableStructuralChangeInfo {
1216
+ type: 'tableRowInsertion' | 'tableRowDeletion' | 'tableCellInsertion' | 'tableCellDeletion' | 'tableCellMerge';
1217
+ /** Tracked change metadata */
1218
+ info: TrackedChangeInfo;
1219
+ }
1220
+ /**
1221
+ * SDT type (content control type)
1222
+ */
1223
+ type SdtType = 'richText' | 'plainText' | 'date' | 'dropdown' | 'comboBox' | 'checkbox' | 'picture' | 'buildingBlockGallery' | 'group' | 'unknown';
1224
+ /**
1225
+ * SDT properties (w:sdtPr)
1226
+ */
1227
+ interface SdtProperties {
1228
+ /** SDT type */
1229
+ sdtType: SdtType;
1230
+ /** Alias (friendly name) */
1231
+ alias?: string;
1232
+ /** Tag (developer identifier) */
1233
+ tag?: string;
1234
+ /** Lock content editing */
1235
+ lock?: 'sdtLocked' | 'contentLocked' | 'sdtContentLocked' | 'unlocked';
1236
+ /** Placeholder text */
1237
+ placeholder?: string;
1238
+ /** Whether showing placeholder */
1239
+ showingPlaceholder?: boolean;
1240
+ /** Date format for date controls */
1241
+ dateFormat?: string;
1242
+ /** Dropdown/combobox list items */
1243
+ listItems?: {
1244
+ displayText: string;
1245
+ value: string;
1246
+ }[];
1247
+ /** Checkbox checked state */
1248
+ checked?: boolean;
1249
+ }
1250
+ /**
1251
+ * Inline SDT (content control within a paragraph)
1252
+ */
1253
+ interface InlineSdt {
1254
+ type: 'inlineSdt';
1255
+ /** SDT properties */
1256
+ properties: SdtProperties;
1257
+ /** Content runs inside the control */
1258
+ content: (Run | Hyperlink)[];
1259
+ }
1260
+ /**
1261
+ * Block-level SDT (content control wrapping paragraphs/tables)
1262
+ */
1263
+ interface BlockSdt {
1264
+ type: 'blockSdt';
1265
+ /** SDT properties */
1266
+ properties: SdtProperties;
1267
+ /** Block content inside the control */
1268
+ content: (Paragraph | Table)[];
1269
+ }
1270
+ /**
1271
+ * Paragraph content types
1272
+ */
1273
+ type ParagraphContent = Run | Hyperlink | BookmarkStart | BookmarkEnd | SimpleField | ComplexField | InlineSdt | CommentRangeStart | CommentRangeEnd | Insertion | Deletion | MoveFrom | MoveTo | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd | MathEquation;
1274
+ /**
1275
+ * Paragraph (w:p)
1276
+ */
1277
+ interface Paragraph {
1278
+ type: 'paragraph';
1279
+ /** Unique paragraph ID */
1280
+ paraId?: string;
1281
+ /** Text ID */
1282
+ textId?: string;
1283
+ /** Paragraph formatting */
1284
+ formatting?: ParagraphFormatting;
1285
+ /** Paragraph-level tracked property changes (w:pPrChange) */
1286
+ propertyChanges?: ParagraphPropertyChange[];
1287
+ /** Paragraph content */
1288
+ content: ParagraphContent[];
1289
+ /** Computed list rendering (if this is a list item) */
1290
+ listRendering?: ListRendering;
1291
+ /** Section properties (if this paragraph ends a section) */
1292
+ sectionProperties?: SectionProperties;
1293
+ }
1294
+ /**
1295
+ * Header/footer type
1296
+ */
1297
+ type HeaderFooterType = 'default' | 'first' | 'even';
1298
+ /**
1299
+ * Header or footer reference
1300
+ */
1301
+ interface HeaderReference {
1302
+ type: HeaderFooterType;
1303
+ rId: string;
1304
+ }
1305
+ interface FooterReference {
1306
+ type: HeaderFooterType;
1307
+ rId: string;
1308
+ }
1309
+ /**
1310
+ * Header or footer content
1311
+ */
1312
+ interface HeaderFooter {
1313
+ type: 'header' | 'footer';
1314
+ /** Header/footer type */
1315
+ hdrFtrType: HeaderFooterType;
1316
+ /** Content (paragraphs, tables, etc.) */
1317
+ content: (Paragraph | Table)[];
1318
+ }
1319
+ /**
1320
+ * Footnote position
1321
+ */
1322
+ type FootnotePosition = 'pageBottom' | 'beneathText' | 'sectEnd' | 'docEnd';
1323
+ /**
1324
+ * Endnote position
1325
+ */
1326
+ type EndnotePosition = 'sectEnd' | 'docEnd';
1327
+ /**
1328
+ * Number restart type
1329
+ */
1330
+ type NoteNumberRestart = 'continuous' | 'eachSect' | 'eachPage';
1331
+ /**
1332
+ * Footnote properties
1333
+ */
1334
+ interface FootnoteProperties {
1335
+ position?: FootnotePosition;
1336
+ numFmt?: NumberFormat;
1337
+ numStart?: number;
1338
+ numRestart?: NoteNumberRestart;
1339
+ }
1340
+ /**
1341
+ * Endnote properties
1342
+ */
1343
+ interface EndnoteProperties {
1344
+ position?: EndnotePosition;
1345
+ numFmt?: NumberFormat;
1346
+ numStart?: number;
1347
+ numRestart?: NoteNumberRestart;
1348
+ }
1349
+ /**
1350
+ * Footnote (w:footnote)
1351
+ */
1352
+ interface Footnote {
1353
+ type: 'footnote';
1354
+ /** Footnote ID */
1355
+ id: number;
1356
+ /** Special footnote type */
1357
+ noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
1358
+ /** Content */
1359
+ content: Paragraph[];
1360
+ }
1361
+ /**
1362
+ * Endnote (w:endnote)
1363
+ */
1364
+ interface Endnote {
1365
+ type: 'endnote';
1366
+ /** Endnote ID */
1367
+ id: number;
1368
+ /** Special endnote type */
1369
+ noteType?: 'normal' | 'separator' | 'continuationSeparator' | 'continuationNotice';
1370
+ /** Content */
1371
+ content: Paragraph[];
1372
+ }
1373
+ /**
1374
+ * Page orientation
1375
+ */
1376
+ type PageOrientation = 'portrait' | 'landscape';
1377
+ /**
1378
+ * Section start type
1379
+ */
1380
+ type SectionStart = 'continuous' | 'nextPage' | 'oddPage' | 'evenPage' | 'nextColumn';
1381
+ /**
1382
+ * Vertical alignment
1383
+ */
1384
+ type VerticalAlign = 'top' | 'center' | 'both' | 'bottom';
1385
+ /**
1386
+ * Line number restart type
1387
+ */
1388
+ type LineNumberRestart = 'continuous' | 'newPage' | 'newSection';
1389
+ /**
1390
+ * Column definition
1391
+ */
1392
+ interface Column {
1393
+ /** Column width in twips */
1394
+ width?: number;
1395
+ /** Space after column in twips */
1396
+ space?: number;
1397
+ }
1398
+ /**
1399
+ * Section properties (w:sectPr)
1400
+ */
1401
+ interface SectionProperties {
1402
+ /** Page width in twips */
1403
+ pageWidth?: number;
1404
+ /** Page height in twips */
1405
+ pageHeight?: number;
1406
+ /** Page orientation */
1407
+ orientation?: PageOrientation;
1408
+ /** Top margin in twips */
1409
+ marginTop?: number;
1410
+ /** Bottom margin in twips */
1411
+ marginBottom?: number;
1412
+ /** Left margin in twips */
1413
+ marginLeft?: number;
1414
+ /** Right margin in twips */
1415
+ marginRight?: number;
1416
+ /** Header distance from top in twips */
1417
+ headerDistance?: number;
1418
+ /** Footer distance from bottom in twips */
1419
+ footerDistance?: number;
1420
+ /** Gutter margin in twips */
1421
+ gutter?: number;
1422
+ /** Number of columns */
1423
+ columnCount?: number;
1424
+ /** Space between columns in twips */
1425
+ columnSpace?: number;
1426
+ /** Equal width columns */
1427
+ equalWidth?: boolean;
1428
+ /** Separator line between columns */
1429
+ separator?: boolean;
1430
+ /** Individual column definitions */
1431
+ columns?: Column[];
1432
+ /** Section start type */
1433
+ sectionStart?: SectionStart;
1434
+ /** Vertical alignment of text */
1435
+ verticalAlign?: VerticalAlign;
1436
+ /** Right-to-left section */
1437
+ bidi?: boolean;
1438
+ /** Header references */
1439
+ headerReferences?: HeaderReference[];
1440
+ /** Footer references */
1441
+ footerReferences?: FooterReference[];
1442
+ /** Different first page header/footer */
1443
+ titlePg?: boolean;
1444
+ /** Different odd/even page headers/footers */
1445
+ evenAndOddHeaders?: boolean;
1446
+ /** Line numbering settings */
1447
+ lineNumbers?: {
1448
+ start?: number;
1449
+ countBy?: number;
1450
+ distance?: number;
1451
+ restart?: LineNumberRestart;
1452
+ };
1453
+ /** Page borders */
1454
+ pageBorders?: {
1455
+ top?: BorderSpec;
1456
+ bottom?: BorderSpec;
1457
+ left?: BorderSpec;
1458
+ right?: BorderSpec;
1459
+ /** Display setting */
1460
+ display?: 'allPages' | 'firstPage' | 'notFirstPage';
1461
+ /** Offset from */
1462
+ offsetFrom?: 'page' | 'text';
1463
+ /** Z-order */
1464
+ zOrder?: 'front' | 'back';
1465
+ };
1466
+ /** Page background */
1467
+ background?: {
1468
+ color?: ColorValue;
1469
+ themeColor?: ThemeColorSlot;
1470
+ themeTint?: string;
1471
+ themeShade?: string;
1472
+ };
1473
+ /** Footnote properties for this section */
1474
+ footnotePr?: FootnoteProperties;
1475
+ /** Endnote properties for this section */
1476
+ endnotePr?: EndnoteProperties;
1477
+ /** Document grid */
1478
+ docGrid?: {
1479
+ type?: 'default' | 'lines' | 'linesAndChars' | 'snapToChars';
1480
+ linePitch?: number;
1481
+ charSpace?: number;
1482
+ };
1483
+ /** First page paper source */
1484
+ paperSrcFirst?: number;
1485
+ /** Other pages paper source */
1486
+ paperSrcOther?: number;
1487
+ }
1488
+ /**
1489
+ * Block-level content types
1490
+ */
1491
+ type BlockContent = Paragraph | Table | BlockSdt;
1492
+ /**
1493
+ * Section (implicit or explicit based on sectPr)
1494
+ */
1495
+ interface Section {
1496
+ /** Section properties */
1497
+ properties: SectionProperties;
1498
+ /** Content in this section */
1499
+ content: BlockContent[];
1500
+ /** Headers for this section */
1501
+ headers?: Map<HeaderFooterType, HeaderFooter>;
1502
+ /** Footers for this section */
1503
+ footers?: Map<HeaderFooterType, HeaderFooter>;
1504
+ }
1505
+ /**
1506
+ * Document body (w:body)
1507
+ */
1508
+ interface DocumentBody {
1509
+ /** All content (paragraphs, tables) */
1510
+ content: BlockContent[];
1511
+ /** Sections (derived from sectPr in paragraphs and final sectPr) */
1512
+ sections?: Section[];
1513
+ /** Final section properties (from body's sectPr) */
1514
+ finalSectionProperties?: SectionProperties;
1515
+ /** Comments from comments.xml */
1516
+ comments?: Comment[];
1517
+ }
1518
+
1519
+ /**
1520
+ * Styles, Theme, Font Table, Relationships & Media Types
1521
+ *
1522
+ * Types for document-level definitions that don't form the content tree.
1523
+ */
1524
+
1525
+ /**
1526
+ * Style type
1527
+ */
1528
+ type StyleType = 'paragraph' | 'character' | 'numbering' | 'table';
1529
+ /**
1530
+ * Style definition
1531
+ */
1532
+ interface Style {
1533
+ /** Style ID */
1534
+ styleId: string;
1535
+ /** Style type */
1536
+ type: StyleType;
1537
+ /** Display name */
1538
+ name?: string;
1539
+ /** Based on style ID */
1540
+ basedOn?: string;
1541
+ /** Next style after Enter (for paragraph styles) */
1542
+ next?: string;
1543
+ /** Linked style (paragraph/character pair) */
1544
+ link?: string;
1545
+ /** UI sort priority */
1546
+ uiPriority?: number;
1547
+ /** Hidden from UI */
1548
+ hidden?: boolean;
1549
+ /** Semi-hidden from UI */
1550
+ semiHidden?: boolean;
1551
+ /** Unhide when used */
1552
+ unhideWhenUsed?: boolean;
1553
+ /** Quick format in gallery */
1554
+ qFormat?: boolean;
1555
+ /** Is default style */
1556
+ default?: boolean;
1557
+ /** Personal style (custom) */
1558
+ personal?: boolean;
1559
+ /** Paragraph properties (for paragraph/table styles) */
1560
+ pPr?: ParagraphFormatting;
1561
+ /** Run properties */
1562
+ rPr?: TextFormatting;
1563
+ /** Table properties (for table styles) */
1564
+ tblPr?: TableFormatting;
1565
+ /** Table row properties */
1566
+ trPr?: TableRowFormatting;
1567
+ /** Table cell properties */
1568
+ tcPr?: TableCellFormatting;
1569
+ /** Conditional table style parts */
1570
+ tblStylePr?: Array<{
1571
+ type: 'band1Horz' | 'band1Vert' | 'band2Horz' | 'band2Vert' | 'firstCol' | 'firstRow' | 'lastCol' | 'lastRow' | 'neCell' | 'nwCell' | 'seCell' | 'swCell';
1572
+ pPr?: ParagraphFormatting;
1573
+ rPr?: TextFormatting;
1574
+ tblPr?: TableFormatting;
1575
+ trPr?: TableRowFormatting;
1576
+ tcPr?: TableCellFormatting;
1577
+ }>;
1578
+ }
1579
+ /**
1580
+ * Document defaults (w:docDefaults)
1581
+ */
1582
+ interface DocDefaults {
1583
+ /** Default run properties */
1584
+ rPr?: TextFormatting;
1585
+ /** Default paragraph properties */
1586
+ pPr?: ParagraphFormatting;
1587
+ }
1588
+ /**
1589
+ * Style definitions from styles.xml
1590
+ */
1591
+ interface StyleDefinitions {
1592
+ /** Document defaults */
1593
+ docDefaults?: DocDefaults;
1594
+ /** Latent styles */
1595
+ latentStyles?: {
1596
+ defLockedState?: boolean;
1597
+ defUIPriority?: number;
1598
+ defSemiHidden?: boolean;
1599
+ defUnhideWhenUsed?: boolean;
1600
+ defQFormat?: boolean;
1601
+ count?: number;
1602
+ };
1603
+ /** Style definitions */
1604
+ styles: Style[];
1605
+ }
1606
+ /**
1607
+ * Theme color scheme (a:clrScheme)
1608
+ */
1609
+ interface ThemeColorScheme {
1610
+ /** Dark 1 color (usually black) */
1611
+ dk1?: string;
1612
+ /** Light 1 color (usually white) */
1613
+ lt1?: string;
1614
+ /** Dark 2 color */
1615
+ dk2?: string;
1616
+ /** Light 2 color */
1617
+ lt2?: string;
1618
+ /** Accent colors 1-6 */
1619
+ accent1?: string;
1620
+ accent2?: string;
1621
+ accent3?: string;
1622
+ accent4?: string;
1623
+ accent5?: string;
1624
+ accent6?: string;
1625
+ /** Hyperlink color */
1626
+ hlink?: string;
1627
+ /** Followed hyperlink color */
1628
+ folHlink?: string;
1629
+ }
1630
+ /**
1631
+ * Theme font (with script variants)
1632
+ */
1633
+ interface ThemeFont {
1634
+ /** Latin font */
1635
+ latin?: string;
1636
+ /** East Asian font */
1637
+ ea?: string;
1638
+ /** Complex script font */
1639
+ cs?: string;
1640
+ /** Script-specific fonts */
1641
+ fonts?: Record<string, string>;
1642
+ }
1643
+ /**
1644
+ * Theme font scheme (a:fontScheme)
1645
+ */
1646
+ interface ThemeFontScheme {
1647
+ /** Major font (headings) */
1648
+ majorFont?: ThemeFont;
1649
+ /** Minor font (body text) */
1650
+ minorFont?: ThemeFont;
1651
+ }
1652
+ /**
1653
+ * Theme (from theme1.xml)
1654
+ */
1655
+ interface Theme {
1656
+ /** Theme name */
1657
+ name?: string;
1658
+ /** Color scheme */
1659
+ colorScheme?: ThemeColorScheme;
1660
+ /** Font scheme */
1661
+ fontScheme?: ThemeFontScheme;
1662
+ /** Format scheme (fills, lines, effects) - simplified */
1663
+ formatScheme?: {
1664
+ name?: string;
1665
+ };
1666
+ }
1667
+ /**
1668
+ * Font info from fontTable.xml
1669
+ */
1670
+ interface FontInfo {
1671
+ /** Font name */
1672
+ name: string;
1673
+ /** Alternate names */
1674
+ altName?: string;
1675
+ /** Panose-1 classification */
1676
+ panose1?: string;
1677
+ /** Character set */
1678
+ charset?: string;
1679
+ /** Font family type */
1680
+ family?: 'decorative' | 'modern' | 'roman' | 'script' | 'swiss' | 'auto';
1681
+ /** Pitch (fixed or variable) */
1682
+ pitch?: 'default' | 'fixed' | 'variable';
1683
+ /** Signature */
1684
+ sig?: {
1685
+ usb0?: string;
1686
+ usb1?: string;
1687
+ usb2?: string;
1688
+ usb3?: string;
1689
+ csb0?: string;
1690
+ csb1?: string;
1691
+ };
1692
+ /** Embedded font data reference */
1693
+ embedRegular?: string;
1694
+ embedBold?: string;
1695
+ embedItalic?: string;
1696
+ embedBoldItalic?: string;
1697
+ }
1698
+ /**
1699
+ * Font table from fontTable.xml
1700
+ */
1701
+ interface FontTable {
1702
+ fonts: FontInfo[];
1703
+ }
1704
+ /**
1705
+ * Relationship type
1706
+ */
1707
+ type RelationshipType = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/header' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart' | 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData' | string;
1708
+ /**
1709
+ * Relationship entry
1710
+ */
1711
+ interface Relationship {
1712
+ /** Relationship ID (e.g., "rId1") */
1713
+ id: string;
1714
+ /** Relationship type URI */
1715
+ type: RelationshipType;
1716
+ /** Target path or URL */
1717
+ target: string;
1718
+ /** Target mode */
1719
+ targetMode?: 'External' | 'Internal';
1720
+ }
1721
+ /**
1722
+ * Relationship map (keyed by rId)
1723
+ */
1724
+ type RelationshipMap = Map<string, Relationship>;
1725
+ /**
1726
+ * Media file from word/media/
1727
+ */
1728
+ interface MediaFile {
1729
+ /** File path in ZIP */
1730
+ path: string;
1731
+ /** Original filename */
1732
+ filename?: string;
1733
+ /** MIME type */
1734
+ mimeType: string;
1735
+ /** Binary data */
1736
+ data: ArrayBuffer;
1737
+ /** Base64 encoded data for rendering */
1738
+ base64?: string;
1739
+ /** Data URL for direct use in src attributes */
1740
+ dataUrl?: string;
1741
+ }
1742
+
1743
+ /**
1744
+ * Comprehensive TypeScript types for full DOCX document representation
1745
+ *
1746
+ * This barrel file re-exports all types from the split modules.
1747
+ * Existing imports from './types/document' continue to work unchanged.
1748
+ *
1749
+ * Module structure:
1750
+ * - colors.ts — Color primitives, borders, shading
1751
+ * - formatting.ts — Text, paragraph, and table formatting properties
1752
+ * - lists.ts — Numbering and list definitions
1753
+ * - content.ts — Content model (runs, images, shapes, tables, paragraphs, sections)
1754
+ * - styles.ts — Styles, theme, fonts, relationships, media
1755
+ */
1756
+
1757
+ /**
1758
+ * Complete DOCX package structure
1759
+ */
1760
+ interface DocxPackage {
1761
+ /** Document body */
1762
+ document: DocumentBody;
1763
+ /** Style definitions */
1764
+ styles?: StyleDefinitions;
1765
+ /** Theme */
1766
+ theme?: Theme;
1767
+ /** Numbering definitions */
1768
+ numbering?: NumberingDefinitions;
1769
+ /** Font table */
1770
+ fontTable?: FontTable;
1771
+ /** Footnotes */
1772
+ footnotes?: Footnote[];
1773
+ /** Endnotes */
1774
+ endnotes?: Endnote[];
1775
+ /** Headers by relationship ID */
1776
+ headers?: Map<string, HeaderFooter>;
1777
+ /** Footers by relationship ID */
1778
+ footers?: Map<string, HeaderFooter>;
1779
+ /** Document relationships */
1780
+ relationships?: RelationshipMap;
1781
+ /** Media files */
1782
+ media?: Map<string, MediaFile>;
1783
+ /** Document properties */
1784
+ properties?: {
1785
+ title?: string;
1786
+ subject?: string;
1787
+ creator?: string;
1788
+ keywords?: string;
1789
+ description?: string;
1790
+ lastModifiedBy?: string;
1791
+ revision?: number;
1792
+ created?: Date;
1793
+ modified?: Date;
1794
+ };
1795
+ }
1796
+ /**
1797
+ * Complete parsed DOCX document
1798
+ */
1799
+ interface Document {
1800
+ /** DOCX package with all parsed content */
1801
+ package: DocxPackage;
1802
+ /** Original ArrayBuffer for round-trip */
1803
+ originalBuffer?: ArrayBuffer;
1804
+ /** Detected template variables ({{...}}) */
1805
+ templateVariables?: string[];
1806
+ /** Parsing warnings/errors */
1807
+ warnings?: string[];
1808
+ }
1809
+
1810
+ /**
1811
+ * Agent API Types
1812
+ *
1813
+ * TypeScript interfaces for the agent API:
1814
+ * - Position and Range types
1815
+ * - Command types for document manipulation
1816
+ * - Context types for AI agents
1817
+ */
1818
+
1819
+ /**
1820
+ * Position within a document
1821
+ */
1822
+ interface Position {
1823
+ /** Index of the paragraph (0-indexed) */
1824
+ paragraphIndex: number;
1825
+ /** Offset within the paragraph in characters */
1826
+ offset: number;
1827
+ /** Optional: Content index within paragraph (run, hyperlink, etc.) */
1828
+ contentIndex?: number;
1829
+ /** Optional: Section index */
1830
+ sectionIndex?: number;
1831
+ }
1832
+ /**
1833
+ * Range within a document
1834
+ */
1835
+ interface Range {
1836
+ /** Start position */
1837
+ start: Position;
1838
+ /** End position */
1839
+ end: Position;
1840
+ /** Whether the range is collapsed (cursor position) */
1841
+ collapsed?: boolean;
1842
+ }
1843
+ /**
1844
+ * Create a collapsed range (cursor) at a position
1845
+ */
1846
+ declare function createCollapsedRange(position: Position): Range;
1847
+ /**
1848
+ * Create a range from two positions
1849
+ */
1850
+ declare function createRange(start: Position, end: Position): Range;
1851
+ /**
1852
+ * Check if a position is within a range
1853
+ */
1854
+ declare function isPositionInRange(position: Position, range: Range): boolean;
1855
+ /**
1856
+ * Compare two positions
1857
+ * Returns: -1 if a < b, 0 if equal, 1 if a > b
1858
+ */
1859
+ declare function comparePositions(a: Position, b: Position): -1 | 0 | 1;
1860
+ /**
1861
+ * Base command interface
1862
+ */
1863
+ interface BaseCommand {
1864
+ /** Command type */
1865
+ type: string;
1866
+ /** Unique command ID (for undo tracking) */
1867
+ id?: string;
1868
+ }
1869
+ /**
1870
+ * Insert text at a position
1871
+ */
1872
+ interface InsertTextCommand extends BaseCommand {
1873
+ type: 'insertText';
1874
+ /** Position to insert at */
1875
+ position: Position;
1876
+ /** Text to insert */
1877
+ text: string;
1878
+ /** Optional formatting for the inserted text */
1879
+ formatting?: TextFormatting;
1880
+ }
1881
+ /**
1882
+ * Replace text in a range
1883
+ */
1884
+ interface ReplaceTextCommand extends BaseCommand {
1885
+ type: 'replaceText';
1886
+ /** Range to replace */
1887
+ range: Range;
1888
+ /** Replacement text */
1889
+ text: string;
1890
+ /** Optional formatting for the new text */
1891
+ formatting?: TextFormatting;
1892
+ }
1893
+ /**
1894
+ * Delete text in a range
1895
+ */
1896
+ interface DeleteTextCommand extends BaseCommand {
1897
+ type: 'deleteText';
1898
+ /** Range to delete */
1899
+ range: Range;
1900
+ }
1901
+ /**
1902
+ * Apply formatting to a range
1903
+ */
1904
+ interface FormatTextCommand extends BaseCommand {
1905
+ type: 'formatText';
1906
+ /** Range to format */
1907
+ range: Range;
1908
+ /** Formatting to apply */
1909
+ formatting: Partial<TextFormatting>;
1910
+ }
1911
+ /**
1912
+ * Apply paragraph formatting
1913
+ */
1914
+ interface FormatParagraphCommand extends BaseCommand {
1915
+ type: 'formatParagraph';
1916
+ /** Paragraph index */
1917
+ paragraphIndex: number;
1918
+ /** Formatting to apply */
1919
+ formatting: Partial<ParagraphFormatting>;
1920
+ }
1921
+ /**
1922
+ * Apply a named style to a paragraph
1923
+ */
1924
+ interface ApplyStyleCommand extends BaseCommand {
1925
+ type: 'applyStyle';
1926
+ /** Paragraph index */
1927
+ paragraphIndex: number;
1928
+ /** Style ID to apply */
1929
+ styleId: string;
1930
+ }
1931
+ /**
1932
+ * Insert a table at a position
1933
+ */
1934
+ interface InsertTableCommand extends BaseCommand {
1935
+ type: 'insertTable';
1936
+ /** Position to insert at */
1937
+ position: Position;
1938
+ /** Number of rows */
1939
+ rows: number;
1940
+ /** Number of columns */
1941
+ columns: number;
1942
+ /** Optional table data */
1943
+ data?: string[][];
1944
+ /** Optional header row */
1945
+ hasHeader?: boolean;
1946
+ }
1947
+ /**
1948
+ * Insert an image at a position
1949
+ */
1950
+ interface InsertImageCommand extends BaseCommand {
1951
+ type: 'insertImage';
1952
+ /** Position to insert at */
1953
+ position: Position;
1954
+ /** Image source (base64 or URL) */
1955
+ src: string;
1956
+ /** Image width in pixels */
1957
+ width?: number;
1958
+ /** Image height in pixels */
1959
+ height?: number;
1960
+ /** Alt text */
1961
+ alt?: string;
1962
+ }
1963
+ /**
1964
+ * Insert a hyperlink at a range
1965
+ */
1966
+ interface InsertHyperlinkCommand extends BaseCommand {
1967
+ type: 'insertHyperlink';
1968
+ /** Range to make into a hyperlink */
1969
+ range: Range;
1970
+ /** URL of the hyperlink */
1971
+ url: string;
1972
+ /** Display text (replaces range text if provided) */
1973
+ displayText?: string;
1974
+ /** Tooltip */
1975
+ tooltip?: string;
1976
+ }
1977
+ /**
1978
+ * Remove a hyperlink but keep the text
1979
+ */
1980
+ interface RemoveHyperlinkCommand extends BaseCommand {
1981
+ type: 'removeHyperlink';
1982
+ /** Range containing the hyperlink */
1983
+ range: Range;
1984
+ }
1985
+ /**
1986
+ * Insert a paragraph break
1987
+ */
1988
+ interface InsertParagraphBreakCommand extends BaseCommand {
1989
+ type: 'insertParagraphBreak';
1990
+ /** Position to break at */
1991
+ position: Position;
1992
+ }
1993
+ /**
1994
+ * Merge paragraphs
1995
+ */
1996
+ interface MergeParagraphsCommand extends BaseCommand {
1997
+ type: 'mergeParagraphs';
1998
+ /** First paragraph index */
1999
+ paragraphIndex: number;
2000
+ /** Number of paragraphs to merge with */
2001
+ count: number;
2002
+ }
2003
+ /**
2004
+ * Split a paragraph
2005
+ */
2006
+ interface SplitParagraphCommand extends BaseCommand {
2007
+ type: 'splitParagraph';
2008
+ /** Position to split at */
2009
+ position: Position;
2010
+ }
2011
+ /**
2012
+ * Set template variable value
2013
+ */
2014
+ interface SetVariableCommand extends BaseCommand {
2015
+ type: 'setVariable';
2016
+ /** Variable name */
2017
+ name: string;
2018
+ /** Variable value */
2019
+ value: string;
2020
+ }
2021
+ /**
2022
+ * Apply all template variables
2023
+ */
2024
+ interface ApplyVariablesCommand extends BaseCommand {
2025
+ type: 'applyVariables';
2026
+ /** Variable values */
2027
+ values: Record<string, string>;
2028
+ }
2029
+ /**
2030
+ * Union of all command types
2031
+ */
2032
+ type AgentCommand = InsertTextCommand | ReplaceTextCommand | DeleteTextCommand | FormatTextCommand | FormatParagraphCommand | ApplyStyleCommand | InsertTableCommand | InsertImageCommand | InsertHyperlinkCommand | RemoveHyperlinkCommand | InsertParagraphBreakCommand | MergeParagraphsCommand | SplitParagraphCommand | SetVariableCommand | ApplyVariablesCommand;
2033
+ /**
2034
+ * Document context for AI agents
2035
+ */
2036
+ interface AgentContext {
2037
+ /** Total paragraph count */
2038
+ paragraphCount: number;
2039
+ /** Total word count (approximate) */
2040
+ wordCount: number;
2041
+ /** Total character count */
2042
+ characterCount: number;
2043
+ /** Detected template variables */
2044
+ variables: string[];
2045
+ /** Variable count */
2046
+ variableCount: number;
2047
+ /** Available styles */
2048
+ availableStyles: StyleInfo[];
2049
+ /** Content outline (first N chars per paragraph) */
2050
+ outline: ParagraphOutline[];
2051
+ /** Document sections info */
2052
+ sections: SectionInfo[];
2053
+ /** Has tables */
2054
+ hasTables: boolean;
2055
+ /** Has images */
2056
+ hasImages: boolean;
2057
+ /** Has hyperlinks */
2058
+ hasHyperlinks: boolean;
2059
+ /** Document language */
2060
+ language?: string;
2061
+ }
2062
+ /**
2063
+ * Style information for context
2064
+ */
2065
+ interface StyleInfo {
2066
+ /** Style ID */
2067
+ id: string;
2068
+ /** Display name */
2069
+ name: string;
2070
+ /** Style type */
2071
+ type: 'paragraph' | 'character' | 'table';
2072
+ /** Is built-in style */
2073
+ builtIn?: boolean;
2074
+ }
2075
+ /**
2076
+ * Paragraph outline for context
2077
+ */
2078
+ interface ParagraphOutline {
2079
+ /** Paragraph index */
2080
+ index: number;
2081
+ /** First N characters */
2082
+ preview: string;
2083
+ /** Paragraph style */
2084
+ style?: string;
2085
+ /** Is heading */
2086
+ isHeading?: boolean;
2087
+ /** Heading level (1-9) */
2088
+ headingLevel?: number;
2089
+ /** Is list item */
2090
+ isListItem?: boolean;
2091
+ /** Is empty paragraph */
2092
+ isEmpty?: boolean;
2093
+ }
2094
+ /**
2095
+ * Section information
2096
+ */
2097
+ interface SectionInfo {
2098
+ /** Section index */
2099
+ index: number;
2100
+ /** Number of paragraphs */
2101
+ paragraphCount: number;
2102
+ /** Page size */
2103
+ pageSize?: {
2104
+ width: number;
2105
+ height: number;
2106
+ };
2107
+ /** Is landscape */
2108
+ isLandscape?: boolean;
2109
+ /** Has header */
2110
+ hasHeader?: boolean;
2111
+ /** Has footer */
2112
+ hasFooter?: boolean;
2113
+ }
2114
+ /**
2115
+ * Context about the current selection
2116
+ */
2117
+ interface SelectionContext {
2118
+ /** Selected text */
2119
+ selectedText: string;
2120
+ /** Selection range */
2121
+ range: Range;
2122
+ /** Current formatting of selection */
2123
+ formatting: Partial<TextFormatting>;
2124
+ /** Current paragraph formatting */
2125
+ paragraphFormatting: Partial<ParagraphFormatting>;
2126
+ /** Text before selection (context) */
2127
+ textBefore: string;
2128
+ /** Text after selection (context) */
2129
+ textAfter: string;
2130
+ /** Paragraph containing selection */
2131
+ paragraph: ParagraphContext;
2132
+ /** Is selection within a table */
2133
+ inTable?: boolean;
2134
+ /** Is selection within a hyperlink */
2135
+ inHyperlink?: boolean;
2136
+ /** Suggested actions based on selection */
2137
+ suggestedActions?: SuggestedAction[];
2138
+ }
2139
+ /**
2140
+ * Paragraph context for selection
2141
+ */
2142
+ interface ParagraphContext {
2143
+ /** Paragraph index */
2144
+ index: number;
2145
+ /** Full paragraph text */
2146
+ fullText: string;
2147
+ /** Paragraph style */
2148
+ style?: string;
2149
+ /** Word count */
2150
+ wordCount: number;
2151
+ }
2152
+ /**
2153
+ * Suggested action for context menu
2154
+ */
2155
+ interface SuggestedAction {
2156
+ /** Action ID */
2157
+ id: string;
2158
+ /** Display label */
2159
+ label: string;
2160
+ /** Description */
2161
+ description?: string;
2162
+ /** Icon name */
2163
+ icon?: string;
2164
+ /** Priority (higher = more prominent) */
2165
+ priority?: number;
2166
+ }
2167
+ /**
2168
+ * Response from an agent action
2169
+ */
2170
+ interface AgentResponse {
2171
+ /** Success status */
2172
+ success: boolean;
2173
+ /** New text to insert (for rewrite/expand/etc.) */
2174
+ newText?: string;
2175
+ /** New formatted content */
2176
+ newContent?: AgentContent[];
2177
+ /** Commands to execute */
2178
+ commands?: AgentCommand[];
2179
+ /** Error message if failed */
2180
+ error?: string;
2181
+ /** Warning messages */
2182
+ warnings?: string[];
2183
+ /** Metadata about the response */
2184
+ metadata?: Record<string, unknown>;
2185
+ }
2186
+ /**
2187
+ * Content block in agent response
2188
+ */
2189
+ interface AgentContent {
2190
+ /** Content type */
2191
+ type: 'text' | 'paragraph' | 'table' | 'image';
2192
+ /** Text content */
2193
+ text?: string;
2194
+ /** Formatting */
2195
+ formatting?: Partial<TextFormatting>;
2196
+ /** Paragraph formatting */
2197
+ paragraphFormatting?: Partial<ParagraphFormatting>;
2198
+ /** Table data (for table type) */
2199
+ tableData?: string[][];
2200
+ /** Image src (for image type) */
2201
+ imageSrc?: string;
2202
+ }
2203
+ /**
2204
+ * AI action types for context menu
2205
+ */
2206
+ type AIAction = 'askAI' | 'rewrite' | 'expand' | 'summarize' | 'translate' | 'explain' | 'fixGrammar' | 'makeFormal' | 'makeCasual' | 'custom';
2207
+ /**
2208
+ * AI action request
2209
+ */
2210
+ interface AIActionRequest {
2211
+ /** Action type */
2212
+ action: AIAction;
2213
+ /** Selection context */
2214
+ context: SelectionContext;
2215
+ /** Custom prompt (for 'custom' action) */
2216
+ customPrompt?: string;
2217
+ /** Target language (for 'translate' action) */
2218
+ targetLanguage?: string;
2219
+ /** Additional options */
2220
+ options?: Record<string, unknown>;
2221
+ }
2222
+ /**
2223
+ * Get action label
2224
+ */
2225
+ declare function getActionLabel(action: AIAction): string;
2226
+ /**
2227
+ * Get action description
2228
+ */
2229
+ declare function getActionDescription(action: AIAction): string;
2230
+ /**
2231
+ * Default AI actions for context menu
2232
+ */
2233
+ declare const DEFAULT_AI_ACTIONS: AIAction[];
2234
+ /**
2235
+ * Create a command with generated ID
2236
+ */
2237
+ declare function createCommand<T extends AgentCommand>(command: Omit<T, 'id'>): T;
2238
+
2239
+ export { type SuggestedAction as $, type AgentCommand as A, type BreakContent as B, type Comment as C, type Document as D, type Endnote as E, type Footnote as F, type ParagraphContent as G, type Hyperlink as H, type Image as I, type ParagraphContext as J, type ParagraphFormatting as K, type ListLevel as L, type MoveFrom as M, type NumberingDefinitions as N, type ParagraphOutline as O, type Position as P, type Relationship as Q, type Range as R, type ReplaceTextCommand as S, type TextFormatting as T, type SectionInfo as U, type SectionProperties as V, type SelectionContext as W, type SetVariableCommand as X, type Style as Y, type StyleDefinitions as Z, type StyleInfo as _, type Paragraph as a, type TableCell as a0, type TableRow as a1, type TextContent as a2, type Theme as a3, type TrackedChangeInfo as a4, type TrackedRunChange as a5, comparePositions as a6, createCollapsedRange as a7, createCommand as a8, createRange as a9, getActionDescription as aa, getActionLabel as ab, isPositionInRange as ac, type BookmarkEnd as ad, type BookmarkStart as ae, type Field as af, type FooterReference as ag, type HeaderFooter as ah, type HeaderReference as ai, type Shape as aj, type TextBox as ak, type ThemeColorScheme as al, type ThemeFont as am, type ThemeFontScheme as an, type ColorValue as ao, type ThemeColorSlot as ap, type ParagraphAlignment as aq, type StyleType as ar, type TabStop as as, type Run as b, type RunContent as c, type DocumentBody as d, type Table as e, type AIAction as f, type AIActionRequest as g, type AgentContext as h, type AgentResponse as i, type ApplyStyleCommand as j, type ApplyVariablesCommand as k, type BlockContent as l, type CommentRangeEnd as m, type CommentRangeStart as n, DEFAULT_AI_ACTIONS as o, type DeleteTextCommand as p, type Deletion as q, type DocxPackage as r, type FormatParagraphCommand as s, type FormatTextCommand as t, type InsertHyperlinkCommand as u, type InsertImageCommand as v, type InsertTableCommand as w, type InsertTextCommand as x, type Insertion as y, type MoveTo as z };