@stll/docx-core 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,184 @@
1
- //#region src/model/colors.d.ts
1
+ import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } from "./preservedMarkup-G8XjWhs2.js";
2
+ //#region src/model/borderStyle.gen.d.ts
3
+ /**
4
+ * GENERATED FILE — do not edit.
5
+ *
6
+ * The `ST_Border` enumeration, in schema order, derived from
7
+ * `specifications/generated/docx-transitional-schema.gen.json` by
8
+ * `scripts/generate-border-styles.ts`. Regenerate with:
9
+ *
10
+ * bun run generate:border-styles
11
+ *
12
+ * The first 27 members are line styles; the rest are the page-border art
13
+ * glyphs `w:pgBorders` may name. `nil` and `none` are distinct: `none`
14
+ * cancels a border inherited from the container, `nil` states no border. Read
15
+ * either through `isBorderNone`/`isBorderNil` in `./borderStyle`, never by
16
+ * comparing the string.
17
+ */
18
+ /** Every `ST_Border` member, in schema order. */
19
+ declare const BORDER_STYLES: readonly ["nil", "none", "single", "thick", "double", "dotted", "dashed", "dotDash", "dotDotDash", "triple", "thinThickSmallGap", "thickThinSmallGap", "thinThickThinSmallGap", "thinThickMediumGap", "thickThinMediumGap", "thinThickThinMediumGap", "thinThickLargeGap", "thickThinLargeGap", "thinThickThinLargeGap", "wave", "doubleWave", "dashSmallGap", "dashDotStroked", "threeDEmboss", "threeDEngrave", "outset", "inset", "apples", "archedScallops", "babyPacifier", "babyRattle", "balloons3Colors", "balloonsHotAir", "basicBlackDashes", "basicBlackDots", "basicBlackSquares", "basicThinLines", "basicWhiteDashes", "basicWhiteDots", "basicWhiteSquares", "basicWideInline", "basicWideMidline", "basicWideOutline", "bats", "birds", "birdsFlight", "cabins", "cakeSlice", "candyCorn", "celticKnotwork", "certificateBanner", "chainLink", "champagneBottle", "checkedBarBlack", "checkedBarColor", "checkered", "christmasTree", "circlesLines", "circlesRectangles", "classicalWave", "clocks", "compass", "confetti", "confettiGrays", "confettiOutline", "confettiStreamers", "confettiWhite", "cornerTriangles", "couponCutoutDashes", "couponCutoutDots", "crazyMaze", "creaturesButterfly", "creaturesFish", "creaturesInsects", "creaturesLadyBug", "crossStitch", "cup", "decoArch", "decoArchColor", "decoBlocks", "diamondsGray", "doubleD", "doubleDiamonds", "earth1", "earth2", "earth3", "eclipsingSquares1", "eclipsingSquares2", "eggsBlack", "fans", "film", "firecrackers", "flowersBlockPrint", "flowersDaisies", "flowersModern1", "flowersModern2", "flowersPansy", "flowersRedRose", "flowersRoses", "flowersTeacup", "flowersTiny", "gems", "gingerbreadMan", "gradient", "handmade1", "handmade2", "heartBalloon", "heartGray", "hearts", "heebieJeebies", "holly", "houseFunky", "hypnotic", "iceCreamCones", "lightBulb", "lightning1", "lightning2", "mapPins", "mapleLeaf", "mapleMuffins", "marquee", "marqueeToothed", "moons", "mosaic", "musicNotes", "northwest", "ovals", "packages", "palmsBlack", "palmsColor", "paperClips", "papyrus", "partyFavor", "partyGlass", "pencils", "people", "peopleWaving", "peopleHats", "poinsettias", "postageStamp", "pumpkin1", "pushPinNote2", "pushPinNote1", "pyramids", "pyramidsAbove", "quadrants", "rings", "safari", "sawtooth", "sawtoothGray", "scaredCat", "seattle", "shadowedSquares", "sharksTeeth", "shorebirdTracks", "skyrocket", "snowflakeFancy", "snowflakes", "sombrero", "southwest", "stars", "starsTop", "stars3d", "starsBlack", "starsShadowed", "sun", "swirligig", "tornPaper", "tornPaperBlack", "trees", "triangleParty", "triangles", "triangle1", "triangle2", "triangleCircle1", "triangleCircle2", "shapes1", "shapes2", "twistedLines1", "twistedLines2", "vine", "waveline", "weavingAngles", "weavingBraid", "weavingRibbon", "weavingStrips", "whiteFlowers", "woodwork", "xIllusions", "zanyTriangles", "zigZag", "zigZagStitch", "custom"];
20
+ /** `w:val` on `CT_Border`: a border style the schema declares. */
21
+ type BorderStyle = (typeof BORDER_STYLES)[number];
22
+ //#endregion
23
+ //#region src/model/borderStyle.d.ts
24
+ /**
25
+ * A `w:val` the schema does not declare, kept exactly as the file spelled it.
26
+ *
27
+ * Refusing the border instead would drop an authored edge that Word renders,
28
+ * and collapsing it to a default would rewrite the document on open. The
29
+ * parser reports it through `ParseContext` so the normalisation is visible,
30
+ * and the serializer writes `raw` back unchanged.
31
+ */
32
+ type UnrecognisedBorderStyle = {
33
+ readonly kind: "unrecognised";
34
+ readonly raw: string;
35
+ };
36
+ /** What `BorderSpec.style` holds: an `ST_Border` member, or the raw token. */
37
+ type BorderStyleValue = BorderStyle | UnrecognisedBorderStyle;
38
+ /** Whether the schema declares this token. */
39
+ declare const isBorderStyle: (value: string) => value is BorderStyle;
40
+ /** Read a `w:val` into the model, keeping an undeclared token verbatim. */
41
+ declare const borderStyleFrom: (value: string) => BorderStyleValue;
42
+ /** The token to write back, whether or not the schema declares it. */
43
+ declare const borderStyleToken: (style: BorderStyleValue) => string;
44
+ /** `none`: the author cancelled a border inherited from the container. */
45
+ declare const isBorderNone: (style: BorderStyleValue | undefined) => boolean;
46
+ /** `nil`: the author stated no border. */
47
+ declare const isBorderNil: (style: BorderStyleValue | undefined) => boolean;
48
+ /**
49
+ * Whether the edge paints nothing, by either reserved member.
50
+ *
51
+ * This is what a renderer, a measurer and a collapse rule want: the two
52
+ * members differ in what they do to an inherited border, not in what they
53
+ * draw. Which one was written still matters on the way back out, which is why
54
+ * the value keeps it.
55
+ */
56
+ declare const statesNoBorder: (style: BorderStyleValue | undefined) => boolean;
57
+ //#endregion
58
+ //#region src/model/themeColor.gen.d.ts
59
+ /**
60
+ * GENERATED FILE — do not edit.
61
+ *
62
+ * The colour enumerations a theme reference passes through.
63
+ *
64
+ * Derived from `specifications/generated/docx-transitional-schema.gen.json`.
65
+ * Regenerate with:
66
+ *
67
+ * bun run generate:theme-colors
68
+ */
2
69
  /**
3
- * Color & Styling Primitives
70
+ * `ST_ThemeColor`: every token a WordprocessingML `w:themeColor`,
71
+ * `w:themeFill` or `w:clrSchemeMapping` value may carry.
72
+ *
73
+ * Spelled in full words (`dark1`, `hyperlink`), unlike the DrawingML slot
74
+ * names below. `none` is a reserved member that cancels an inherited theme
75
+ * colour rather than naming one.
76
+ */
77
+ declare const THEME_COLORS: readonly ["dark1", "light1", "dark2", "light2", "accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "hyperlink", "followedHyperlink", "none", "background1", "text1", "background2", "text2"];
78
+ type ThemeColor = "dark1" | "light1" | "dark2" | "light2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hyperlink" | "followedHyperlink" | "none" | "background1" | "text1" | "background2" | "text2";
79
+ type SchemeColorSlot = "dk1" | "lt1" | "dk2" | "lt2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hlink" | "folHlink";
80
+ type SchemeColorValue = "bg1" | "tx1" | "bg2" | "tx2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hlink" | "folHlink" | "phClr" | "dk1" | "lt1" | "dk2" | "lt2";
81
+ //#endregion
82
+ //#region src/model/themeColor.d.ts
83
+ /**
84
+ * The `a:schemeClr/@val` spelling of each theme colour.
85
+ *
86
+ * DrawingML keeps the mapped colours as their own tokens (`bg1`, `tx1`) rather
87
+ * than resolving them, so the two vocabularies differ only in spelling. `none`
88
+ * has no DrawingML equivalent: a scheme reference that paints nothing is
89
+ * written by omitting the fill, not by naming a colour.
90
+ */
91
+ declare const SCHEME_COLOR_VALUE_BY_THEME_COLOR: {
92
+ readonly dark1: "dk1";
93
+ readonly light1: "lt1";
94
+ readonly dark2: "dk2";
95
+ readonly light2: "lt2";
96
+ readonly accent1: "accent1";
97
+ readonly accent2: "accent2";
98
+ readonly accent3: "accent3";
99
+ readonly accent4: "accent4";
100
+ readonly accent5: "accent5";
101
+ readonly accent6: "accent6";
102
+ readonly hyperlink: "hlink";
103
+ readonly followedHyperlink: "folHlink";
104
+ readonly none: null;
105
+ readonly background1: "bg1";
106
+ readonly text1: "tx1";
107
+ readonly background2: "bg2";
108
+ readonly text2: "tx2";
109
+ };
110
+ /**
111
+ * The inverse: how an `a:schemeClr/@val` reads as a WordprocessingML theme
112
+ * colour. `phClr` is the placeholder a style definition resolves against its
113
+ * instantiating context, which no `w:themeColor` can name.
114
+ */
115
+ declare const THEME_COLOR_BY_SCHEME_COLOR_VALUE: {
116
+ readonly bg1: "background1";
117
+ readonly tx1: "text1";
118
+ readonly bg2: "background2";
119
+ readonly tx2: "text2";
120
+ readonly accent1: "accent1";
121
+ readonly accent2: "accent2";
122
+ readonly accent3: "accent3";
123
+ readonly accent4: "accent4";
124
+ readonly accent5: "accent5";
125
+ readonly accent6: "accent6";
126
+ readonly hlink: "hyperlink";
127
+ readonly folHlink: "followedHyperlink";
128
+ readonly phClr: null;
129
+ readonly dk1: "dark1";
130
+ readonly lt1: "light1";
131
+ readonly dk2: "dark2";
132
+ readonly lt2: "light2";
133
+ };
134
+ /**
135
+ * A `w:themeColor` token outside `ST_ThemeColor`, kept as written.
4
136
  *
5
- * Basic types used throughout OOXML for colors, borders, and shading.
137
+ * Narrowing used to drop such a token, which also dropped the attribute the
138
+ * next time the element was written. Capturing it keeps the save leg lossless
139
+ * while leaving the painter free to ignore a colour it cannot resolve — the
140
+ * treatment `w:val` on `CT_Border` already gets for a style outside
141
+ * `ST_Border`.
142
+ */
143
+ type UnrecognisedThemeColor = {
144
+ readonly kind: "unrecognised";
145
+ readonly raw: string;
146
+ };
147
+ /** What a theme-colour attribute parses to: a schema token, or the raw text. */
148
+ type ThemeColorValue = ThemeColor | UnrecognisedThemeColor;
149
+ declare const isThemeColor: (value: string) => value is ThemeColor;
150
+ declare const isSchemeColorValue: (value: string) => value is SchemeColorValue;
151
+ /**
152
+ * Read an attribute as a theme colour, or `undefined` when it is absent.
153
+ *
154
+ * An unrecognised token is captured rather than refused; the caller decides
155
+ * whether to report it.
6
156
  */
157
+ declare const readThemeColor: (raw: string | null | undefined) => ThemeColorValue | undefined;
158
+ /** The token to write back, whether or not the schema enumerates it. */
159
+ declare const themeColorToken: (value: ThemeColorValue) => string;
160
+ /** The schema token, or `undefined` for one the model only carries verbatim. */
161
+ declare const knownThemeColor: (value: ThemeColorValue) => ThemeColor | undefined;
7
162
  /**
8
- * Theme color slots from theme1.xml
163
+ * The theme slot a reference paints with, or `undefined` when it names none.
164
+ *
165
+ * `undefined` covers both `none`, which cancels an inherited theme colour, and
166
+ * a token the schema does not enumerate.
9
167
  */
10
- type ThemeColorSlot = "dk1" | "lt1" | "dk2" | "lt2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hlink" | "folHlink" | "background1" | "text1" | "background2" | "text2";
168
+ declare const themeColorSlot: (value: ThemeColorValue) => SchemeColorSlot | undefined;
169
+ //#endregion
170
+ //#region src/model/colors.d.ts
11
171
  /**
12
172
  * Color value - can be direct RGB, theme reference, or auto
13
173
  */
14
174
  type ColorValue = {
15
175
  /** RGB hex value without # (e.g., "FF0000") */
16
176
  rgb?: string;
17
- /** Theme color slot reference */
18
- themeColor?: ThemeColorSlot;
177
+ /**
178
+ * `w:themeColor`/`w:themeFill` as written: an `ST_ThemeColor` token, or a
179
+ * token outside it captured verbatim. `themeColorSlot` resolves either.
180
+ */
181
+ themeColor?: ThemeColorValue;
19
182
  /** Tint modifier (0-255 as hex string, e.g., "80") - makes color lighter */
20
183
  themeTint?: string;
21
184
  /** Shade modifier (0-255 as hex string) - makes color darker */
@@ -23,13 +186,16 @@ type ColorValue = {
23
186
  /** Auto color - context-dependent (usually black for text) */
24
187
  auto?: boolean;
25
188
  };
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";
27
189
  /**
28
190
  * Border specification for any border (paragraph, table, page)
29
191
  */
30
192
  type BorderSpec = {
31
- /** Border style. Unknown OOXML styles are preserved for fallback rendering. */
32
- style: string;
193
+ /**
194
+ * `w:val`: an `ST_Border` member, or the raw token when the file wrote one
195
+ * the schema does not declare. Ask `statesNoBorder`/`isBorderNone`/
196
+ * `isBorderNil` rather than comparing it; `nil` and `none` are not synonyms.
197
+ */
198
+ style: BorderStyleValue;
33
199
  /** Color of the border */
34
200
  color?: ColorValue;
35
201
  /** Width in eighths of a point (1/8 pt) */
@@ -53,6 +219,15 @@ type BorderSpec = {
53
219
  bottomLeftArtRelationshipId?: string;
54
220
  /** Custom page-border art relationship id for the bottom-right corner. */
55
221
  bottomRightArtRelationshipId?: string;
222
+ /**
223
+ * `CT_Border` attributes this record has no field for.
224
+ *
225
+ * The remainder rides the record that holds the element's modelled fields,
226
+ * the rule `attributeRemainder.ts` states for `w:p` and `w:tr`, applied one
227
+ * level down: a border is an attribute bag, so an attribute folio does not
228
+ * read is lost the moment any other attribute makes the element modelled.
229
+ */
230
+ preservedAttributes?: PreservedAttribute[];
56
231
  };
57
232
  /**
58
233
  * Shading/background properties
@@ -64,8 +239,282 @@ type ShadingProperties = {
64
239
  fill?: ColorValue;
65
240
  /** Shading pattern type */
66
241
  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";
242
+ /** `CT_Shd` attributes this record has no field for; see {@link BorderSpec}. */
243
+ preservedAttributes?: PreservedAttribute[];
67
244
  };
68
245
  //#endregion
246
+ //#region src/model/ooxmlEnumerations.gen.d.ts
247
+ /**
248
+ * GENERATED FILE — do not edit.
249
+ *
250
+ * The model enumerations that mirror an OOXML simple type, member for
251
+ * member, so a token the format declares cannot go unspelled.
252
+ *
253
+ * Derived from `specifications/generated/docx-transitional-schema.gen.json`.
254
+ * Regenerate with:
255
+ *
256
+ * bun run generate:ooxml-enumerations
257
+ */
258
+ /**
259
+ * `ST_Jc`: every token a `w:jc/@w:val` may carry.
260
+ *
261
+ * `start` and `end` are the direction-aware alignments, distinct from
262
+ * `left` and `right`: in a right-to-left paragraph `start` sits at the
263
+ * right margin. They are members in their own right, not spellings of
264
+ * `left` and `right`, and the layout resolves them against the
265
+ * paragraph's direction. `numTab` aligns to the list number's tab stop.
266
+ */
267
+ declare const PARAGRAPH_ALIGNMENTS: readonly ["start", "center", "end", "both", "mediumKashida", "distribute", "numTab", "highKashida", "lowKashida", "thaiDistribute", "left", "right"];
268
+ type ParagraphAlignment = "start" | "center" | "end" | "both" | "mediumKashida" | "distribute" | "numTab" | "highKashida" | "lowKashida" | "thaiDistribute" | "left" | "right";
269
+ /**
270
+ * `ST_TabJc`: every token a `w:tab/@w:val` may carry.
271
+ *
272
+ * `start` and `end` are the direction-aware members, the same distinction
273
+ * `ST_Jc` draws; `clear` removes an inherited stop rather than declaring
274
+ * one, and `num` is the stop a numbered paragraph's text hangs from.
275
+ */
276
+ declare const TAB_STOP_ALIGNMENTS: readonly ["clear", "start", "center", "end", "decimal", "bar", "num", "left", "right"];
277
+ type TabStopAlignment = "clear" | "start" | "center" | "end" | "decimal" | "bar" | "num" | "left" | "right";
278
+ /**
279
+ * `ST_JcTable`: every token a table's or a row's `w:jc/@w:val` may carry.
280
+ *
281
+ * A narrower vocabulary than `ST_Jc`: a table is placed, not justified, so
282
+ * there is no `both`. `start` and `end` are the direction-aware members,
283
+ * the same distinction `ST_Jc` draws, resolved against the table's own
284
+ * `w:bidiVisual` rather than a paragraph's direction.
285
+ */
286
+ declare const TABLE_ALIGNMENTS: readonly ["center", "end", "left", "right", "start"];
287
+ type TableAlignment = "center" | "end" | "left" | "right" | "start";
288
+ /**
289
+ * `ST_TextDirection`: every token a `w:textDirection/@w:val` may carry, on
290
+ * a table cell, a section or a paragraph.
291
+ *
292
+ * Twelve tokens for six flows: each flow has a short spelling and a long one
293
+ * naming the character and line progressions in full.
294
+ * {@link TEXT_DIRECTION_FLOWS} is the six, and
295
+ * {@link TEXT_DIRECTION_FLOW_BY_TOKEN} pairs each token with its flow.
296
+ */
297
+ declare const TEXT_DIRECTIONS: readonly ["tb", "rl", "lr", "tbV", "rlV", "lrV", "btLr", "lrTb", "lrTbV", "tbLrV", "tbRl", "tbRlV"];
298
+ type TextDirection = "tb" | "rl" | "lr" | "tbV" | "rlV" | "lrV" | "btLr" | "lrTb" | "lrTbV" | "tbLrV" | "tbRl" | "tbRlV";
299
+ /**
300
+ * The six text flows `ST_TextDirection` names, spelled the Strict way.
301
+ *
302
+ * Strict's `ST_TextDirection` (ECMA-376 Part 1 §17.18.93) enumerates exactly
303
+ * these six; Transitional adds a second spelling of each (Part 4 §14.11.7).
304
+ * Rendering is decided per flow, so a cell written `tbRl` and its Strict twin
305
+ * written `rl` paint the same.
306
+ */
307
+ declare const TEXT_DIRECTION_FLOWS: readonly ["tb", "rl", "lr", "tbV", "rlV", "lrV"];
308
+ type TextDirectionFlow = "tb" | "rl" | "lr" | "tbV" | "rlV" | "lrV";
309
+ /**
310
+ * The flow each `ST_TextDirection` token names.
311
+ *
312
+ * ECMA-376 Part 4 §14.11.7 gives each Transitional-only token as semantically
313
+ * equivalent to a Strict one: `btLr` to `lr`, `lrTb` to `tb`, `lrTbV`
314
+ * to `tbV`, `tbLrV` to `lrV`, `tbRl` to `rl` and `tbRlV` to `rlV`.
315
+ * A reader keeps the token as authored and a writer writes it back; only
316
+ * rendering goes through the flow.
317
+ */
318
+ declare const TEXT_DIRECTION_FLOW_BY_TOKEN: {
319
+ readonly tb: "tb";
320
+ readonly rl: "rl";
321
+ readonly lr: "lr";
322
+ readonly tbV: "tbV";
323
+ readonly rlV: "rlV";
324
+ readonly lrV: "lrV";
325
+ readonly btLr: "lr";
326
+ readonly lrTb: "tb";
327
+ readonly lrTbV: "tbV";
328
+ readonly tbLrV: "lrV";
329
+ readonly tbRl: "rl";
330
+ readonly tbRlV: "rlV";
331
+ };
332
+ /**
333
+ * `ST_NumberFormat`: every token a `w:numFmt/@w:val` may carry, on a
334
+ * numbering level, a note's properties or a section's page numbers.
335
+ *
336
+ * `custom` counts by the token list in the sibling `@w:format` rather
337
+ * than by a vocabulary of its own; `none` prints no counter at all.
338
+ */
339
+ declare const NUMBER_FORMATS: readonly ["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", "bahtText", "dollarText", "custom"];
340
+ 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" | "bahtText" | "dollarText" | "custom";
341
+ //#endregion
342
+ //#region src/model/outlineLevel.d.ts
343
+ /**
344
+ * `w:outlineLvl`: nine heading levels and one reserved "not a heading".
345
+ *
346
+ * ECMA-376 17.3.1.20 gives `w:val` the range 0..9 "where 9 specifically
347
+ * indicates that there is no outline level specifically applied to this
348
+ * paragraph". Nine is therefore a sentinel, not a tenth level, and a model
349
+ * that stores the raw number lets every consumer decide that for itself: the
350
+ * PDF outline nested a `TOC Heading` nine deep, the TOC listed it, and the
351
+ * lint could not see the mistake because the comparison was against
352
+ * `undefined` rather than against the literal.
353
+ *
354
+ * The union removes the decision. `9` has no representation as a heading, an
355
+ * out-of-range value has none at all, and absence stays absence — a paragraph
356
+ * that states no level inherits one, which is a third state neither arm may
357
+ * stand in for.
358
+ */
359
+ /** The `w:outlineLvl w:val` values that name a heading, zero-based. */
360
+ declare const HEADING_OUTLINE_LEVELS: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8];
361
+ /** A zero-based heading level: `heading 1` is 0, `heading 9` is 8. */
362
+ type HeadingOutlineLevel = (typeof HEADING_OUTLINE_LEVELS)[number];
363
+ /** What a stated `w:outlineLvl` says. Absence is the field being absent. */
364
+ type OutlineLevel = {
365
+ readonly kind: "bodyText";
366
+ } | {
367
+ readonly kind: "heading";
368
+ readonly level: HeadingOutlineLevel;
369
+ };
370
+ /** The reserved `w:outlineLvl w:val="9"`: outlined as body text, not as a heading. */
371
+ declare const BODY_TEXT_OUTLINE_LEVEL: OutlineLevel;
372
+ /**
373
+ * The one reader over a stated `w:outlineLvl w:val`.
374
+ *
375
+ * `undefined` is a value outside 0..9, which the format does not define. The
376
+ * Rust kernel rejects those outright (`MAXIMUM_OUTLINE_LEVEL`); the TypeScript
377
+ * parse boundary drops them and warns instead, because a corpus document that
378
+ * Word opens must still open here.
379
+ */
380
+ declare const outlineLevelFromStatedValue: (value: number) => OutlineLevel | undefined;
381
+ /** The heading arm for a zero-based level, or undefined outside 0..8. */
382
+ declare const headingOutlineLevel: (level: number) => OutlineLevel | undefined;
383
+ /** The `w:val` to write for a stated outline level. */
384
+ declare const outlineLevelStatedValue: (outlineLevel: OutlineLevel) => number;
385
+ /**
386
+ * The zero-based heading level a stated outline level names, or undefined when
387
+ * it names none. Body text and an absent level answer the same thing, which is
388
+ * what every heading consumer wants; the two are distinguished only where the
389
+ * cascade still has a tier left to ask.
390
+ */
391
+ declare const headingLevelOf: (outlineLevel: OutlineLevel | null | undefined) => HeadingOutlineLevel | undefined;
392
+ //#endregion
393
+ //#region src/model/paragraphNumbering.d.ts
394
+ /**
395
+ * `w:numPr`: what a tier states about a paragraph's numbering, and what the
396
+ * cascade resolves that to.
397
+ *
398
+ * Two facts shape the types, and the old `{ numId?: number; ilvl?: number }`
399
+ * pair expressed neither.
400
+ *
401
+ * **`w:numId` and `w:ilvl` inherit independently** (ECMA-376 17.3.1.19). A tier
402
+ * that states only the level keeps the id it inherits, which is what Word
403
+ * writes whenever a styled list paragraph is demoted, so a direct `w:numPr` is
404
+ * a partial override rather than a whole replacement. That is the `levelOnly`
405
+ * arm, and it is why the override type has three arms and not two.
406
+ *
407
+ * **`w:numId w:val="0"` is reserved** (17.9.18): it names no `w:num`, it
408
+ * switches numbering off, and on a style it cancels the numbering the style
409
+ * would otherwise inherit through `w:basedOn`. It is the `none` arm, and a
410
+ * `reference` therefore cannot carry it — which is the whole point, because
411
+ * the sentinel used to read as "this paragraph is in list 0" in the layout and
412
+ * marker tiers while the sanctioned reader said it was in no list at all.
413
+ */
414
+ /** The reserved `w:numId` value that means "no numbering". */
415
+ declare const NO_NUMBERING_NUM_ID = 0;
416
+ /**
417
+ * Whether a `w:numId` names a numbering definition to resolve.
418
+ *
419
+ * Still the reader for the raw ids the numbering part itself carries
420
+ * (`w:num@numId`, a style's own reference before it is read into the union).
421
+ * A paragraph's numbering no longer goes through it: after
422
+ * {@link paragraphNumberingFromSlots} the sentinel has no representation.
423
+ */
424
+ declare const isNumberingReference: (numId: number | undefined) => numId is number;
425
+ declare const PARAGRAPH_NUMBERING_REFERENCE: unique symbol;
426
+ /** A non-reserved numbering reference minted by {@link paragraphNumberingReference}. */
427
+ type ParagraphNumberingReference = {
428
+ readonly kind: "reference";
429
+ readonly numId: number;
430
+ readonly ilvl?: number;
431
+ readonly [PARAGRAPH_NUMBERING_REFERENCE]: true;
432
+ };
433
+ /**
434
+ * What one tier's `<w:numPr>` states. The field being absent is the fourth
435
+ * state and means the tier states nothing at all.
436
+ */
437
+ type ParagraphNumberingOverride = {
438
+ readonly kind: "none";
439
+ } | ParagraphNumberingReference | {
440
+ readonly kind: "levelOnly";
441
+ readonly ilvl: number;
442
+ };
443
+ /** Numbering after the cascade: what actually renders. */
444
+ type ResolvedParagraphNumbering = {
445
+ readonly kind: "none";
446
+ } | (ParagraphNumberingReference & {
447
+ readonly ilvl: number;
448
+ });
449
+ /** The arm a `w:numId w:val="0"` reads as, and the arm a cascade cancels to. */
450
+ declare const NO_PARAGRAPH_NUMBERING: {
451
+ readonly kind: "none";
452
+ };
453
+ /**
454
+ * The two slots a `<w:numPr>` carries, as read off the element.
455
+ *
456
+ * An absent `w:ilvl` and `w:ilvl="0"` mean the same level but are different
457
+ * bytes, so `ilvl` stays optional inside `reference`: collapsing it turns an
458
+ * untouched save into a document that states something its source did not.
459
+ */
460
+ type ParagraphNumberingSlots = {
461
+ numId?: number;
462
+ ilvl?: number;
463
+ };
464
+ type ParagraphNumberingReferenceOptions<NumId extends number, Level extends number | undefined> = {
465
+ numId: Exclude<NumId, typeof NO_NUMBERING_NUM_ID>;
466
+ ilvl?: Level | undefined;
467
+ };
468
+ type ParagraphNumberingReferenceResult<Level extends number | undefined> = ParagraphNumberingReference & (Level extends number ? {
469
+ readonly ilvl: Level;
470
+ } : unknown);
471
+ /** Mint a reference after excluding the reserved id from the model. */
472
+ declare const paragraphNumberingReference: <const NumId extends number, const Level extends number | undefined = undefined>({ numId, ilvl }: ParagraphNumberingReferenceOptions<NumId, Level>) => ParagraphNumberingReferenceResult<Level>;
473
+ /**
474
+ * The one mapping from a `<w:numPr>`'s two slots onto the union.
475
+ *
476
+ * `undefined` is an element that states neither slot, which states nothing.
477
+ * Every parse boundary goes through this, which is what stops the reserved id
478
+ * reaching the model at all.
479
+ */
480
+ declare const paragraphNumberingFromSlots: ({ numId, ilvl }: {
481
+ numId?: number | undefined;
482
+ ilvl?: number | undefined;
483
+ }) => ParagraphNumberingOverride | undefined;
484
+ /**
485
+ * The slots to write back for a stated override, so the emit has one owner
486
+ * too. `none` writes the reserved id, because deleting the element would
487
+ * uncover the tier below and hand the paragraph its numbering back.
488
+ */
489
+ declare const paragraphNumberingSlots: (numbering: ParagraphNumberingOverride) => ParagraphNumberingSlots;
490
+ /**
491
+ * Fold one tier over the tier beneath it, direct over style.
492
+ *
493
+ * This is ECMA-376 17.3.1.19's independent inheritance written once. Before
494
+ * the union it was four object spreads in three languages, each of them a
495
+ * comment saying what the spread happened to do.
496
+ */
497
+ declare const mergeParagraphNumbering: (inherited: ParagraphNumberingOverride | undefined, stated: ParagraphNumberingOverride | undefined) => ParagraphNumberingOverride | undefined;
498
+ /**
499
+ * Collapse a stated override to what renders.
500
+ *
501
+ * A `levelOnly` that nothing supplied an id for numbers nothing, the same as a
502
+ * cancellation does, which is why the resolved type has two arms.
503
+ */
504
+ declare const resolveParagraphNumbering: (numbering: ParagraphNumberingOverride | undefined) => ResolvedParagraphNumbering;
505
+ /** The level a stated override renders at, absent `w:ilvl` read as zero. */
506
+ declare const paragraphNumberingLevel: (numbering: ParagraphNumberingOverride | undefined) => number | undefined;
507
+ /** The numbering definition a stated override names, or undefined for none. */
508
+ declare const paragraphNumberingReferenceId: (numbering: ParagraphNumberingOverride | undefined) => number | undefined;
509
+ /**
510
+ * Whether two stated overrides say the same thing, byte for byte: an absent
511
+ * `w:ilvl` is not a stated `w:val="0"` here, which is what keeps an untouched
512
+ * save from stating something its source did not.
513
+ */
514
+ declare const sameStatedParagraphNumbering: (left: ParagraphNumberingOverride | undefined, right: ParagraphNumberingOverride | undefined) => boolean;
515
+ /** Whether two stated overrides render the same, an absent `w:ilvl` read as zero. */
516
+ declare const sameEffectiveParagraphNumbering: (left: ParagraphNumberingOverride | undefined, right: ParagraphNumberingOverride | undefined) => boolean;
517
+ //#endregion
69
518
  //#region src/model/formatting.d.ts
70
519
  /**
71
520
  * Underline style options
@@ -166,11 +615,23 @@ type TextFormatting = {
166
615
  cs?: boolean;
167
616
  /** Character style ID (w:rStyle) */
168
617
  styleId?: string;
618
+ /**
619
+ * The `w:rPr` children folio does not model, in the order the schema
620
+ * declares them.
621
+ *
622
+ * The sink records a capture's schema ordinal rather than a count of
623
+ * modelled siblings, because the writer puts every child at the place the
624
+ * declared list gives its name; see `containerChildren.ts`. One field serves
625
+ * all four owners of a run property set — a run, the paragraph mark, and the
626
+ * snapshot inside either one's `w:rPrChange` — because one reader fills it
627
+ * and one writer empties it.
628
+ *
629
+ * It belongs to the element that was parsed, and to no other. A style's
630
+ * captured bytes are not a run's direct formatting, so style resolution and
631
+ * `mergeTextFormatting` drop it rather than inheriting it.
632
+ */
633
+ preserved?: PreservedMarkup;
169
634
  };
170
- /**
171
- * Tab stop alignment
172
- */
173
- type TabStopAlignment = "left" | "center" | "right" | "decimal" | "bar" | "clear" | "num";
174
635
  /**
175
636
  * Tab leader character
176
637
  */
@@ -185,15 +646,13 @@ type TabStop = {
185
646
  alignment: TabStopAlignment;
186
647
  /** Leader character */
187
648
  leader?: TabLeader;
649
+ /** `CT_TabStop` attributes this record has no field for; see {@link BorderSpec}. */
650
+ preservedAttributes?: PreservedAttribute[];
188
651
  };
189
652
  /**
190
653
  * Line spacing rule
191
654
  */
192
655
  type LineSpacingRule = "auto" | "exact" | "atLeast";
193
- /**
194
- * Paragraph alignment/justification
195
- */
196
- type ParagraphAlignment = "left" | "center" | "right" | "both" | "distribute" | "mediumKashida" | "highKashida" | "lowKashida" | "thaiDistribute";
197
656
  /**
198
657
  * Complete paragraph formatting properties (w:pPr)
199
658
  */
@@ -226,6 +685,16 @@ type ParagraphFormatting = {
226
685
  afterAutospacing?: boolean;
227
686
  /** Which spacing sides came from this paragraph's own pPr. */
228
687
  spacingExplicit?: SpacingExplicit;
688
+ /**
689
+ * `w:spacing` attributes this model has no field for: `w:beforeLines` and
690
+ * `w:afterLines`, which count lines where the modelled pair counts twips.
691
+ *
692
+ * The remainder rides the record that holds the element's modelled fields.
693
+ * For `w:framePr` and `w:shd` that record is the element's own; `w:spacing`
694
+ * and `w:ind` were flattened into this one, so this is theirs, one
695
+ * remainder per flattened element rather than one for the set.
696
+ */
697
+ spacingPreservedAttributes?: PreservedAttribute[];
229
698
  /** Left indent in twips (w:ind/@w:left) */
230
699
  indentLeft?: number;
231
700
  /** Right indent in twips (w:ind/@w:right) */
@@ -234,6 +703,13 @@ type ParagraphFormatting = {
234
703
  indentFirstLine?: number;
235
704
  /** Whether first line is hanging indent */
236
705
  hangingIndent?: boolean;
706
+ /**
707
+ * `w:ind` attributes this model has no field for: the six character-unit
708
+ * spellings, from `w:leftChars` to `w:firstLineChars`, which count
709
+ * characters where the modelled attributes count twips. See
710
+ * {@link ParagraphFormatting.spacingPreservedAttributes}.
711
+ */
712
+ indentPreservedAttributes?: PreservedAttribute[];
237
713
  /** Paragraph borders (w:pBdr) */
238
714
  borders?: {
239
715
  top?: BorderSpec;
@@ -257,13 +733,13 @@ type ParagraphFormatting = {
257
733
  pageBreakBefore?: boolean;
258
734
  /** Contextual spacing — suppress space between paragraphs of the same style (w:contextualSpacing) */
259
735
  contextualSpacing?: boolean;
260
- /** Numbering properties (w:numPr) */
261
- numPr?: {
262
- /** Numbering definition ID (w:numId) */
263
- numId?: number;
264
- /** List level (0-8) (w:ilvl) */
265
- ilvl?: number;
266
- };
736
+ /**
737
+ * The stated `w:numPr` (17.3.1.19). Absent means the tier states nothing and
738
+ * inherits whatever the tier below it states; {@link ParagraphNumberingOverride}
739
+ * carries the rest, so neither the reserved `w:numId w:val="0"` nor a level
740
+ * stated without an id has a spelling any consumer has to recognise.
741
+ */
742
+ numPr?: ParagraphNumberingOverride;
267
743
  /**
268
744
  * When `numPr` was resolved from the paragraph STYLE's pPr rather than the
269
745
  * paragraph's own `<w:numPr>`, this records the style-sourced value. The
@@ -273,10 +749,7 @@ type ParagraphFormatting = {
273
749
  * do not) and break the document on save/reload. Cleared the moment the
274
750
  * user changes the numbering (values diverge).
275
751
  */
276
- numPrFromStyle?: {
277
- numId?: number;
278
- ilvl?: number;
279
- };
752
+ numPrFromStyle?: ParagraphNumberingOverride;
280
753
  /**
281
754
  * The `w:numberingChange` inside the paragraph's `w:numPr`, verbatim.
282
755
  *
@@ -287,8 +760,12 @@ type ParagraphFormatting = {
287
760
  * it travels as markup rather than as a parsed shape.
288
761
  */
289
762
  numberingChangeXml?: string;
290
- /** Outline level 0-9 (w:outlineLvl) */
291
- outlineLevel?: number;
763
+ /**
764
+ * The stated `w:outlineLvl` (17.3.1.20). Absent means the paragraph states
765
+ * none and inherits one; {@link OutlineLevel} carries the rest, so the
766
+ * reserved `w:val="9"` cannot be mistaken for a tenth heading level.
767
+ */
768
+ outlineLevel?: OutlineLevel;
292
769
  /** Paragraph style ID (w:pStyle) */
293
770
  styleId?: string;
294
771
  /** Text frame properties (w:framePr) */
@@ -306,6 +783,8 @@ type ParagraphFormatting = {
306
783
  xAlign?: "left" | "center" | "right" | "inside" | "outside";
307
784
  yAlign?: "top" | "center" | "bottom" | "inside" | "outside" | "inline";
308
785
  wrap?: "around" | "auto" | "none" | "notBeside" | "through" | "tight";
786
+ /** `CT_FramePr` attributes this record has no field for; see {@link BorderSpec}. */
787
+ preservedAttributes?: PreservedAttribute[];
309
788
  };
310
789
  /** Suppress line numbers (w:suppressLineNumbers) */
311
790
  suppressLineNumbers?: boolean;
@@ -318,6 +797,24 @@ type ParagraphFormatting = {
318
797
  * and the next paragraph should render inline on the same line.
319
798
  */
320
799
  runInWithNext?: boolean;
800
+ /**
801
+ * The `w:pPr` children folio does not model, in the order the schema
802
+ * declares them.
803
+ *
804
+ * The sink records a capture's schema ordinal rather than a count of
805
+ * modelled siblings, because the writer puts every child at the place the
806
+ * declared list gives its name; see `containerChildren.ts`. One field serves
807
+ * all four owners of a paragraph property set — a paragraph, a style, a
808
+ * numbering level, and the `CT_PPrBase` snapshot inside `w:pPrChange` —
809
+ * because one reader fills it and one writer empties it.
810
+ *
811
+ * It belongs to the element that was parsed, and to no other. A style's
812
+ * captured bytes are not a paragraph's direct formatting, so style
813
+ * resolution and `mergeParagraphFormatting` drop it rather than inheriting
814
+ * it: writing an inherited value back as direct formatting would outrank the
815
+ * tier it came from.
816
+ */
817
+ preserved?: PreservedMarkup;
321
818
  };
322
819
  /**
323
820
  * Table width type
@@ -405,14 +902,33 @@ type FloatingTableProperties = {
405
902
  leftFromText?: number;
406
903
  rightFromText?: number;
407
904
  };
905
+ /**
906
+ * The grid a reviewer replaced, as `w:tblGridChange` records it.
907
+ *
908
+ * `CT_TblGridChange` holds a `w:tblGrid` of its own, and that grid holds its
909
+ * own `w:gridCol` children: a container nested in one of its own kind. It is a
910
+ * snapshot rather than a description — nothing in the live column widths
911
+ * derives it — so it is modelled as what it is, a count of columns each with
912
+ * the width it stated.
913
+ *
914
+ * `w:w` is optional on a `w:gridCol`, and a column that stated no width is not
915
+ * a column of width zero: `undefined` is what says the snapshot recorded a
916
+ * column and no measure for it.
917
+ */
918
+ type TableGridChange = {
919
+ /** `@w:id`: a physical revision id, re-minted on every save. */
920
+ id: number;
921
+ /** One entry per `w:gridCol`, in source order. */
922
+ columnWidths: readonly (number | undefined)[];
923
+ };
408
924
  /**
409
925
  * Table formatting properties (w:tblPr)
410
926
  */
411
927
  type TableFormatting = {
412
928
  /** Table width */
413
929
  width?: TableMeasurement;
414
- /** Table justification */
415
- justification?: "left" | "center" | "right";
930
+ /** Table placement (`w:tblPr/w:jc`) */
931
+ justification?: TableAlignment;
416
932
  /** Cell spacing */
417
933
  cellSpacing?: TableMeasurement;
418
934
  /** Table indent from left margin */
@@ -435,26 +951,34 @@ type TableFormatting = {
435
951
  floating?: FloatingTableProperties;
436
952
  /** Right to left table */
437
953
  bidi?: boolean;
954
+ /** Accessibility caption (`w:tblCaption`), authored in Word's alt-text dialog. */
955
+ caption?: string;
956
+ /** Long description (`w:tblDescription`), the caption's companion. */
957
+ description?: string;
958
+ /** Rows per band of the table style's row banding (`w:tblStyleRowBandSize`). */
959
+ rowBandSize?: number;
960
+ /** Columns per band (`w:tblStyleColBandSize`). */
961
+ columnBandSize?: number;
962
+ /** The `w:tblPr` children no reader took a typed value from. */
963
+ preserved?: PreservedMarkup;
438
964
  /**
439
965
  * The table's `w:tblGrid`, verbatim.
440
966
  *
441
967
  * The grid is a sibling of `w:tblPr` rather than a child of it, but it is
442
968
  * the table's own property set that travels through the editable model, so
443
969
  * it rides along here. It is replayed only while the column widths still
444
- * agree with it; {@link gridChangeXml} carries the part of it that a rebuild
970
+ * agree with it; {@link gridChange} carries the part of it that a rebuild
445
971
  * must not drop.
446
972
  */
447
973
  gridSourceXml?: string;
448
974
  /**
449
- * The grid's `w:tblGridChange`, verbatim.
975
+ * The grid's `w:tblGridChange`.
450
976
  *
451
977
  * It records the grid as it stood before a reviewer resized a column, so it
452
978
  * is history: nothing in the current model derives it, and rebuilding the
453
- * grid from the column widths would accept the revision silently. The
454
- * element is a snapshot of columns rather than a description of them, so it
455
- * travels as markup rather than as a parsed shape.
979
+ * grid from the column widths would accept the revision silently.
456
980
  */
457
- gridChangeXml?: string;
981
+ gridChange?: TableGridChange;
458
982
  /**
459
983
  * The element this formatting was parsed from, verbatim.
460
984
  *
@@ -471,6 +995,8 @@ type TableFormatting = {
471
995
  */
472
996
  sourceXml?: string;
473
997
  };
998
+ /** Table properties a row may override in `w:tblPrEx`. */
999
+ type TablePropertyExceptionFormatting = Pick<TableFormatting, "width" | "justification" | "cellSpacing" | "indent" | "borders" | "shading" | "layout" | "cellMargins" | "look" | "preserved" | "sourceXml">;
474
1000
  /**
475
1001
  * Table row formatting properties (w:trPr)
476
1002
  */
@@ -491,12 +1017,14 @@ type TableRowFormatting = {
491
1017
  header?: boolean;
492
1018
  /** Allow row to break across pages */
493
1019
  cantSplit?: boolean;
494
- /** Row justification */
495
- justification?: "left" | "center" | "right";
1020
+ /** Row placement (`w:trPr/w:jc`) */
1021
+ justification?: TableAlignment;
496
1022
  /** Hidden row */
497
1023
  hidden?: boolean;
498
1024
  /** Conditional format style */
499
1025
  conditionalFormat?: ConditionalFormatStyle;
1026
+ /** The `w:trPr` children no reader took a typed value from. */
1027
+ preserved?: PreservedMarkup;
500
1028
  /**
501
1029
  * The element this formatting was parsed from, verbatim.
502
1030
  *
@@ -556,8 +1084,8 @@ type TableCellFormatting = {
556
1084
  shading?: ShadingProperties;
557
1085
  /** Vertical alignment */
558
1086
  verticalAlign?: "top" | "center" | "bottom";
559
- /** Text direction */
560
- textDirection?: "lr" | "lrV" | "rl" | "rlV" | "tb" | "tbV" | "tbRl" | "tbRlV" | "btLr";
1087
+ /** Text direction (`w:textDirection`) */
1088
+ textDirection?: TextDirection;
561
1089
  /** Grid span (horizontal merge) */
562
1090
  gridSpan?: number;
563
1091
  /** Vertical merge */
@@ -570,6 +1098,8 @@ type TableCellFormatting = {
570
1098
  hideMark?: boolean;
571
1099
  /** Conditional format style */
572
1100
  conditionalFormat?: ConditionalFormatStyle;
1101
+ /** The `w:tcPr` children no reader took a typed value from. */
1102
+ preserved?: PreservedMarkup;
573
1103
  /**
574
1104
  * The element this formatting was parsed from, verbatim.
575
1105
  *
@@ -589,29 +1119,63 @@ type TableCellFormatting = {
589
1119
  //#endregion
590
1120
  //#region src/model/lists.d.ts
591
1121
  /**
592
- * Number format type
1122
+ * What the marker renderer counts in: folio's own vocabulary, not the format's.
1123
+ *
1124
+ * It is `ST_NumberFormat` plus the zero-padded widths a `custom` format
1125
+ * resolves to. Those three used to sit in {@link NumberFormat} itself, which
1126
+ * meant the model held tokens `w:numFmt/@w:val` does not declare and a save
1127
+ * could write one; they belong here, on the render side, where nothing is
1128
+ * serialized.
593
1129
  */
594
- 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" | "decimalZero3" | "decimalZero4" | "decimalZero5" | "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";
1130
+ declare const COUNTER_FORMATS: readonly ["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", "bahtText", "dollarText", "custom", "decimalZero3", "decimalZero4", "decimalZero5"];
1131
+ type CounterFormat = (typeof COUNTER_FORMATS)[number];
595
1132
  /**
596
1133
  * Multi-level suffix (what follows the number)
597
1134
  */
598
1135
  type LevelSuffix = "tab" | "space" | "nothing";
1136
+ /**
1137
+ * `w:legacy`: the Word 6.0 numbering geometry a level asks for.
1138
+ *
1139
+ * `legacy` is the element's own `w:legacy` attribute rather than a `w:val`, so
1140
+ * an absent flag and an explicit `w:legacy="0"` are different states and the
1141
+ * element is recorded by presence.
1142
+ */
1143
+ type LevelLegacy = {
1144
+ legacy?: boolean;
1145
+ legacySpace?: number;
1146
+ legacyIndent?: number;
1147
+ };
599
1148
  /**
600
1149
  * List level definition
601
1150
  */
602
1151
  type ListLevel = {
603
1152
  /** Level index (0-8) */
604
1153
  ilvl: number;
1154
+ /** `w:tplc`: the template code Word keys the level's gallery entry by. */
1155
+ tplc?: string;
1156
+ /** `w:tentative`: the level is defined but no paragraph has used it yet. */
1157
+ tentative?: boolean;
605
1158
  /** Starting number */
606
1159
  start?: number;
607
- /** Number format */
1160
+ /** Number format (`w:numFmt/@w:val`) */
608
1161
  numFmt: NumberFormat;
1162
+ /**
1163
+ * `w:numFmt/@w:format`: the token list a `custom` format counts by, as
1164
+ * written. Meaningless for any other `numFmt`, and absent there.
1165
+ */
1166
+ numFmtFormat?: string;
609
1167
  /** Level text (e.g., "%1." or "•") */
610
1168
  lvlText: string;
1169
+ /** `w:lvlText@w:null`: the marker is a null character rather than the text. */
1170
+ lvlTextNull?: boolean;
611
1171
  /** Justification */
612
- lvlJc?: "left" | "center" | "right";
1172
+ lvlJc?: ParagraphAlignment;
613
1173
  /** Suffix after number */
614
1174
  suffix?: LevelSuffix;
1175
+ /** `w:pStyle`: the paragraph style this level numbers. */
1176
+ pStyle?: string;
1177
+ /** `w:lvlPicBulletId`: the `w:numPicBullet` this level draws its bullet from. */
1178
+ lvlPicBulletId?: number;
615
1179
  /** Paragraph properties for this level */
616
1180
  pPr?: ParagraphFormatting;
617
1181
  /** Run properties for the number/bullet */
@@ -621,11 +1185,11 @@ type ListLevel = {
621
1185
  /** Is legal numbering style */
622
1186
  isLgl?: boolean;
623
1187
  /** Legacy settings */
624
- legacy?: {
625
- legacy?: boolean;
626
- legacySpace?: number;
627
- legacyIndent?: number;
628
- };
1188
+ legacy?: LevelLegacy;
1189
+ /** Children of `w:lvl` the model has no field for, in source position. */
1190
+ preserved?: PreservedMarkup;
1191
+ /** Attributes of `w:lvl` the model has no field for. */
1192
+ preservedAttributes?: PreservedAttribute[];
629
1193
  };
630
1194
  /**
631
1195
  * Abstract numbering definition (w:abstractNum)
@@ -633,8 +1197,18 @@ type ListLevel = {
633
1197
  type AbstractNumbering = {
634
1198
  /** Abstract numbering ID */
635
1199
  abstractNumId: number;
1200
+ /**
1201
+ * `w:nsid`: the identity Word keys this template by across documents.
1202
+ *
1203
+ * Together with `tmpl` it is how a list carried between documents is
1204
+ * recognised as the same list, so a rebuild that dropped it turned every
1205
+ * template into a new one.
1206
+ */
1207
+ nsid?: string;
636
1208
  /** Multi-level type */
637
1209
  multiLevelType?: "hybridMultilevel" | "multilevel" | "singleLevel";
1210
+ /** `w:tmpl`: the gallery template this definition was created from. */
1211
+ tmpl?: string;
638
1212
  /** Numbering style link */
639
1213
  numStyleLink?: string;
640
1214
  /** Style link */
@@ -643,6 +1217,20 @@ type AbstractNumbering = {
643
1217
  levels: ListLevel[];
644
1218
  /** Name */
645
1219
  name?: string;
1220
+ /** Children of `w:abstractNum` the model has no field for, in source position. */
1221
+ preserved?: PreservedMarkup;
1222
+ /** Attributes of `w:abstractNum` the model has no field for. */
1223
+ preservedAttributes?: PreservedAttribute[];
1224
+ };
1225
+ /** One `w:lvlOverride`: what a concrete instance changes about one level. */
1226
+ type LevelOverride = {
1227
+ ilvl: number;
1228
+ startOverride?: number;
1229
+ lvl?: ListLevel;
1230
+ /** Children of `w:lvlOverride` the model has no field for, in source position. */
1231
+ preserved?: PreservedMarkup;
1232
+ /** Attributes of `w:lvlOverride` the model has no field for. */
1233
+ preservedAttributes?: PreservedAttribute[];
646
1234
  };
647
1235
  /**
648
1236
  * Numbering instance (w:num)
@@ -653,11 +1241,11 @@ type NumberingInstance = {
653
1241
  /** Reference to abstract numbering */
654
1242
  abstractNumId: number;
655
1243
  /** Level overrides */
656
- levelOverrides?: {
657
- ilvl: number;
658
- startOverride?: number;
659
- lvl?: ListLevel;
660
- }[];
1244
+ levelOverrides?: LevelOverride[];
1245
+ /** Children of `w:num` the model has no field for, in source position. */
1246
+ preserved?: PreservedMarkup;
1247
+ /** Attributes of `w:num` the model has no field for. */
1248
+ preservedAttributes?: PreservedAttribute[];
661
1249
  };
662
1250
  /** Typography from numbering-level `w:rPr` that applies to the marker glyphs. */
663
1251
  type ListMarkerFormatting = Pick<TextFormatting, "fontFamily" | "fontSize" | "fontSizeCs" | "bold" | "boldCs" | "italic" | "italicCs" | "rtl" | "cs">;
@@ -677,8 +1265,8 @@ type ListRendering = {
677
1265
  isBullet: boolean;
678
1266
  /** Whether this level uses legal numbering (parent placeholders render decimal). */
679
1267
  isLegal?: boolean;
680
- /** Number format type (decimal, lowerRoman, upperRoman, etc.) */
681
- numFmt?: NumberFormat;
1268
+ /** What the marker counts in (decimal, lowerRoman, a custom pad width, …). */
1269
+ numFmt?: CounterFormat;
682
1270
  /** Whether the list marker is hidden (w:vanish on level rPr) */
683
1271
  markerHidden?: boolean;
684
1272
  /** Canonical numbering-level marker typography, in OOXML units. */
@@ -697,8 +1285,8 @@ type ListRendering = {
697
1285
  * adds one space glyph; `nothing` lets body text butt against the marker.
698
1286
  */
699
1287
  markerSuffix?: LevelSuffix;
700
- /** Number format for each level from 0 through this paragraph's level. */
701
- levelNumFmts?: NumberFormat[];
1288
+ /** What each level from 0 through this paragraph's counts in. */
1289
+ levelNumFmts?: CounterFormat[];
702
1290
  /**
703
1291
  * `w:start` for each level from 0 through this paragraph's level. Layout
704
1292
  * seeds each level's counter from it, so a list whose definition starts at
@@ -733,73 +1321,135 @@ type NumberingDefinitions = {
733
1321
  abstractNums: AbstractNumbering[];
734
1322
  /** Numbering instances */
735
1323
  nums: NumberingInstance[];
1324
+ /** Children of `w:numbering` the model has no field for, in source position. */
1325
+ preserved?: PreservedMarkup;
1326
+ /** Attributes of `w:numbering` the model has no field for. */
1327
+ preservedAttributes?: PreservedAttribute[];
736
1328
  };
737
1329
  //#endregion
738
- //#region src/model/preservedMarkup.d.ts
1330
+ //#region src/model/preview.d.ts
739
1331
  /**
740
- * The ordered verbatim sink: where a container's unmodelled markup goes.
741
- *
742
- * A parser that walks a container's children, models the ones it recognises
743
- * and lets the rest fall off the end of a `switch` loses them silently, and
744
- * verbatim replay hides the loss until somebody edits the document. The sink
745
- * is the other branch of that `switch`. It keeps the markup as bytes together
746
- * with **where it was**, so the serializer puts it back between the same
747
- * modelled siblings rather than at the end of the container, which is what the
748
- * schema's ordered content models require.
1332
+ * How a drawing with no image data is drawn, without drawing it.
749
1333
  *
750
- * The position is recorded as a count, not a pointer: `index` is how many
751
- * modelled children the container had read when the markup arrived. That
752
- * survives the model being edited — inserting a paragraph shifts what comes
753
- * after it, which is what a reader would expect — and it needs no identity on
754
- * the modelled children.
1334
+ * A `w:drawing` whose graphic is a diagram carries no `a:blip`, so there is no
1335
+ * image to resolve and the model has nothing to say the drawing looks like.
1336
+ * Rasterising a placeholder at parse time answers that, at the cost of holding
1337
+ * a megapixel PNG — megabytes per drawing — for the life of the document,
1338
+ * whether or not anything ever paints it.
755
1339
  *
756
- * One field, `preserved`, carries both halves for every container that has a
757
- * sink, so a reader never has to know which of two names a given container
758
- * used.
1340
+ * A descriptor says the same thing as a list of flat rectangles in the
1341
+ * drawing's own coordinate space. It is hundreds of bytes against megabytes,
1342
+ * and it is what a renderer draws: no picture is built at parse time or at
1343
+ * paint time, so a backend with vector operators draws vectors.
1344
+ */
1345
+ /** One flat rectangle of a preview, in the coordinate space of {@link PreviewDescriptor.extent}. */
1346
+ type PreviewShape = {
1347
+ readonly x: number;
1348
+ readonly y: number;
1349
+ readonly width: number;
1350
+ readonly height: number;
1351
+ /** Six hexadecimal digits, no leading `#`, as `a:srgbClr@val` spells it. */
1352
+ readonly color: string;
1353
+ };
1354
+ /**
1355
+ * Discriminated on `kind` rather than shaped as a diagram record: chart frames
1356
+ * and OLE previews are the same problem and will want the same field, and a
1357
+ * `kind` now is cheaper than migrating a bare `diagram` later.
759
1358
  */
760
- /** Markup the container's model does not hold, and where it sat. */
761
- type PreservedChild = {
1359
+ type PreviewDescriptor = {
1360
+ readonly kind: "diagram";
762
1361
  /**
763
- * Modelled children that preceded this markup in the source. `0` puts it
764
- * before the first modelled child; the container's modelled count puts it
765
- * after the last.
1362
+ * The drawing's extent, in the units `shapes` coordinates use (EMU).
1363
+ *
1364
+ * Held here rather than read from the owning `Image.size` so a descriptor
1365
+ * that reaches a renderer alone still maps its shapes onto the box it is
1366
+ * drawn in.
766
1367
  */
767
- index: number;
768
- /** Replayable markup for one child, as `captureVerbatimXml` wrote it. */
769
- xml: string;
1368
+ readonly extent: {
1369
+ readonly width: number;
1370
+ readonly height: number;
1371
+ };
1372
+ /** Already clipped to the shape cap, in paint order. */
1373
+ readonly shapes: readonly PreviewShape[];
770
1374
  };
1375
+ //#endregion
1376
+ //#region src/model/relationshipId.d.ts
771
1377
  /**
772
- * A container's unmodelled markup. Absent means the parser read every child
773
- * the source carried, which is the state a fully modelled container is in; an
774
- * empty record is never written.
1378
+ * A relationship reference that names something.
1379
+ *
1380
+ * A reference in the body (`r:embed` on an `a:blip`, `r:id` on a
1381
+ * `v:imagedata`) is a key into the owning part's relationships. A drawing that
1382
+ * carries none is common: a chart, an OLE frame, an anchor with no
1383
+ * `a:graphic`, and every preview folio draws for markup it cannot project.
1384
+ * Absence has one spelling, `undefined`, so it can never reach a relationship
1385
+ * lookup as a key or be written back as `r:embed=""`.
1386
+ *
1387
+ * The brand is what makes that a property of the type rather than a rule
1388
+ * producers are asked to remember. The empty string is not a `RelationshipId`,
1389
+ * so a field typed as one cannot hold the second spelling of absence, and a
1390
+ * reference read off the source becomes one only through
1391
+ * {@link relationshipIdOf}.
775
1392
  */
776
- type PreservedMarkup = {
777
- /** Ordered by `index`, then by source order within an index. */
778
- children?: PreservedChild[];
1393
+ type RelationshipId = string & {
1394
+ readonly __brand: "folio.relationshipId";
779
1395
  };
780
1396
  /**
781
- * One attribute an element carried that its parser has no field for.
1397
+ * The relationship a reference names, or `undefined` when it names none.
782
1398
  *
783
- * The remainder is a sibling of the child sink, not a member of it: an
784
- * attribute has no position among children to keep, so it rides the element's
785
- * own model record — `Paragraph.preservedAttributes` and its siblings — and
786
- * the serializer writes it back into the same start tag.
1399
+ * Takes what a reader hands back (a missing attribute, an attribute present
1400
+ * and empty, a reference) and answers in the one spelling the model has for
1401
+ * absence.
1402
+ */
1403
+ declare const relationshipIdOf: (value: string | null | undefined) => RelationshipId | undefined;
1404
+ /**
1405
+ * The id a save gives a part it added, from the ordinal it allocated.
787
1406
  *
788
- * The name is resolved, never the source's spelling. folio reads an attribute
789
- * by namespace URI plus local name, so a remainder that kept `"w:rsidR"`
790
- * textually would keep a second copy of the `w:rsidR` a source spelled
791
- * `altw:rsidR` under a second binding of the same URI. `namespace` is absent
792
- * for an unprefixed attribute, which has none; a namespace declaration is not
793
- * an attribute of the element in this sense and is never in the remainder,
794
- * because the rebuilt part binds its own prefixes.
1407
+ * A mint is not a read, so it has no absent case to report: `rId` followed by
1408
+ * a number names something by construction, and a build where it does not is
1409
+ * one where the refinement has stopped describing the type.
795
1410
  */
796
- type PreservedAttribute = {
797
- /** Resolved namespace URI, absent for an unprefixed attribute. */
798
- namespace?: string;
799
- /** Local name, without the prefix the source happened to bind. */
800
- name: string;
801
- value: string;
802
- };
1411
+ declare const mintRelationshipId: (ordinal: number) => RelationshipId;
1412
+ //#endregion
1413
+ //#region src/model/presetLineDash.gen.d.ts
1414
+ /**
1415
+ * GENERATED FILE — do not edit.
1416
+ *
1417
+ * The `ST_PresetLineDashVal` enumeration, in schema order, derived from
1418
+ * `specifications/generated/docx-transitional-schema.gen.json` by
1419
+ * `scripts/generate-preset-line-dash.ts`. Regenerate with:
1420
+ *
1421
+ * bun run generate:preset-line-dash
1422
+ *
1423
+ * It is the dash vocabulary of `a:ln/a:prstDash@val`, and only that: the
1424
+ * spellings it shares with CSS `border-style` (`solid`, `dash`, `dot`)
1425
+ * name different patterns there. Read it through `./presetLineDash`.
1426
+ */
1427
+ /** Every `ST_PresetLineDashVal` member, in schema order. */
1428
+ declare const PRESET_LINE_DASH_VALS: readonly ["solid", "dot", "dash", "lgDash", "dashDot", "lgDashDot", "lgDashDotDot", "sysDash", "sysDot", "sysDashDot", "sysDashDotDot"];
1429
+ /** `a:prstDash@val`: a preset dash the schema declares. */
1430
+ type PresetLineDashVal = (typeof PRESET_LINE_DASH_VALS)[number];
1431
+ //#endregion
1432
+ //#region src/model/presetLineDash.d.ts
1433
+ /**
1434
+ * A `@val` the schema does not declare, kept exactly as the file spelled it.
1435
+ *
1436
+ * Dropping the dash would repaint an authored outline as a plain line, and
1437
+ * reading it as `solid` would rewrite the document on open. The parser reports
1438
+ * it through `ParseContext` so the normalisation is visible, and the
1439
+ * serializer writes `raw` back unchanged.
1440
+ */
1441
+ type UnrecognisedPresetLineDash = {
1442
+ readonly kind: "unrecognised";
1443
+ readonly raw: string;
1444
+ };
1445
+ /** What `ShapeOutline.dash` holds: a schema member, or the raw token. */
1446
+ type PresetLineDashValue = PresetLineDashVal | UnrecognisedPresetLineDash;
1447
+ /** Whether the schema declares this token. */
1448
+ declare const isPresetLineDashVal: (value: string) => value is PresetLineDashVal;
1449
+ /** Read a `@val` into the model, keeping an undeclared token verbatim. */
1450
+ declare const presetLineDashFrom: (value: string) => PresetLineDashValue;
1451
+ /** The token to write back, whether or not the schema declares it. */
1452
+ declare const presetLineDashToken: (dash: PresetLineDashValue) => string;
803
1453
  //#endregion
804
1454
  //#region src/model/content.d.ts
805
1455
  /**
@@ -1007,16 +1657,21 @@ type Hyperlink = {
1007
1657
  /** Document location */
1008
1658
  docLocation?: string;
1009
1659
  /**
1010
- * The link's content: runs, bookmark boundaries, and markup folio does not
1011
- * model kept where the source put it.
1660
+ * The link's content: runs, bookmark boundaries, the transparent wrappers,
1661
+ * and markup folio does not model kept where the source put it.
1012
1662
  *
1013
1663
  * `CT_Hyperlink` is `EG_PContent`, so a link may hold a permission range, a
1014
- * proofing error, a smart tag or a custom-XML revision range between its
1015
- * runs. The capture is a member of this union rather than a sink beside it
1016
- * for the reason `PreservedInline` gives: position inside the link is what
1017
- * decides whether the markup goes with the link when the link moves.
1664
+ * proofing error or a custom-XML revision range between its runs. The
1665
+ * capture is a member of this union rather than a sink beside it for the
1666
+ * reason `PreservedInline` gives: position inside the link is what decides
1667
+ * whether the markup goes with the link when the link moves.
1668
+ *
1669
+ * `EG_PContent` also declares `w:bdo`, `w:dir`, `w:smartTag` and the
1670
+ * run-level `w:customXml`, so an author may write `w:hyperlink > w:bdo`.
1671
+ * That is the parse leg only: the editor carries a wrapper as a mark and the
1672
+ * save leg writes the canonical order, wrapper outside the link.
1018
1673
  */
1019
- children: (Run | BookmarkStart | BookmarkEnd | PreservedInline)[];
1674
+ children: (Run | BookmarkStart | BookmarkEnd | InlineWrapper | PreservedInline)[];
1020
1675
  };
1021
1676
  /**
1022
1677
  * Which side of a `w:customXml` element a range marker was displaced to
@@ -1069,6 +1724,29 @@ type BookmarkStart = {
1069
1724
  type BookmarkEnd = {
1070
1725
  type: "bookmarkEnd";
1071
1726
  } & MarkupRangeMarker;
1727
+ /**
1728
+ * A bookmark marker standing between a container's own children.
1729
+ *
1730
+ * `CT_Tbl` declares `w:bookmarkStart`/`w:bookmarkEnd` beside its rows and
1731
+ * `CT_Row` beside its cells, and neither a row nor a cell is what the marker
1732
+ * is, so there is no union member for it to be: this is the sink's shape, with
1733
+ * `index` counting the modelled siblings that preceded it. What it is *not* is
1734
+ * the sink itself. The verbatim sink keeps bytes, and bytes are invisible to
1735
+ * the passes that pair a start with its end, so a table- or row-level bookmark
1736
+ * captured that way takes its partner down with it. The marker stays typed;
1737
+ * only its position is an index.
1738
+ *
1739
+ * The index drifts when a column or a row is inserted or deleted around it,
1740
+ * which is the same honest cost {@link TableRow.preserved} carries and the
1741
+ * reason {@link BlockContent} admits the marker as a member wherever it can.
1742
+ */
1743
+ type PositionedBookmarkMarker = {
1744
+ /** Modelled siblings (rows for a table, cells for a row) that preceded it. */
1745
+ index: number;
1746
+ marker: BookmarkStart | BookmarkEnd;
1747
+ /** Row- or cell-level controls whose content held this marker. */
1748
+ contentControls?: SdtProperties[];
1749
+ };
1072
1750
  /**
1073
1751
  * Known field types
1074
1752
  */
@@ -1083,11 +1761,13 @@ type SimpleField = {
1083
1761
  /** Parsed field type */
1084
1762
  fieldType: FieldType;
1085
1763
  /**
1086
- * The field's cached display, and any markup folio does not model between
1087
- * the runs that carry it. `CT_SimpleField` is `EG_PContent` plus
1088
- * `w:fldData`, so everything `EG_PContent` admits can sit here.
1764
+ * The field's cached display, the transparent wrappers around it, and any
1765
+ * markup folio does not model between the runs that carry it.
1766
+ * `CT_SimpleField` is `EG_PContent` plus `w:fldData`, so everything
1767
+ * `EG_PContent` admits can sit here, `w:bdo` / `w:dir` / `w:smartTag` /
1768
+ * `w:customXml` among them.
1089
1769
  */
1090
- content: (Run | Hyperlink | PreservedInline)[];
1770
+ content: (Run | Hyperlink | InlineWrapper | PreservedInline)[];
1091
1771
  /** `@w:fldLock`: absent states nothing, `false` is an explicit unlock. */
1092
1772
  fldLock?: boolean;
1093
1773
  /** `@w:dirty`: absent states nothing, `false` explicitly forbids a recompute. */
@@ -1128,6 +1808,66 @@ type ImageSize = {
1128
1808
  /** Height in EMUs */
1129
1809
  height: number;
1130
1810
  };
1811
+ /**
1812
+ * The four wrap insets, in EMU. Tri-state per key: absent is the element having
1813
+ * stated none, which OOXML reads as zero only once no other carrier states one.
1814
+ */
1815
+ type WrapDistances = {
1816
+ distT?: number;
1817
+ distB?: number;
1818
+ distL?: number;
1819
+ distR?: number;
1820
+ };
1821
+ /**
1822
+ * The element each wrap inset was authored on.
1823
+ *
1824
+ * `CT_Inline`, `CT_Anchor` and every `EG_WrapType` member but `wp:wrapNone`
1825
+ * declare their own insets, and OOXML reads the wrap child's where it states
1826
+ * one and the drawing's otherwise. Two records rather than one, so a rebuild
1827
+ * writes each inset back on the element that stated it instead of collecting
1828
+ * them all onto the drawing.
1829
+ */
1830
+ type WrapDistanceSlots = {
1831
+ /** `wp:inline`, or `wp:anchor` for a floating drawing. */
1832
+ drawing?: WrapDistances;
1833
+ /** The `wp:wrap*` child of an anchor. */
1834
+ wrapChild?: WrapDistances;
1835
+ };
1836
+ /**
1837
+ * The element each `wp:effectExtent` was authored on.
1838
+ *
1839
+ * `CT_Inline` and `CT_Anchor` declare one, and so do `CT_WrapSquare` and
1840
+ * `CT_WrapTopBottom`. The drawing's is the object's own effect reservation,
1841
+ * which is what {@link ImagePadding} holds; the wrap child's is the reservation
1842
+ * the text flow is computed against, a second value with a second owner. Two
1843
+ * records rather than one, so a rebuild writes each back on the element that
1844
+ * stated it instead of collecting both onto the drawing.
1845
+ */
1846
+ type EffectExtentSlots = {
1847
+ /** `wp:inline`, or `wp:anchor` for a floating drawing. */
1848
+ drawing?: ImagePadding;
1849
+ /** The `wp:wrapSquare` or `wp:wrapTopAndBottom` child of an anchor. */
1850
+ wrapChild?: ImagePadding;
1851
+ };
1852
+ /** A point on a wrap polygon. */
1853
+ type WrapPolygonPoint = {
1854
+ x: number;
1855
+ y: number;
1856
+ };
1857
+ /**
1858
+ * `CT_WrapPath`: the outline text flows around a tight or through wrap.
1859
+ *
1860
+ * The coordinates are the type's own relative space (a 21600-unit box over the
1861
+ * drawing's extent), not EMU, and are kept exactly as authored.
1862
+ */
1863
+ type ImageWrapPolygon = {
1864
+ /** `@edited`: absent states nothing, `false` is an explicit "generated". */
1865
+ edited?: boolean;
1866
+ /** `wp:start`, which `CT_WrapPath` requires. */
1867
+ start: WrapPolygonPoint;
1868
+ /** `wp:lineTo` in document order; `CT_WrapPath` requires at least two. */
1869
+ lineTo: WrapPolygonPoint[];
1870
+ };
1131
1871
  /**
1132
1872
  * Image wrap type for floating images
1133
1873
  */
@@ -1135,11 +1875,61 @@ type ImageWrap = {
1135
1875
  type: "inline" | "square" | "tight" | "through" | "topAndBottom" | "behind" | "inFront";
1136
1876
  /** Wrap text direction */
1137
1877
  wrapText?: "bothSides" | "left" | "right" | "largest";
1138
- /** Distance from text */
1878
+ /** The inset in force: the wrap child's where it stated one, the drawing's otherwise. */
1139
1879
  distT?: number;
1140
1880
  distB?: number;
1141
1881
  distL?: number;
1142
1882
  distR?: number;
1883
+ /** Which element stated each of the insets above. */
1884
+ distanceSlots?: WrapDistanceSlots;
1885
+ /** Which element stated a `wp:effectExtent`; the drawing's is the one in force. */
1886
+ effectExtentSlots?: EffectExtentSlots;
1887
+ /** `wp:wrapPolygon`, which `wp:wrapTight` and `wp:wrapThrough` require. */
1888
+ polygon?: ImageWrapPolygon;
1889
+ };
1890
+ /**
1891
+ * The three authored strings every `CT_NonVisualDrawingProps` carries:
1892
+ * `wp:docPr`, `pic:cNvPr` and `wps:cNvPr` each have their own set, and they are
1893
+ * the object's accessible name and alt text rather than folio's to mint.
1894
+ */
1895
+ type NonVisualDrawingNames = {
1896
+ /** `@name`, schema-required, so `""` means the object was never named. */
1897
+ name?: string;
1898
+ /** `@descr`: alt text, accessibility content. */
1899
+ alt?: string;
1900
+ /** `@title`. */
1901
+ title?: string;
1902
+ };
1903
+ /**
1904
+ * `wp:anchor`'s own attributes, and the `wp:simplePos` offsets beside them.
1905
+ *
1906
+ * A picture, a shape and a text box are the same `CT_Anchor` with a different
1907
+ * graphic inside, so they share one record: a serializer that owned only the
1908
+ * picture wrote constants for the other two, and two pictures a document
1909
+ * deliberately stacked came back on one layer.
1910
+ *
1911
+ * Tri-state per attribute. Absent is the author having stated nothing, and a
1912
+ * rebuild then writes OOXML's own default for the five `CT_Anchor` requires
1913
+ * rather than a value folio chose.
1914
+ */
1915
+ type DrawingAnchor = {
1916
+ /** `@simplePos`: position from `wp:simplePos` rather than `positionH`/`positionV`. */
1917
+ useSimplePosition?: boolean;
1918
+ /** `wp:simplePos` itself, in EMUs. */
1919
+ simplePosition?: {
1920
+ x: number;
1921
+ y: number;
1922
+ };
1923
+ /** `@relativeHeight`: z-order among the anchors on a page. */
1924
+ relativeHeight?: number;
1925
+ /** `@locked`: the anchor may not be moved. */
1926
+ locked?: boolean;
1927
+ /** `@layoutInCell`: an anchor in a table cell is confined to the cell. */
1928
+ layoutInCell?: boolean;
1929
+ /** `@allowOverlap`: anchored objects may overlap one another. */
1930
+ allowOverlap?: boolean;
1931
+ /** `@hidden`: not `wp:docPr@hidden`, which hides the drawing itself. */
1932
+ hidden?: boolean;
1143
1933
  };
1144
1934
  /**
1145
1935
  * Position for floating images
@@ -1204,6 +1994,14 @@ type ImageFrameLocks = {
1204
1994
  noMove?: boolean;
1205
1995
  noResize?: boolean;
1206
1996
  };
1997
+ /**
1998
+ * A `wp:docPr` link as authored. `rId` is the target it named, so comparing it
1999
+ * with the model's tells a retargeted link from an untouched one.
2000
+ */
2001
+ type ImageDocPrLink = {
2002
+ xml: string;
2003
+ rId?: string;
2004
+ };
1207
2005
  /**
1208
2006
  * Embedded image (w:drawing)
1209
2007
  */
@@ -1214,14 +2012,27 @@ type Image = {
1214
2012
  /**
1215
2013
  * Relationship id for the image data, absent when the drawing carries none.
1216
2014
  *
1217
- * A `w:drawing` whose graphic is not a picture — a chart, a diagram, an OLE
1218
- * frame — and one with no `a:graphic` at all have no `a:blip`, so there is no
1219
- * id to record. Absence is spelled `undefined` rather than `""` so it can
1220
- * never reach a relationship lookup as a key.
1221
- */
1222
- rId?: string;
2015
+ * A `w:drawing` whose graphic is not a picture (a chart, a diagram, an OLE
2016
+ * frame) and one with no `a:graphic` at all have no `a:blip`, so there is no
2017
+ * id to record. So has no preview folio draws for markup it cannot project.
2018
+ * Absence is spelled `undefined` and only `undefined`, which {@link
2019
+ * RelationshipId} makes true of the type rather than of its producers: the
2020
+ * empty string is not one, so it can never reach a relationship lookup as a
2021
+ * key or be written back as `r:embed=""`.
2022
+ */
2023
+ rId?: RelationshipId;
1223
2024
  /** Resolved image data (base64 or blob URL) */
1224
2025
  src?: string;
2026
+ /**
2027
+ * Present when the drawing has no image data and is drawn from a description.
2028
+ *
2029
+ * `src` keeps its meaning — resolved image data — and is not set alongside
2030
+ * this. The two are mutually exclusive in practice; they are not modelled as
2031
+ * a union because `Image` has thirty other fields and a union over the whole
2032
+ * record would churn every consumer. A drawing with neither is the existing
2033
+ * "nothing to paint" case and stays valid.
2034
+ */
2035
+ preview?: PreviewDescriptor;
1225
2036
  /** Image MIME type */
1226
2037
  mimeType?: string;
1227
2038
  /** Original filename */
@@ -1232,6 +2043,16 @@ type Image = {
1232
2043
  alt?: string;
1233
2044
  /** Authored non-visual drawing title (`wp:docPr@title`) */
1234
2045
  title?: string;
2046
+ /**
2047
+ * `pic:cNvPr`'s own name, alt text and title.
2048
+ *
2049
+ * The drawing's are `docPrName`, `alt` and `title` above, off `wp:docPr`. A
2050
+ * reader names the object from whichever of the two it is looking at, so
2051
+ * folding them together loses whichever the source did not repeat, and a
2052
+ * rebuild that wrote the media filename here renamed a picture the author
2053
+ * had named.
2054
+ */
2055
+ pictureNames?: NonVisualDrawingNames;
1235
2056
  /** Image size */
1236
2057
  size: ImageSize;
1237
2058
  /** Original size before any transforms */
@@ -1253,20 +2074,8 @@ type Image = {
1253
2074
  * fully opaque. Mirrors eigenpal docx-editor #424.
1254
2075
  */
1255
2076
  opacity?: number;
1256
- /**
1257
- * `wp:anchor layoutInCell` — when true (OOXML default), an anchored image
1258
- * inside a table cell is constrained to the cell. When false, the image
1259
- * escapes the cell into the page area. Round-tripped on save so the
1260
- * author's intent survives; undefined means "use the spec default".
1261
- */
1262
- layoutInCell?: boolean;
1263
- /**
1264
- * `wp:anchor allowOverlap` — when true (OOXML default), anchored objects
1265
- * may overlap; when false, Word repositions them to avoid collisions. We
1266
- * don't currently reposition, but we round-trip the flag so saving
1267
- * preserves the author's intent; undefined means "use the spec default".
1268
- */
1269
- allowOverlap?: boolean;
2077
+ /** `wp:anchor`'s own attributes; see {@link DrawingAnchor}. */
2078
+ anchor?: DrawingAnchor;
1270
2079
  /**
1271
2080
  * The image carries no information a reader needs, so assistive technology
1272
2081
  * skips it. Word writes this as an extension on `wp:docPr`
@@ -1291,6 +2100,14 @@ type Image = {
1291
2100
  hlinkHref?: string;
1292
2101
  /** Relationship ID for the clickable image hyperlink */
1293
2102
  hlinkRId?: string;
2103
+ /**
2104
+ * `a:hlinkClick` as authored. `hlinkRId` names the click target the editor
2105
+ * edits; the rest of `CT_Hyperlink` has no model, so the element replays
2106
+ * while `rId` says the two agree.
2107
+ */
2108
+ hlinkClickSource?: ImageDocPrLink;
2109
+ /** `a:hlinkHover` as authored; the model holds nothing of it. */
2110
+ hlinkHoverXml?: string;
1294
2111
  /** Image outline/border */
1295
2112
  outline?: ShapeOutline;
1296
2113
  /** Image effects */
@@ -1344,8 +2161,14 @@ type ShapeOutline = {
1344
2161
  width?: number;
1345
2162
  /** Line color */
1346
2163
  color?: ColorValue;
1347
- /** Line style */
1348
- style?: "solid" | "dot" | "dash" | "lgDash" | "dashDot" | "lgDashDot" | "lgDashDotDot" | "sysDot" | "sysDash" | "sysDashDot" | "sysDashDotDot";
2164
+ /**
2165
+ * `a:prstDash@val`: the preset dash pattern, in DrawingML's own vocabulary.
2166
+ *
2167
+ * Not a CSS `border-style`, though `solid`, `dash` and `dot` are spelled the
2168
+ * same in both. `a:custDash` is a different element and is not modelled; an
2169
+ * outline that carries one replays through {@link ShapeOutline.rawXml}.
2170
+ */
2171
+ dash?: PresetLineDashValue;
1349
2172
  /** Line cap */
1350
2173
  cap?: "flat" | "round" | "square";
1351
2174
  /** Line join */
@@ -1413,12 +2236,20 @@ type Shape = {
1413
2236
  alt?: string;
1414
2237
  /** Authored non-visual drawing title (`wp:docPr@title` / `wps:cNvPr@title`) */
1415
2238
  title?: string;
2239
+ /**
2240
+ * `wps:cNvPr`'s own name, alt text and title, where the source wrote a set
2241
+ * separate from `wp:docPr`'s. A rebuild wrote no `wps:cNvPr` at all, so a
2242
+ * shape named inside the graphic lost that name on every edit.
2243
+ */
2244
+ shapeNames?: NonVisualDrawingNames;
1416
2245
  /** Size in EMUs */
1417
2246
  size: ImageSize;
1418
2247
  /** Position for floating shapes */
1419
2248
  position?: ImagePosition;
1420
2249
  /** Wrap settings */
1421
2250
  wrap?: ImageWrap;
2251
+ /** `wp:anchor`'s own attributes; see {@link DrawingAnchor}. */
2252
+ anchor?: DrawingAnchor;
1422
2253
  /** Fill */
1423
2254
  fill?: ShapeFill;
1424
2255
  /** Outline/stroke */
@@ -1449,6 +2280,8 @@ type TextBox = {
1449
2280
  position?: ImagePosition;
1450
2281
  /** Wrap settings */
1451
2282
  wrap?: ImageWrap;
2283
+ /** `wp:anchor`'s own attributes; see {@link DrawingAnchor}. */
2284
+ anchor?: DrawingAnchor;
1452
2285
  /** Fill */
1453
2286
  fill?: ShapeFill;
1454
2287
  /** Outline */
@@ -1494,6 +2327,29 @@ type TableCell = {
1494
2327
  * the model's recursion out of every table.
1495
2328
  */
1496
2329
  content: TableCellBlock[];
2330
+ /**
2331
+ * The cell-level content controls (`CT_SdtCell`) this cell sits inside,
2332
+ * outermost first.
2333
+ *
2334
+ * See {@link TableRow.contentControls}: a cell-level control is the same
2335
+ * shape one level down, and the two share the serializer that re-opens the
2336
+ * wrapper.
2337
+ */
2338
+ contentControls?: SdtProperties[];
2339
+ };
2340
+ /**
2341
+ * A table or row child the verbatim sink kept, including the content-control
2342
+ * stack that owned it when it was read.
2343
+ *
2344
+ * The position alone cannot distinguish a marker just outside a control from
2345
+ * one at the start or end of its `w:sdtContent`. Carrying the stack keeps the
2346
+ * marker inside its authored wrapper and prevents one control from being
2347
+ * rebuilt as two wrappers around the children on either side of it.
2348
+ */
2349
+ type TablePreservedMarkup = {
2350
+ children?: (PreservedChild & {
2351
+ contentControls?: SdtProperties[];
2352
+ })[];
1497
2353
  };
1498
2354
  /**
1499
2355
  * Table row
@@ -1502,8 +2358,24 @@ type TableRow = {
1502
2358
  type: "tableRow";
1503
2359
  /** Row formatting */
1504
2360
  formatting?: TableRowFormatting;
2361
+ /**
2362
+ * The table properties this row overrides (`w:tblPrEx`).
2363
+ *
2364
+ * `CT_TblPrEx` is the middle of `CT_TblPrBase` — width, justification, cell
2365
+ * spacing, indent, borders, shading, layout, cell margins and the look — so
2366
+ * it is the table's own property set narrowed to what a row may restate, and
2367
+ * it travels in the same shape. Word writes one when a table is built by
2368
+ * merging two, and a consumer reads it in place of the table's for this row
2369
+ * alone, so losing it silently restyles the row.
2370
+ *
2371
+ * It is not `formatting`: that is `w:trPr`, the row's own geometry, and the
2372
+ * two are different elements in different places in `CT_Row`.
2373
+ */
2374
+ tablePropertyExceptions?: TablePropertyExceptionFormatting;
1505
2375
  /** Row-level tracked property changes (w:trPrChange) */
1506
2376
  propertyChanges?: TableRowPropertyChange[];
2377
+ /** Tracked changes to the property exceptions (w:tblPrExChange) */
2378
+ tablePropertyExceptionChanges?: TablePropertyExceptionChange[];
1507
2379
  /** Tracked structural changes (row insert/delete) */
1508
2380
  structuralChange?: TableStructuralChangeInfo;
1509
2381
  /** Cells in this row */
@@ -1518,7 +2390,7 @@ type TableRow = {
1518
2390
  * there is no member to be, and `index` counts the cells that preceded the
1519
2391
  * capture.
1520
2392
  */
1521
- preserved?: PreservedMarkup;
2393
+ preserved?: TablePreservedMarkup;
1522
2394
  /**
1523
2395
  * Attributes `w:tr` carried that this record has no field for.
1524
2396
  *
@@ -1527,6 +2399,39 @@ type TableRow = {
1527
2399
  * editor creates has none, and a row split off another does not inherit one.
1528
2400
  */
1529
2401
  preservedAttributes?: PreservedAttribute[];
2402
+ /**
2403
+ * Bookmark markers `w:tr` held beside its cells, with their position.
2404
+ *
2405
+ * Word writes a bookmark that selects whole rows this way. See
2406
+ * {@link PositionedBookmarkMarker} for why these stay typed instead of
2407
+ * joining {@link TableRow.preserved}.
2408
+ */
2409
+ bookmarks?: PositionedBookmarkMarker[];
2410
+ /**
2411
+ * The row-level content controls (`CT_SdtRow`) this row sits inside,
2412
+ * outermost first.
2413
+ *
2414
+ * `CT_SdtRow` is transparent: what it holds is ordinary rows, and the
2415
+ * control adds a tag, an alias, a lock, a data binding and an end mark. So
2416
+ * the control is recorded *on* the rows it wrapped rather than as a member
2417
+ * between them — a member would need a node of its own in a table whose
2418
+ * children are rows, and an index would drift the moment a row moved.
2419
+ *
2420
+ * **A control may hold several rows, and then each of them carries the same
2421
+ * record.** `CT_SdtContentRow` admits `w:tr*`; across 5299 public packages
2422
+ * every one of the 23 row-level controls held exactly one row, and the same
2423
+ * for all 329 cell-level ones. The serializer rebuilds a multi-row wrapper
2424
+ * by grouping consecutive rows that name the same control, so the schema's
2425
+ * case survives without a `TableRowGroup` member that the ProseMirror table
2426
+ * schema could not carry. The cost is stated where the grouping is: two
2427
+ * adjacent rows in two separate but identically spelled controls come back
2428
+ * as one.
2429
+ *
2430
+ * The list is a stack because a control may hold a control: a repeating
2431
+ * section whose row is itself bound. Outermost first, as the source wrote
2432
+ * them.
2433
+ */
2434
+ contentControls?: SdtProperties[];
1530
2435
  };
1531
2436
  /**
1532
2437
  * Table (w:tbl)
@@ -1553,7 +2458,15 @@ type Table = {
1553
2458
  * model and are read and written elsewhere, so they are not in the sink and
1554
2459
  * the index counts rows only.
1555
2460
  */
1556
- preserved?: PreservedMarkup;
2461
+ preserved?: TablePreservedMarkup;
2462
+ /**
2463
+ * Bookmark markers `w:tbl` held beside its rows, with their position.
2464
+ *
2465
+ * Word writes a bookmark that selects a whole table this way. See
2466
+ * {@link PositionedBookmarkMarker} for why these stay typed instead of
2467
+ * joining {@link Table.preserved}.
2468
+ */
2469
+ bookmarks?: PositionedBookmarkMarker[];
1557
2470
  };
1558
2471
  /**
1559
2472
  * A comment (w:comment) from comments.xml
@@ -1743,10 +2656,22 @@ type BidiControl = (typeof BIDI_CONTROLS)[keyof typeof BIDI_CONTROLS];
1743
2656
  * Transparent means it says something about its content without constraining
1744
2657
  * it: it nests, it may hold anything paragraph content may hold, and dropping
1745
2658
  * it changes what the reader sees or what the markup states rather than what
1746
- * the text is. `bidi` is the one kind folio parses today; a smart tag and a
1747
- * custom-XML wrapper are the same shape and land with their parser.
2659
+ * the text is.
2660
+ *
2661
+ * The discriminant is what keeps the kinds apart structurally: a smart tag
2662
+ * cannot carry a bidirectional `control`, and a bidirectional wrapper cannot
2663
+ * carry an `element`, because neither branch declares the other's field.
1748
2664
  *
1749
- * `bidi` is `w:dir` / `w:bdo` — ECMA-376 §17.3.2.8, §17.3.2.3.
2665
+ * `smartTag` and `customXml` declare the same three slots because their
2666
+ * content models do, and they are written out rather than shared through a
2667
+ * helper so that the published type says what each kind carries without
2668
+ * naming a second one. They stay separate kinds because they are separate
2669
+ * elements: a smart tag is Word's own recognizer markup and a custom-XML
2670
+ * wrapper is a mapping into a caller's schema.
2671
+ *
2672
+ * - `bidi` is `w:dir` / `w:bdo` — ECMA-376 §17.3.2.8, §17.3.2.3.
2673
+ * - `smartTag` is `w:smartTag` — §17.5.1.9.
2674
+ * - `customXml` is the run-level `w:customXml` — §17.5.1.6.
1750
2675
  */
1751
2676
  type InlineWrapper = {
1752
2677
  type: "inlineWrapper";
@@ -1755,6 +2680,32 @@ type InlineWrapper = {
1755
2680
  /** `w:val`; absent in the source means the wrapper states no direction. */
1756
2681
  direction?: "ltr" | "rtl";
1757
2682
  content: ParagraphContent[];
2683
+ } | {
2684
+ type: "inlineWrapper";
2685
+ kind: "smartTag";
2686
+ /** `w:element`: the local name of the tagged element. */
2687
+ element: string;
2688
+ /** `w:uri`; absent means the tag names no namespace. */
2689
+ uri?: string;
2690
+ /**
2691
+ * `w:smartTagPr` verbatim: an attribute bag (`w:attr` children) whose
2692
+ * meaning belongs to the producer that wrote it, so folio replays the
2693
+ * bytes rather than modelling them. See
2694
+ * `docs/verbatim-markup-trust-boundary.md` for what that obliges a
2695
+ * writer that builds a document from scratch to check.
2696
+ */
2697
+ propertiesXml?: string;
2698
+ content: ParagraphContent[];
2699
+ } | {
2700
+ type: "inlineWrapper";
2701
+ kind: "customXml";
2702
+ /** `w:element`: the local name of the tagged element. */
2703
+ element: string;
2704
+ /** `w:uri`; absent means the tag names no namespace. */
2705
+ uri?: string;
2706
+ /** `w:customXmlPr` verbatim; see the `smartTag` branch. */
2707
+ propertiesXml?: string;
2708
+ content: ParagraphContent[];
1758
2709
  };
1759
2710
  /**
1760
2711
  * Move-from range start marker (w:moveFromRangeStart) — ECMA-376 §17.13.5.22
@@ -1822,6 +2773,22 @@ type TablePropertyChange = {
1822
2773
  /** Table properties after the tracked change (editor model convenience) */
1823
2774
  currentFormatting?: TableFormatting;
1824
2775
  };
2776
+ /**
2777
+ * Table property exception change (w:tblPrExChange)
2778
+ *
2779
+ * Its own type rather than a `TablePropertyChange`: it carries the row-legal
2780
+ * subset and is written as a different element in a different container. A
2781
+ * shared discriminator would let one reach the other's serializer.
2782
+ */
2783
+ type TablePropertyExceptionChange = {
2784
+ type: "tablePropertyExceptionChange";
2785
+ /** Tracked change metadata */
2786
+ info: PropertyChangeInfo;
2787
+ /** Property exceptions before the tracked change */
2788
+ previousFormatting?: TablePropertyExceptionFormatting;
2789
+ /** Property exceptions after the tracked change (editor model convenience) */
2790
+ currentFormatting?: TablePropertyExceptionFormatting;
2791
+ };
1825
2792
  /**
1826
2793
  * Table row property change (w:trPrChange)
1827
2794
  */
@@ -1845,6 +2812,16 @@ type TableCellPropertyChange = {
1845
2812
  previousFormatting?: TableCellFormatting;
1846
2813
  /** Cell properties after the tracked change (editor model convenience) */
1847
2814
  currentFormatting?: TableCellFormatting;
2815
+ /**
2816
+ * The cell's own insertion, deletion or merge as the snapshot recorded it.
2817
+ *
2818
+ * `CT_TcPrInner` is `CT_TcPrBase` plus `EG_CellMarkupElements`, so the
2819
+ * `w:tcPr` inside a `w:tcPrChange` may carry `w:cellIns`, `w:cellDel` or
2820
+ * `w:cellMerge` — "before this property change, the cell stood inserted".
2821
+ * It is not the cell's current revision, which is
2822
+ * {@link TableCell.structuralChange}, so it rides the change that recorded it.
2823
+ */
2824
+ previousStructuralChange?: TableStructuralChangeInfo;
1848
2825
  };
1849
2826
  /**
1850
2827
  * Section property change (w:sectPrChange)
@@ -1863,6 +2840,36 @@ type SectionPropertyChange = {
1863
2840
  /** Section properties after the tracked change (editor model convenience) */
1864
2841
  currentProperties?: SectionProperties;
1865
2842
  };
2843
+ /**
2844
+ * Every tracked property revision the model carries: a change element that
2845
+ * stores the complete previous property set beside a {@link PropertyChangeInfo},
2846
+ * so accepting it drops the record and rejecting it restores the set.
2847
+ *
2848
+ * Structural revisions ({@link TrackedRunChange}, {@link ParagraphMarkChange},
2849
+ * {@link TableStructuralChangeInfo}) are deliberately outside it: they add or
2850
+ * remove content rather than restate properties, and they resolve by moving
2851
+ * content rather than by restoring a snapshot.
2852
+ */
2853
+ type PropertyChange = RunPropertyChange | ParagraphPropertyChange | SectionPropertyChange | TablePropertyChange | TablePropertyExceptionChange | TableRowPropertyChange | TableCellPropertyChange;
2854
+ /** One of {@link PROPERTY_REVISION_KINDS}. */
2855
+ type PropertyRevisionKind = PropertyChange["type"];
2856
+ /**
2857
+ * Runtime census of {@link PropertyChange}'s discriminators.
2858
+ *
2859
+ * It is the one place the set is written down. Every consumer that resolves,
2860
+ * lists or compares a property revision is total over it
2861
+ * (`satisfies Record<PropertyRevisionKind, …>`), so a revision the model gains
2862
+ * is a compile error at each of those sites rather than a branch nobody wrote.
2863
+ */
2864
+ declare const PROPERTY_REVISION_KINDS: Readonly<{
2865
+ readonly runPropertyChange: "runPropertyChange";
2866
+ readonly paragraphPropertyChange: "paragraphPropertyChange";
2867
+ readonly sectionPropertyChange: "sectionPropertyChange";
2868
+ readonly tablePropertyChange: "tablePropertyChange";
2869
+ readonly tablePropertyExceptionChange: "tablePropertyExceptionChange";
2870
+ readonly tableRowPropertyChange: "tableRowPropertyChange";
2871
+ readonly tableCellPropertyChange: "tableCellPropertyChange";
2872
+ }>;
1866
2873
  /**
1867
2874
  * Table structural tracked change metadata (row/cell insert/delete/merge)
1868
2875
  */
@@ -1886,16 +2893,16 @@ type SdtType = "richText" | "plainText" | "date" | "dropdown" | "comboBox" | "ch
1886
2893
  /**
1887
2894
  * SDT properties (`w:sdtPr`).
1888
2895
  *
1889
- * Modeled fields are a read-only projection for downstream tooling
1890
- * (tag/alias addressing, template extraction). They are NOT the
1891
- * serialization source: the original `<w:sdtPr>` is captured verbatim in
1892
- * `rawPropertiesXml` and replayed on save, which preserves element order
1893
- * (`CT_SdtPr` is an `xsd:sequence`), avoids double-emission, and keeps
1894
- * unmodeled features (`w:dataBinding`, `w15:repeatingSection`, `@lastValue`,
1895
- * `w:sdtEndPr`) lossless.
2896
+ * The modelled fields are the addressing and interaction surface: a tag, an
2897
+ * alias, a lock, the value a user picked. Everything else the schema declares
2898
+ * — the control-kind element, `w:dataBinding`, `w:label`, `w:tabIndex`,
2899
+ * `w:temporary`, `w:rPr` — and every extension-namespace child a producer
2900
+ * writes are in {@link SdtProperties.preserved}, at the ordinal `CT_SdtPr`'s
2901
+ * sequence gives them. Together the two are the whole element: the serializer
2902
+ * writes both halves and nothing replays the source's bytes whole.
1896
2903
  */
1897
2904
  type SdtProperties = {
1898
- /** SDT type (projection; round-trip uses `rawPropertiesXml`). */
2905
+ /** SDT type (a projection of the control-kind element the set holds). */
1899
2906
  sdtType: SdtType;
1900
2907
  /** Numeric id (`w:id/@w:val`). */
1901
2908
  id?: number;
@@ -1937,13 +2944,25 @@ type SdtProperties = {
1937
2944
  /** Checkbox checked state (`w14:checkbox/w14:checked`). */
1938
2945
  checked?: boolean;
1939
2946
  /**
1940
- * Verbatim `<w:sdtPr>…</w:sdtPr>` captured at parse time. Replayed on
1941
- * serialize so unmodeled OOXML features (data binding, repeating sections,
1942
- * `@lastValue`, custom XML mappings) survive round-trip.
2947
+ * The `w:sdtPr` children folio does not model, at their schema ordinal.
2948
+ *
2949
+ * `CT_SdtPr` is an `xsd:sequence`, so the ordinal is the child's position
2950
+ * in it rather than a count of modelled siblings: the count is a mirror of
2951
+ * whichever properties folio models today and it moves under the capture
2952
+ * the moment one more of them is modelled.
1943
2953
  */
1944
- rawPropertiesXml?: string;
2954
+ preserved?: PreservedMarkup;
1945
2955
  /** Verbatim `<w:sdtEndPr>…</w:sdtEndPr>` captured at parse time. */
1946
2956
  rawEndPropertiesXml?: string;
2957
+ /**
2958
+ * `w:sdtEndPr` as a record, beside the bytes above rather than instead of
2959
+ * them.
2960
+ *
2961
+ * The capture is replayed while it exists, and a control folio *rebuilds* —
2962
+ * one an edit touched, one a full repack writes — has no bytes to replay,
2963
+ * so before this the end mark simply disappeared from the saved control.
2964
+ */
2965
+ endProperties?: SdtEndProperties;
1947
2966
  /**
1948
2967
  * Verbatim XML for any non-content direct children of `<w:sdt>` that
1949
2968
  * appear BEFORE `<w:sdtContent>` — MS-OE376 §2.5.2.30 documents 16
@@ -1957,6 +2976,19 @@ type SdtProperties = {
1957
2976
  /** Verbatim XML for non-content sdt children that appear AFTER `<w:sdtContent>`. */
1958
2977
  rawSdtChildrenAfterContent?: string;
1959
2978
  };
2979
+ /**
2980
+ * `w:sdtEndPr`: what the control's end-of-content mark carries.
2981
+ *
2982
+ * `CT_SdtEndPr` declares `w:rPr` and nothing else, so the record's presence is
2983
+ * the element's and its one field is those run properties. `<w:sdtEndPr/>`
2984
+ * with no `w:rPr` is what Word writes for most controls and says something an
2985
+ * absent element does not, which is why presence is the record rather than a
2986
+ * flag on {@link SdtProperties}.
2987
+ */
2988
+ type SdtEndProperties = {
2989
+ /** `w:sdtEndPr/w:rPr`, absent when the element declared none. */
2990
+ runProperties?: TextFormatting;
2991
+ };
1960
2992
  /**
1961
2993
  * Inline SDT (content control within a paragraph).
1962
2994
  *
@@ -1964,13 +2996,21 @@ type SdtProperties = {
1964
2996
  * tracked insertions/deletions/moves, the bidirectional controls, and math at
1965
2997
  * this level. All of them must survive parse → edit → save so docProps-bound
1966
2998
  * fields and reviewed template content do not lose their wrapper on round-trip.
2999
+ *
3000
+ * The bookmark boundaries belong here for the reason the revision wrapper's
3001
+ * do: `CT_SdtContentRun` reaches them through
3002
+ * `EG_RunLevelElts > EG_RangeMarkupElements`, and a marker lifted out to a
3003
+ * sibling of the control is a bookmark whose extent has changed. A range that
3004
+ * covered the control's content ends up covering the control and whatever
3005
+ * follows it, so a `REF` field or a link to the bookmark resolves to the
3006
+ * wrong text.
1967
3007
  */
1968
3008
  type InlineSdt = {
1969
3009
  type: "inlineSdt";
1970
3010
  /** SDT properties */
1971
3011
  properties: SdtProperties;
1972
3012
  /** Inline content held inside the control */
1973
- content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | InlineWrapper | Insertion | Deletion | MoveFrom | MoveTo | MathEquation | PreservedInline)[];
3013
+ content: (Run | Hyperlink | BookmarkStart | BookmarkEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | Insertion | Deletion | MoveFrom | MoveTo | MathEquation | PreservedInline)[];
1974
3014
  };
1975
3015
  /**
1976
3016
  * Block-level SDT (content control wrapping paragraphs/tables).
@@ -1981,7 +3021,7 @@ type InlineSdt = {
1981
3021
  */
1982
3022
  type BlockSdt = {
1983
3023
  type: "blockSdt";
1984
- /** SDT properties (raw XML in `properties.rawPropertiesXml` round-trips losslessly). */
3024
+ /** SDT properties; `properties.preserved` carries what the model does not. */
1985
3025
  properties: SdtProperties;
1986
3026
  /** Block content inside the control. */
1987
3027
  content: BlockContent[];
@@ -2299,7 +3339,6 @@ type Column = {
2299
3339
  /**
2300
3340
  * Section properties (w:sectPr)
2301
3341
  */
2302
- type SectionTextDirection = "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | "tbLrV" | "tb" | "rl" | "lr" | "tbV" | "rlV" | "lrV";
2303
3342
  type SectionProperties = {
2304
3343
  /** Page width in twips */
2305
3344
  pageWidth?: number;
@@ -2335,8 +3374,8 @@ type SectionProperties = {
2335
3374
  sectionStart?: SectionStart;
2336
3375
  /** Vertical alignment of text */
2337
3376
  verticalAlign?: VerticalAlign;
2338
- /** Section text direction */
2339
- textDirection?: SectionTextDirection;
3377
+ /** Section text direction (`w:sectPr/w:textDirection`) */
3378
+ textDirection?: TextDirection;
2340
3379
  /** Right-to-left section */
2341
3380
  bidi?: boolean;
2342
3381
  /** Header references */
@@ -2377,7 +3416,7 @@ type SectionProperties = {
2377
3416
  /** Page background */
2378
3417
  background?: {
2379
3418
  color?: ColorValue;
2380
- themeColor?: ThemeColorSlot;
3419
+ themeColor?: ThemeColorValue;
2381
3420
  themeTint?: string;
2382
3421
  themeShade?: string;
2383
3422
  };
@@ -2407,6 +3446,8 @@ type SectionProperties = {
2407
3446
  printerSettingsRelationshipId?: string;
2408
3447
  /** Section-level tracked property changes (w:sectPrChange) */
2409
3448
  propertyChanges?: SectionPropertyChange[];
3449
+ /** The `w:sectPr` children no reader took a typed value from. */
3450
+ preserved?: PreservedMarkup;
2410
3451
  /**
2411
3452
  * Attributes `w:sectPr` carried that this record has no field for.
2412
3453
  *
@@ -2439,8 +3480,23 @@ type PreservedBlock = {
2439
3480
  };
2440
3481
  /**
2441
3482
  * Block-level content types
2442
- */
2443
- type BlockContent = Paragraph | Table | BlockSdt | PreservedBlock;
3483
+ *
3484
+ * `BookmarkStart` and `BookmarkEnd` are members here as well as in
3485
+ * {@link ParagraphContent}, because `CT_Body`, `CT_Tc` and
3486
+ * `CT_SdtContentBlock` each declare them beside their blocks and Word writes
3487
+ * them there: `_GoBack` on the body, a form field's range on the cell, a
3488
+ * table-of-contents range around the blocks it covers. The marker is the same
3489
+ * element at either level, so it is the same model type, read and written by
3490
+ * the same parser and serializer.
3491
+ *
3492
+ * It is a member rather than a capture for a reason the two levels share.
3493
+ * A bookmark is a pair, and folio's pairing passes — `collectPairedBookmarkIds`
3494
+ * on the way in, the boundary integrity plugin on the way back — can only see a
3495
+ * marker the model holds. Keeping the block-level half as opaque bytes leaves
3496
+ * the paragraph-level half unpaired, and an unpaired boundary is deleted: the
3497
+ * bookmark would not merely move, it would go.
3498
+ */
3499
+ type BlockContent = Paragraph | Table | BlockSdt | PreservedBlock | BookmarkStart | BookmarkEnd;
2444
3500
  /** {@link BlockContent} minus the branch folio does not model inside a cell. */
2445
3501
  type TableCellBlock = Exclude<BlockContent, BlockSdt>;
2446
3502
  /**
@@ -2526,8 +3582,14 @@ declare const PARSE_WARNING_CODES: {
2526
3582
  readonly headerFooterTypeOutsideEnum: "header-footer-type-outside-enum";
2527
3583
  /** A value outside `ST_OnOff`'s six spellings. */
2528
3584
  readonly unrecognisedOnOffValue: "unrecognised-on-off-value";
3585
+ /** A theme-colour token outside `ST_ThemeColor`, kept but not painted. */
3586
+ readonly unrecognisedThemeColor: "unrecognised-theme-color";
2529
3587
  /** A `CT_Border` with no `w:val`, which has no border style to read. */
2530
3588
  readonly borderWithoutValue: "border-without-value";
3589
+ /** A `w:val` outside `ST_Border`, kept verbatim rather than read as a style. */
3590
+ readonly borderStyleOutsideEnum: "border-style-outside-enum";
3591
+ /** An `a:prstDash@val` outside `ST_PresetLineDashVal`, kept verbatim. */
3592
+ readonly outlineDashOutsideEnum: "outline-dash-outside-enum";
2531
3593
  /** A style set defining two styles under one id. */
2532
3594
  readonly styleSetDuplicateStyleId: "style-set-duplicate-style-id";
2533
3595
  /** A style set naming an initial paragraph style it does not contain. */
@@ -2714,6 +3776,33 @@ type Theme = {
2714
3776
  name?: string;
2715
3777
  };
2716
3778
  };
3779
+ /**
3780
+ * `w:charset`: the code page a font is encoded in, numbered and named.
3781
+ *
3782
+ * Two attributes of one element rather than two fields on the font, because
3783
+ * `w:charset` is the thing that carries both and a producer may write either.
3784
+ */
3785
+ type FontCharset = {
3786
+ /** `w:val`: the code page as a two-digit hexadecimal number. */
3787
+ val?: string;
3788
+ /** `w:characterSet`: the same set named (`ANSI_CHARSET`) rather than numbered. */
3789
+ characterSet?: string;
3790
+ };
3791
+ /**
3792
+ * One embedded face: the relationship to its binary and how to read it.
3793
+ *
3794
+ * The relationship id alone is not enough to use the face. `w:fontKey` is the
3795
+ * GUID the `.odttf` is obfuscated with, so a package that keeps the id and
3796
+ * drops the key keeps a pointer to bytes nothing can decode.
3797
+ */
3798
+ type EmbeddedFontRef = {
3799
+ /** `r:id` of the relationship to the font binary, in `word/_rels/fontTable.xml.rels`. */
3800
+ id: string;
3801
+ /** `w:fontKey`: the obfuscation GUID, e.g. `{XXXXXXXX-…}`. */
3802
+ fontKey?: string;
3803
+ /** `w:subsetted`: the embedded face carries only the glyphs the document uses. */
3804
+ subsetted?: boolean;
3805
+ };
2717
3806
  /**
2718
3807
  * Font info from fontTable.xml
2719
3808
  */
@@ -2725,7 +3814,7 @@ type FontInfo = {
2725
3814
  /** Panose-1 classification */
2726
3815
  panose1?: string;
2727
3816
  /** Character set */
2728
- charset?: string;
3817
+ charset?: FontCharset;
2729
3818
  /** Font family type */
2730
3819
  family?: "decorative" | "modern" | "roman" | "script" | "swiss" | "auto";
2731
3820
  /** Pitch (fixed or variable) */
@@ -2740,16 +3829,30 @@ type FontInfo = {
2740
3829
  csb1?: string;
2741
3830
  };
2742
3831
  /** Embedded font data reference */
2743
- embedRegular?: string;
2744
- embedBold?: string;
2745
- embedItalic?: string;
2746
- embedBoldItalic?: string;
3832
+ embedRegular?: EmbeddedFontRef;
3833
+ embedBold?: EmbeddedFontRef;
3834
+ embedItalic?: EmbeddedFontRef;
3835
+ embedBoldItalic?: EmbeddedFontRef;
3836
+ /** Children of `w:font` the model does not hold, in source position. */
3837
+ preserved?: PreservedMarkup;
3838
+ /** Attributes of `w:font` the model has no field for. */
3839
+ preservedAttributes?: PreservedAttribute[];
2747
3840
  };
2748
3841
  /**
2749
3842
  * Font table from fontTable.xml
2750
3843
  */
2751
3844
  type FontTable = {
2752
3845
  fonts: FontInfo[];
3846
+ /** Children of `w:fonts` that are not `w:font`, in source position. */
3847
+ preserved?: PreservedMarkup;
3848
+ /**
3849
+ * Attributes of `w:fonts` the model has no field for.
3850
+ *
3851
+ * Not the namespace declarations and not `mc:Ignorable`: a rebuilt part
3852
+ * binds the prefixes its own body uses and states which of them are
3853
+ * ignorable, so replaying the source's would name prefixes nothing binds.
3854
+ */
3855
+ preservedAttributes?: PreservedAttribute[];
2753
3856
  };
2754
3857
  /**
2755
3858
  * Relationship type
@@ -2945,4 +4048,4 @@ type Document = {
2945
4048
  parseWarnings?: ParseWarning[];
2946
4049
  };
2947
4050
  //#endregion
2948
- export { Footnote as $, TableBorders as $n, SectionProperties as $t, BookmarkEnd as A, normalizeRevisionId as An, NoteNumberRestart as At, DRAWING_RAW_XML_MODES as B, NumberingDefinitions as Bn, PositionalTab as Bt, ParseWarning as C, TextWatermark as Cn, MoveFrom as Ct, BidiControl as D, VerticalAlign as Dn, MoveToRangeEnd as Dt, BIDI_CONTROLS as E, TrackedRunContent as En, MoveTo as Et, Comment as F, LevelSuffix as Fn, ParagraphContent as Ft, DrawingRawXmlMode as G, FloatingTableProperties as Gn, REVIEW_CARRIERS as Gt, DisplacedByCustomXml as H, CellMargins as Hn, PreservedInline as Ht, CommentRangeEnd as I, ListLevel as In, ParagraphMarkChange as It, EndnoteProperties as J, ParagraphFormatting as Jn, RunContent as Jt, Endnote as K, LineSpacingRule as Kn, ReviewCarrier as Kt, CommentRangeStart as L, ListMarkerFormatting as Ln, ParagraphMarkChangeKind as Lt, BookmarkStart as M, PreservedChild as Mn, PARAGRAPH_MARK_CHANGE_KINDS as Mt, BreakContent as N, PreservedMarkup as Nn, PageOrientation as Nt, BlockContent as O, Watermark as On, MoveToRangeStart as Ot, Column as P, AbstractNumbering as Pn, Paragraph as Pt, FooterReference as Q, TabStopAlignment as Qn, Section as Qt, CommentReference as R, ListRendering as Rn, ParagraphPropertyChange as Rt, PARSE_WARNING_CODES as S, TextContent as Sn, MoveBookmarkMarker as St, ParseWarningLocation as T, TrackedRunChange as Tn, MoveFromRangeStart as Tt, DocumentBody as U, ConditionalFormatStyle as Un, PreservedXmlContent as Ut, Deletion as V, NumberingInstance as Vn, PreservedBlock as Vt, DrawingContent as W, EmphasisMark as Wn, PropertyChangeInfo as Wt, FieldCharContent as X, TabLeader as Xn, SdtProperties as Xt, Field as Y, SpacingExplicit as Yn, RunPropertyChange as Yt, FieldType as Z, TabStop as Zn, SdtType as Zt, Theme as _, TablePropertyChange as _n, InstrTextContent as _t, DocxPackage as a, ShapeGeometryAdjustment as an, TableRowFormatting as ar, Hyperlink as at, ThemeFontScheme as b, TableStructuralChangeInfo as bn, MarkupRangeMarker as bt, FontInfo as c, ShapeType as cn, TextFormatting as cr, ImageFrameLocks as ct, Relationship as d, SymbolContent as dn, ColorValue as dr, ImageSize as dt, SectionPropertyChange as en, TableCellBorders as er, FootnotePosition as et, RelationshipMap as f, TabContent as fn, KnownBorderStyle as fr, ImageTransform as ft, StyleType as g, TableCellPropertyChange as gn, Insertion as gt, StyleDefinitions as h, TableCellBlock as hn, InlineWrapper as ht, DocxConformanceClass as i, ShapeFill as in, TableMeasurement as ir, HeaderReference as it, BookmarkRangeMarker as j, PreservedAttribute as jn, NoteReferenceContent as jt, BlockSdt as k, isOoxmlSymbolCharacter as kn, NoBreakHyphenContent as kt, FontTable as l, SimpleField as ln, UnderlineStyle as lr, ImagePadding as lt, Style as m, TableCell as mn, ThemeColorSlot as mr, InlineSdt as mt, Document as n, Shape as nn, TableFormatting as nr, HeaderFooter as nt, ExhaustiveFields as o, ShapeOutline as on, TableWidthType as or, Image as ot, RelationshipType as p, Table as pn, ShadingProperties as pr, ImageWrap as pt, EndnotePosition as q, ParagraphAlignment as qn, Run as qt, DocumentSettings as r, ShapeContent as rn, TableLook as rr, HeaderFooterType as rt, DocDefaults as s, ShapeTextBody as sn, TextEffect as sr, ImageCrop as st, DOCX_CONFORMANCE_CLASSES as t, SectionStart as tn, TableCellFormatting as tr, FootnoteProperties as tt, MediaFile as u, SoftHyphenContent as un, BorderSpec as ur, ImagePosition as ut, ThemeColorScheme as v, TableRow as vn, LineNumberRestart as vt, ParseWarningCode as w, TrackedChangeInfo as wn, MoveFromRangeEnd as wt, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as x, TextBox as xn, MathEquation as xt, ThemeFont as y, TableRowPropertyChange as yn, MAX_REVISION_ID as yt, ComplexField as z, NumberFormat as zn, PictureWatermark as zt };
4051
+ export { Field as $, PRESET_LINE_DASH_VALS as $n, sameEffectiveParagraphNumbering as $r, PropertyChange as $t, BlockContent as A, knownThemeColor as Ai, TablePropertyChange as An, TableGridChange as Ar, MoveFromRangeEnd as At, CommentReference as B, borderStyleFrom as Bi, TrackedRunContent as Bn, NO_PARAGRAPH_NUMBERING as Br, PROPERTY_REVISION_KINDS as Bt, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as C, ShadingProperties as Ci, SymbolContent as Cn, SpacingExplicit as Cr, InstrTextContent as Ct, ParseWarningLocation as D, UnrecognisedThemeColor as Di, TableCellBlock as Dn, TableCellBorders as Dr, MathEquation as Dt, ParseWarningCode as E, ThemeColorValue as Ei, TableCell as En, TableBorders as Er, MarkupRangeMarker as Et, BreakContent as F, SchemeColorValue as Fi, TextBox as Fn, TableWidthType as Fr, NoBreakHyphenContent as Ft, DocumentBody as G, statesNoBorder as Gi, WrapPolygonPoint as Gn, isNumberingReference as Gr, ParagraphMarkChangeKind as Gt, DRAWING_RAW_XML_MODES as H, isBorderNil as Hi, Watermark as Hn, ParagraphNumberingReference as Hr, Paragraph as Ht, Column as I, THEME_COLORS as Ii, TextContent as In, TextEffect as Ir, NonVisualDrawingNames as It, DrawingRawXmlMode as J, PresetLineDashValue as Jn, paragraphNumberingLevel as Jr, PositionalTab as Jt, DrawingAnchor as K, BORDER_STYLES as Ki, isOoxmlSymbolCharacter as Kn, mergeParagraphNumbering as Kr, ParagraphPropertyChange as Kt, Comment as L, ThemeColor as Li, TextWatermark as Ln, TextFormatting as Lr, NoteNumberRestart as Lt, BookmarkEnd as M, themeColorSlot as Mi, TableRow as Mn, TableMeasurement as Mr, MoveTo as Mt, BookmarkRangeMarker as N, themeColorToken as Ni, TableRowPropertyChange as Nn, TablePropertyExceptionFormatting as Nr, MoveToRangeEnd as Nt, BIDI_CONTROLS as O, isSchemeColorValue as Oi, TableCellPropertyChange as On, TableCellFormatting as Or, MoveBookmarkMarker as Ot, BookmarkStart as P, SchemeColorSlot as Pi, TableStructuralChangeInfo as Pn, TableRowFormatting as Pr, MoveToRangeStart as Pt, EndnoteProperties as Q, presetLineDashToken as Qn, resolveParagraphNumbering as Qr, PreservedXmlContent as Qt, CommentRangeEnd as R, BorderStyleValue as Ri, TrackedChangeInfo as Rn, UnderlineStyle as Rr, NoteReferenceContent as Rt, ThemeFontScheme as S, ColorValue as Si, SoftHyphenContent as Sn, ParagraphFormatting as Sr, Insertion as St, ParseWarning as T, THEME_COLOR_BY_SCHEME_COLOR_VALUE as Ti, Table as Tn, TabStop as Tr, MAX_REVISION_ID as Tt, Deletion as U, isBorderNone as Ui, WrapDistanceSlots as Un, ParagraphNumberingSlots as Ur, ParagraphContent as Ut, ComplexField as V, borderStyleToken as Vi, VerticalAlign as Vn, ParagraphNumberingOverride as Vr, PageOrientation as Vt, DisplacedByCustomXml as W, isBorderStyle as Wi, WrapDistances as Wn, ResolvedParagraphNumbering as Wr, ParagraphMarkChange as Wt, Endnote as X, isPresetLineDashVal as Xn, paragraphNumberingReferenceId as Xr, PreservedBlock as Xt, EffectExtentSlots as Y, UnrecognisedPresetLineDash as Yn, paragraphNumberingReference as Yr, PositionedBookmarkMarker as Yt, EndnotePosition as Z, presetLineDashFrom as Zn, paragraphNumberingSlots as Zr, PreservedInline as Zt, StyleDefinitions as _, TabStopAlignment as _i, ShapeGeometryAdjustment as _n, CellMargins as _r, ImageTransform as _t, DocxPackage as a, headingOutlineLevel as ai, RunContent as an, PreviewShape as ar, FootnoteProperties as at, ThemeColorScheme as b, TextDirectionFlow as bi, ShapeType as bn, FloatingTableProperties as br, InlineSdt as bt, EmbeddedFontRef as c, NUMBER_FORMATS as ci, SdtProperties as cn, CounterFormat as cr, HeaderReference as ct, FontTable as d, ParagraphAlignment as di, SectionProperties as dn, LevelSuffix as dr, ImageCrop as dt, sameStatedParagraphNumbering as ei, PropertyChangeInfo as en, PresetLineDashVal as er, FieldCharContent as et, MediaFile as f, TABLE_ALIGNMENTS as fi, SectionPropertyChange as fn, ListLevel as fr, ImageDocPrLink as ft, Style as g, TEXT_DIRECTION_FLOW_BY_TOKEN as gi, ShapeFill as gn, NumberingInstance as gr, ImageSize as gt, RelationshipType as h, TEXT_DIRECTION_FLOWS as hi, ShapeContent as hn, NumberingDefinitions as hr, ImagePosition as ht, DocxConformanceClass as i, headingLevelOf as ii, Run as in, PreviewDescriptor as ir, FootnotePosition as it, BlockSdt as j, readThemeColor as ji, TablePropertyExceptionChange as jn, TableLook as jr, MoveFromRangeStart as jt, BidiControl as k, isThemeColor as ki, TablePreservedMarkup as kn, TableFormatting as kr, MoveFrom as kt, FontCharset as l, NumberFormat as li, SdtType as ln, LevelLegacy as lr, Hyperlink as lt, RelationshipMap as m, TEXT_DIRECTIONS as mi, Shape as mn, ListRendering as mr, ImagePadding as mt, Document as n, HeadingOutlineLevel as ni, REVIEW_CARRIERS as nn, mintRelationshipId as nr, FooterReference as nt, ExhaustiveFields as o, outlineLevelFromStatedValue as oi, RunPropertyChange as on, AbstractNumbering as or, HeaderFooter as ot, Relationship as p, TAB_STOP_ALIGNMENTS as pi, SectionStart as pn, ListMarkerFormatting as pr, ImageFrameLocks as pt, DrawingContent as q, BorderStyle as qi, normalizeRevisionId as qn, paragraphNumberingFromSlots as qr, PictureWatermark as qt, DocumentSettings as r, OutlineLevel as ri, ReviewCarrier as rn, relationshipIdOf as rr, Footnote as rt, DocDefaults as s, outlineLevelStatedValue as si, SdtEndProperties as sn, COUNTER_FORMATS as sr, HeaderFooterType as st, DOCX_CONFORMANCE_CLASSES as t, BODY_TEXT_OUTLINE_LEVEL as ti, PropertyRevisionKind as tn, RelationshipId as tr, FieldType as tt, FontInfo as u, PARAGRAPH_ALIGNMENTS as ui, Section as un, LevelOverride as ur, Image as ut, StyleType as v, TableAlignment as vi, ShapeOutline as vn, ConditionalFormatStyle as vr, ImageWrap as vt, PARSE_WARNING_CODES as w, SCHEME_COLOR_VALUE_BY_THEME_COLOR as wi, TabContent as wn, TabLeader as wr, LineNumberRestart as wt, ThemeFont as x, BorderSpec as xi, SimpleField as xn, LineSpacingRule as xr, InlineWrapper as xt, Theme as y, TextDirection as yi, ShapeTextBody as yn, EmphasisMark as yr, ImageWrapPolygon as yt, CommentRangeStart as z, UnrecognisedBorderStyle as zi, TrackedRunChange as zn, NO_NUMBERING_NUM_ID as zr, PARAGRAPH_MARK_CHANGE_KINDS as zt };