@stll/docx-core 0.24.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/document-DJuN_2kr.js +1200 -0
- package/dist/{document-DT_3cbkQ.d.ts → document-F2xMRFVZ.d.ts} +1296 -177
- package/dist/docx_kernel_bg.wasm +0 -0
- package/dist/index.d.ts +35 -2
- package/dist/index.js +125 -48
- package/dist/model/document.d.ts +3 -2
- package/dist/model/document.js +2 -2
- package/dist/preservedMarkup-G8XjWhs2.d.ts +68 -0
- package/dist/schema/sequenceChildren.d.ts +73 -0
- package/dist/schema/sequenceChildren.js +2 -0
- package/dist/sequenceChildren-DlUb7FZG.js +461 -0
- package/package.json +6 -1
- package/dist/document-CxQxNVrK.js +0 -155
|
@@ -1,21 +1,184 @@
|
|
|
1
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
/**
|
|
18
|
-
|
|
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
|
-
/**
|
|
32
|
-
|
|
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,7 +239,281 @@ 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[];
|
|
244
|
+
};
|
|
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;
|
|
67
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;
|
|
68
517
|
//#endregion
|
|
69
518
|
//#region src/model/formatting.d.ts
|
|
70
519
|
/**
|
|
@@ -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
|
-
/**
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
-
/**
|
|
291
|
-
|
|
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
|
|
415
|
-
justification?:
|
|
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
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
|
495
|
-
justification?:
|
|
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?:
|
|
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
|
-
*
|
|
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
|
-
|
|
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`, as written. The renderer interprets it only when
|
|
1164
|
+
* `numFmt` is `custom`, but other values still retain the authored metadata.
|
|
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?:
|
|
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
|
-
|
|
626
|
-
|
|
627
|
-
|
|
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
|
-
|
|
658
|
-
|
|
659
|
-
|
|
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
|
-
/**
|
|
681
|
-
numFmt?:
|
|
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
|
-
/**
|
|
701
|
-
levelNumFmts?:
|
|
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/
|
|
1330
|
+
//#region src/model/preview.d.ts
|
|
739
1331
|
/**
|
|
740
|
-
*
|
|
1332
|
+
* How a drawing with no image data is drawn, without drawing it.
|
|
741
1333
|
*
|
|
742
|
-
* A
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
746
|
-
*
|
|
747
|
-
* modelled siblings rather than at the end of the container, which is what the
|
|
748
|
-
* schema's ordered content models require.
|
|
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.
|
|
749
1339
|
*
|
|
750
|
-
*
|
|
751
|
-
*
|
|
752
|
-
*
|
|
753
|
-
*
|
|
754
|
-
* the modelled children.
|
|
755
|
-
*
|
|
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.
|
|
759
1344
|
*/
|
|
760
|
-
/**
|
|
761
|
-
type
|
|
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.
|
|
1358
|
+
*/
|
|
1359
|
+
type PreviewDescriptor = {
|
|
1360
|
+
readonly kind: "diagram";
|
|
762
1361
|
/**
|
|
763
|
-
*
|
|
764
|
-
*
|
|
765
|
-
*
|
|
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
|
-
|
|
768
|
-
|
|
769
|
-
|
|
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
|
|
773
|
-
*
|
|
774
|
-
*
|
|
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
|
|
777
|
-
|
|
778
|
-
children?: PreservedChild[];
|
|
1393
|
+
type RelationshipId = string & {
|
|
1394
|
+
readonly __brand: "folio.relationshipId";
|
|
779
1395
|
};
|
|
780
1396
|
/**
|
|
781
|
-
*
|
|
1397
|
+
* The relationship a reference names, or `undefined` when it names none.
|
|
782
1398
|
*
|
|
783
|
-
*
|
|
784
|
-
*
|
|
785
|
-
*
|
|
786
|
-
|
|
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
|
-
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
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
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
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
|
/**
|
|
@@ -828,6 +1478,14 @@ type TabContent = {
|
|
|
828
1478
|
*/
|
|
829
1479
|
type BreakContent = {
|
|
830
1480
|
type: "break";
|
|
1481
|
+
/** The distinct carriage-return element, which cannot carry break attributes. */
|
|
1482
|
+
sourceElement: "cr";
|
|
1483
|
+
breakType?: never;
|
|
1484
|
+
clear?: never;
|
|
1485
|
+
} | {
|
|
1486
|
+
type: "break";
|
|
1487
|
+
/** Absent and `br` both serialize as the standard break element. */
|
|
1488
|
+
sourceElement?: "br";
|
|
831
1489
|
/** Break type */
|
|
832
1490
|
breakType?: "page" | "column" | "textWrapping";
|
|
833
1491
|
/** Clear type for text wrapping break */
|
|
@@ -852,6 +1510,8 @@ type NoteReferenceContent = {
|
|
|
852
1510
|
type: "footnoteRef" | "endnoteRef";
|
|
853
1511
|
/** Note ID */
|
|
854
1512
|
id: number;
|
|
1513
|
+
/** An authored custom reference mark follows this reference. */
|
|
1514
|
+
customMarkFollows?: boolean;
|
|
855
1515
|
};
|
|
856
1516
|
/**
|
|
857
1517
|
* Field character (begin/separate/end)
|
|
@@ -1007,16 +1667,21 @@ type Hyperlink = {
|
|
|
1007
1667
|
/** Document location */
|
|
1008
1668
|
docLocation?: string;
|
|
1009
1669
|
/**
|
|
1010
|
-
* The link's content: runs, bookmark boundaries,
|
|
1011
|
-
* model kept where the source put it.
|
|
1670
|
+
* The link's content: runs, bookmark boundaries, the transparent wrappers,
|
|
1671
|
+
* and markup folio does not model kept where the source put it.
|
|
1012
1672
|
*
|
|
1013
1673
|
* `CT_Hyperlink` is `EG_PContent`, so a link may hold a permission range, a
|
|
1014
|
-
* proofing error
|
|
1015
|
-
*
|
|
1016
|
-
*
|
|
1017
|
-
*
|
|
1674
|
+
* proofing error or a custom-XML revision range between its runs. The
|
|
1675
|
+
* capture is a member of this union rather than a sink beside it for the
|
|
1676
|
+
* reason `PreservedInline` gives: position inside the link is what decides
|
|
1677
|
+
* whether the markup goes with the link when the link moves.
|
|
1678
|
+
*
|
|
1679
|
+
* `EG_PContent` also declares `w:bdo`, `w:dir`, `w:smartTag` and the
|
|
1680
|
+
* run-level `w:customXml`, so an author may write `w:hyperlink > w:bdo`.
|
|
1681
|
+
* That is the parse leg only: the editor carries a wrapper as a mark and the
|
|
1682
|
+
* save leg writes the canonical order, wrapper outside the link.
|
|
1018
1683
|
*/
|
|
1019
|
-
children: (Run | BookmarkStart | BookmarkEnd | PreservedInline)[];
|
|
1684
|
+
children: (Run | BookmarkStart | BookmarkEnd | InlineWrapper | PreservedInline)[];
|
|
1020
1685
|
};
|
|
1021
1686
|
/**
|
|
1022
1687
|
* Which side of a `w:customXml` element a range marker was displaced to
|
|
@@ -1069,6 +1734,29 @@ type BookmarkStart = {
|
|
|
1069
1734
|
type BookmarkEnd = {
|
|
1070
1735
|
type: "bookmarkEnd";
|
|
1071
1736
|
} & MarkupRangeMarker;
|
|
1737
|
+
/**
|
|
1738
|
+
* A bookmark marker standing between a container's own children.
|
|
1739
|
+
*
|
|
1740
|
+
* `CT_Tbl` declares `w:bookmarkStart`/`w:bookmarkEnd` beside its rows and
|
|
1741
|
+
* `CT_Row` beside its cells, and neither a row nor a cell is what the marker
|
|
1742
|
+
* is, so there is no union member for it to be: this is the sink's shape, with
|
|
1743
|
+
* `index` counting the modelled siblings that preceded it. What it is *not* is
|
|
1744
|
+
* the sink itself. The verbatim sink keeps bytes, and bytes are invisible to
|
|
1745
|
+
* the passes that pair a start with its end, so a table- or row-level bookmark
|
|
1746
|
+
* captured that way takes its partner down with it. The marker stays typed;
|
|
1747
|
+
* only its position is an index.
|
|
1748
|
+
*
|
|
1749
|
+
* The index drifts when a column or a row is inserted or deleted around it,
|
|
1750
|
+
* which is the same honest cost {@link TableRow.preserved} carries and the
|
|
1751
|
+
* reason {@link BlockContent} admits the marker as a member wherever it can.
|
|
1752
|
+
*/
|
|
1753
|
+
type PositionedBookmarkMarker = {
|
|
1754
|
+
/** Modelled siblings (rows for a table, cells for a row) that preceded it. */
|
|
1755
|
+
index: number;
|
|
1756
|
+
marker: BookmarkStart | BookmarkEnd;
|
|
1757
|
+
/** Row- or cell-level controls whose content held this marker. */
|
|
1758
|
+
contentControls?: SdtProperties[];
|
|
1759
|
+
};
|
|
1072
1760
|
/**
|
|
1073
1761
|
* Known field types
|
|
1074
1762
|
*/
|
|
@@ -1083,11 +1771,13 @@ type SimpleField = {
|
|
|
1083
1771
|
/** Parsed field type */
|
|
1084
1772
|
fieldType: FieldType;
|
|
1085
1773
|
/**
|
|
1086
|
-
* The field's cached display,
|
|
1087
|
-
* the runs that carry it.
|
|
1088
|
-
* `
|
|
1774
|
+
* The field's cached display, the transparent wrappers around it, and any
|
|
1775
|
+
* markup folio does not model between the runs that carry it.
|
|
1776
|
+
* `CT_SimpleField` is `EG_PContent` plus `w:fldData`, so everything
|
|
1777
|
+
* `EG_PContent` admits can sit here, `w:bdo` / `w:dir` / `w:smartTag` /
|
|
1778
|
+
* `w:customXml` among them.
|
|
1089
1779
|
*/
|
|
1090
|
-
content: (Run | Hyperlink | PreservedInline)[];
|
|
1780
|
+
content: (Run | Hyperlink | InlineWrapper | PreservedInline)[];
|
|
1091
1781
|
/** `@w:fldLock`: absent states nothing, `false` is an explicit unlock. */
|
|
1092
1782
|
fldLock?: boolean;
|
|
1093
1783
|
/** `@w:dirty`: absent states nothing, `false` explicitly forbids a recompute. */
|
|
@@ -1128,6 +1818,66 @@ type ImageSize = {
|
|
|
1128
1818
|
/** Height in EMUs */
|
|
1129
1819
|
height: number;
|
|
1130
1820
|
};
|
|
1821
|
+
/**
|
|
1822
|
+
* The four wrap insets, in EMU. Tri-state per key: absent is the element having
|
|
1823
|
+
* stated none, which OOXML reads as zero only once no other carrier states one.
|
|
1824
|
+
*/
|
|
1825
|
+
type WrapDistances = {
|
|
1826
|
+
distT?: number;
|
|
1827
|
+
distB?: number;
|
|
1828
|
+
distL?: number;
|
|
1829
|
+
distR?: number;
|
|
1830
|
+
};
|
|
1831
|
+
/**
|
|
1832
|
+
* The element each wrap inset was authored on.
|
|
1833
|
+
*
|
|
1834
|
+
* `CT_Inline`, `CT_Anchor` and every `EG_WrapType` member but `wp:wrapNone`
|
|
1835
|
+
* declare their own insets, and OOXML reads the wrap child's where it states
|
|
1836
|
+
* one and the drawing's otherwise. Two records rather than one, so a rebuild
|
|
1837
|
+
* writes each inset back on the element that stated it instead of collecting
|
|
1838
|
+
* them all onto the drawing.
|
|
1839
|
+
*/
|
|
1840
|
+
type WrapDistanceSlots = {
|
|
1841
|
+
/** `wp:inline`, or `wp:anchor` for a floating drawing. */
|
|
1842
|
+
drawing?: WrapDistances;
|
|
1843
|
+
/** The `wp:wrap*` child of an anchor. */
|
|
1844
|
+
wrapChild?: WrapDistances;
|
|
1845
|
+
};
|
|
1846
|
+
/**
|
|
1847
|
+
* The element each `wp:effectExtent` was authored on.
|
|
1848
|
+
*
|
|
1849
|
+
* `CT_Inline` and `CT_Anchor` declare one, and so do `CT_WrapSquare` and
|
|
1850
|
+
* `CT_WrapTopBottom`. The drawing's is the object's own effect reservation,
|
|
1851
|
+
* which is what {@link ImagePadding} holds; the wrap child's is the reservation
|
|
1852
|
+
* the text flow is computed against, a second value with a second owner. Two
|
|
1853
|
+
* records rather than one, so a rebuild writes each back on the element that
|
|
1854
|
+
* stated it instead of collecting both onto the drawing.
|
|
1855
|
+
*/
|
|
1856
|
+
type EffectExtentSlots = {
|
|
1857
|
+
/** `wp:inline`, or `wp:anchor` for a floating drawing. */
|
|
1858
|
+
drawing?: ImagePadding;
|
|
1859
|
+
/** The `wp:wrapSquare` or `wp:wrapTopAndBottom` child of an anchor. */
|
|
1860
|
+
wrapChild?: ImagePadding;
|
|
1861
|
+
};
|
|
1862
|
+
/** A point on a wrap polygon. */
|
|
1863
|
+
type WrapPolygonPoint = {
|
|
1864
|
+
x: number;
|
|
1865
|
+
y: number;
|
|
1866
|
+
};
|
|
1867
|
+
/**
|
|
1868
|
+
* `CT_WrapPath`: the outline text flows around a tight or through wrap.
|
|
1869
|
+
*
|
|
1870
|
+
* The coordinates are the type's own relative space (a 21600-unit box over the
|
|
1871
|
+
* drawing's extent), not EMU, and are kept exactly as authored.
|
|
1872
|
+
*/
|
|
1873
|
+
type ImageWrapPolygon = {
|
|
1874
|
+
/** `@edited`: absent states nothing, `false` is an explicit "generated". */
|
|
1875
|
+
edited?: boolean;
|
|
1876
|
+
/** `wp:start`, which `CT_WrapPath` requires. */
|
|
1877
|
+
start: WrapPolygonPoint;
|
|
1878
|
+
/** `wp:lineTo` in document order; `CT_WrapPath` requires at least two. */
|
|
1879
|
+
lineTo: WrapPolygonPoint[];
|
|
1880
|
+
};
|
|
1131
1881
|
/**
|
|
1132
1882
|
* Image wrap type for floating images
|
|
1133
1883
|
*/
|
|
@@ -1135,11 +1885,61 @@ type ImageWrap = {
|
|
|
1135
1885
|
type: "inline" | "square" | "tight" | "through" | "topAndBottom" | "behind" | "inFront";
|
|
1136
1886
|
/** Wrap text direction */
|
|
1137
1887
|
wrapText?: "bothSides" | "left" | "right" | "largest";
|
|
1138
|
-
/**
|
|
1888
|
+
/** The inset in force: the wrap child's where it stated one, the drawing's otherwise. */
|
|
1139
1889
|
distT?: number;
|
|
1140
1890
|
distB?: number;
|
|
1141
1891
|
distL?: number;
|
|
1142
1892
|
distR?: number;
|
|
1893
|
+
/** Which element stated each of the insets above. */
|
|
1894
|
+
distanceSlots?: WrapDistanceSlots;
|
|
1895
|
+
/** Which element stated a `wp:effectExtent`; the drawing's is the one in force. */
|
|
1896
|
+
effectExtentSlots?: EffectExtentSlots;
|
|
1897
|
+
/** `wp:wrapPolygon`, which `wp:wrapTight` and `wp:wrapThrough` require. */
|
|
1898
|
+
polygon?: ImageWrapPolygon;
|
|
1899
|
+
};
|
|
1900
|
+
/**
|
|
1901
|
+
* The three authored strings every `CT_NonVisualDrawingProps` carries:
|
|
1902
|
+
* `wp:docPr`, `pic:cNvPr` and `wps:cNvPr` each have their own set, and they are
|
|
1903
|
+
* the object's accessible name and alt text rather than folio's to mint.
|
|
1904
|
+
*/
|
|
1905
|
+
type NonVisualDrawingNames = {
|
|
1906
|
+
/** `@name`, schema-required, so `""` means the object was never named. */
|
|
1907
|
+
name?: string;
|
|
1908
|
+
/** `@descr`: alt text, accessibility content. */
|
|
1909
|
+
alt?: string;
|
|
1910
|
+
/** `@title`. */
|
|
1911
|
+
title?: string;
|
|
1912
|
+
};
|
|
1913
|
+
/**
|
|
1914
|
+
* `wp:anchor`'s own attributes, and the `wp:simplePos` offsets beside them.
|
|
1915
|
+
*
|
|
1916
|
+
* A picture, a shape and a text box are the same `CT_Anchor` with a different
|
|
1917
|
+
* graphic inside, so they share one record: a serializer that owned only the
|
|
1918
|
+
* picture wrote constants for the other two, and two pictures a document
|
|
1919
|
+
* deliberately stacked came back on one layer.
|
|
1920
|
+
*
|
|
1921
|
+
* Tri-state per attribute. Absent is the author having stated nothing, and a
|
|
1922
|
+
* rebuild then writes OOXML's own default for the five `CT_Anchor` requires
|
|
1923
|
+
* rather than a value folio chose.
|
|
1924
|
+
*/
|
|
1925
|
+
type DrawingAnchor = {
|
|
1926
|
+
/** `@simplePos`: position from `wp:simplePos` rather than `positionH`/`positionV`. */
|
|
1927
|
+
useSimplePosition?: boolean;
|
|
1928
|
+
/** `wp:simplePos` itself, in EMUs. */
|
|
1929
|
+
simplePosition?: {
|
|
1930
|
+
x: number;
|
|
1931
|
+
y: number;
|
|
1932
|
+
};
|
|
1933
|
+
/** `@relativeHeight`: z-order among the anchors on a page. */
|
|
1934
|
+
relativeHeight?: number;
|
|
1935
|
+
/** `@locked`: the anchor may not be moved. */
|
|
1936
|
+
locked?: boolean;
|
|
1937
|
+
/** `@layoutInCell`: an anchor in a table cell is confined to the cell. */
|
|
1938
|
+
layoutInCell?: boolean;
|
|
1939
|
+
/** `@allowOverlap`: anchored objects may overlap one another. */
|
|
1940
|
+
allowOverlap?: boolean;
|
|
1941
|
+
/** `@hidden`: not `wp:docPr@hidden`, which hides the drawing itself. */
|
|
1942
|
+
hidden?: boolean;
|
|
1143
1943
|
};
|
|
1144
1944
|
/**
|
|
1145
1945
|
* Position for floating images
|
|
@@ -1204,6 +2004,14 @@ type ImageFrameLocks = {
|
|
|
1204
2004
|
noMove?: boolean;
|
|
1205
2005
|
noResize?: boolean;
|
|
1206
2006
|
};
|
|
2007
|
+
/**
|
|
2008
|
+
* A `wp:docPr` link as authored. `rId` is the target it named, so comparing it
|
|
2009
|
+
* with the model's tells a retargeted link from an untouched one.
|
|
2010
|
+
*/
|
|
2011
|
+
type ImageDocPrLink = {
|
|
2012
|
+
xml: string;
|
|
2013
|
+
rId?: string;
|
|
2014
|
+
};
|
|
1207
2015
|
/**
|
|
1208
2016
|
* Embedded image (w:drawing)
|
|
1209
2017
|
*/
|
|
@@ -1214,14 +2022,27 @@ type Image = {
|
|
|
1214
2022
|
/**
|
|
1215
2023
|
* Relationship id for the image data, absent when the drawing carries none.
|
|
1216
2024
|
*
|
|
1217
|
-
* A `w:drawing` whose graphic is not a picture
|
|
1218
|
-
* frame
|
|
1219
|
-
* id to record.
|
|
1220
|
-
*
|
|
1221
|
-
|
|
1222
|
-
|
|
2025
|
+
* A `w:drawing` whose graphic is not a picture (a chart, a diagram, an OLE
|
|
2026
|
+
* frame) and one with no `a:graphic` at all have no `a:blip`, so there is no
|
|
2027
|
+
* id to record. So has no preview folio draws for markup it cannot project.
|
|
2028
|
+
* Absence is spelled `undefined` and only `undefined`, which {@link
|
|
2029
|
+
* RelationshipId} makes true of the type rather than of its producers: the
|
|
2030
|
+
* empty string is not one, so it can never reach a relationship lookup as a
|
|
2031
|
+
* key or be written back as `r:embed=""`.
|
|
2032
|
+
*/
|
|
2033
|
+
rId?: RelationshipId;
|
|
1223
2034
|
/** Resolved image data (base64 or blob URL) */
|
|
1224
2035
|
src?: string;
|
|
2036
|
+
/**
|
|
2037
|
+
* Present when the drawing has no image data and is drawn from a description.
|
|
2038
|
+
*
|
|
2039
|
+
* `src` keeps its meaning — resolved image data — and is not set alongside
|
|
2040
|
+
* this. The two are mutually exclusive in practice; they are not modelled as
|
|
2041
|
+
* a union because `Image` has thirty other fields and a union over the whole
|
|
2042
|
+
* record would churn every consumer. A drawing with neither is the existing
|
|
2043
|
+
* "nothing to paint" case and stays valid.
|
|
2044
|
+
*/
|
|
2045
|
+
preview?: PreviewDescriptor;
|
|
1225
2046
|
/** Image MIME type */
|
|
1226
2047
|
mimeType?: string;
|
|
1227
2048
|
/** Original filename */
|
|
@@ -1232,6 +2053,16 @@ type Image = {
|
|
|
1232
2053
|
alt?: string;
|
|
1233
2054
|
/** Authored non-visual drawing title (`wp:docPr@title`) */
|
|
1234
2055
|
title?: string;
|
|
2056
|
+
/**
|
|
2057
|
+
* `pic:cNvPr`'s own name, alt text and title.
|
|
2058
|
+
*
|
|
2059
|
+
* The drawing's are `docPrName`, `alt` and `title` above, off `wp:docPr`. A
|
|
2060
|
+
* reader names the object from whichever of the two it is looking at, so
|
|
2061
|
+
* folding them together loses whichever the source did not repeat, and a
|
|
2062
|
+
* rebuild that wrote the media filename here renamed a picture the author
|
|
2063
|
+
* had named.
|
|
2064
|
+
*/
|
|
2065
|
+
pictureNames?: NonVisualDrawingNames;
|
|
1235
2066
|
/** Image size */
|
|
1236
2067
|
size: ImageSize;
|
|
1237
2068
|
/** Original size before any transforms */
|
|
@@ -1253,20 +2084,8 @@ type Image = {
|
|
|
1253
2084
|
* fully opaque. Mirrors eigenpal docx-editor #424.
|
|
1254
2085
|
*/
|
|
1255
2086
|
opacity?: number;
|
|
1256
|
-
/**
|
|
1257
|
-
|
|
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;
|
|
2087
|
+
/** `wp:anchor`'s own attributes; see {@link DrawingAnchor}. */
|
|
2088
|
+
anchor?: DrawingAnchor;
|
|
1270
2089
|
/**
|
|
1271
2090
|
* The image carries no information a reader needs, so assistive technology
|
|
1272
2091
|
* skips it. Word writes this as an extension on `wp:docPr`
|
|
@@ -1291,6 +2110,14 @@ type Image = {
|
|
|
1291
2110
|
hlinkHref?: string;
|
|
1292
2111
|
/** Relationship ID for the clickable image hyperlink */
|
|
1293
2112
|
hlinkRId?: string;
|
|
2113
|
+
/**
|
|
2114
|
+
* `a:hlinkClick` as authored. `hlinkRId` names the click target the editor
|
|
2115
|
+
* edits; the rest of `CT_Hyperlink` has no model, so the element replays
|
|
2116
|
+
* while `rId` says the two agree.
|
|
2117
|
+
*/
|
|
2118
|
+
hlinkClickSource?: ImageDocPrLink;
|
|
2119
|
+
/** `a:hlinkHover` as authored; the model holds nothing of it. */
|
|
2120
|
+
hlinkHoverXml?: string;
|
|
1294
2121
|
/** Image outline/border */
|
|
1295
2122
|
outline?: ShapeOutline;
|
|
1296
2123
|
/** Image effects */
|
|
@@ -1344,8 +2171,14 @@ type ShapeOutline = {
|
|
|
1344
2171
|
width?: number;
|
|
1345
2172
|
/** Line color */
|
|
1346
2173
|
color?: ColorValue;
|
|
1347
|
-
/**
|
|
1348
|
-
|
|
2174
|
+
/**
|
|
2175
|
+
* `a:prstDash@val`: the preset dash pattern, in DrawingML's own vocabulary.
|
|
2176
|
+
*
|
|
2177
|
+
* Not a CSS `border-style`, though `solid`, `dash` and `dot` are spelled the
|
|
2178
|
+
* same in both. `a:custDash` is a different element and is not modelled; an
|
|
2179
|
+
* outline that carries one replays through {@link ShapeOutline.rawXml}.
|
|
2180
|
+
*/
|
|
2181
|
+
dash?: PresetLineDashValue;
|
|
1349
2182
|
/** Line cap */
|
|
1350
2183
|
cap?: "flat" | "round" | "square";
|
|
1351
2184
|
/** Line join */
|
|
@@ -1413,12 +2246,20 @@ type Shape = {
|
|
|
1413
2246
|
alt?: string;
|
|
1414
2247
|
/** Authored non-visual drawing title (`wp:docPr@title` / `wps:cNvPr@title`) */
|
|
1415
2248
|
title?: string;
|
|
2249
|
+
/**
|
|
2250
|
+
* `wps:cNvPr`'s own name, alt text and title, where the source wrote a set
|
|
2251
|
+
* separate from `wp:docPr`'s. A rebuild wrote no `wps:cNvPr` at all, so a
|
|
2252
|
+
* shape named inside the graphic lost that name on every edit.
|
|
2253
|
+
*/
|
|
2254
|
+
shapeNames?: NonVisualDrawingNames;
|
|
1416
2255
|
/** Size in EMUs */
|
|
1417
2256
|
size: ImageSize;
|
|
1418
2257
|
/** Position for floating shapes */
|
|
1419
2258
|
position?: ImagePosition;
|
|
1420
2259
|
/** Wrap settings */
|
|
1421
2260
|
wrap?: ImageWrap;
|
|
2261
|
+
/** `wp:anchor`'s own attributes; see {@link DrawingAnchor}. */
|
|
2262
|
+
anchor?: DrawingAnchor;
|
|
1422
2263
|
/** Fill */
|
|
1423
2264
|
fill?: ShapeFill;
|
|
1424
2265
|
/** Outline/stroke */
|
|
@@ -1449,6 +2290,8 @@ type TextBox = {
|
|
|
1449
2290
|
position?: ImagePosition;
|
|
1450
2291
|
/** Wrap settings */
|
|
1451
2292
|
wrap?: ImageWrap;
|
|
2293
|
+
/** `wp:anchor`'s own attributes; see {@link DrawingAnchor}. */
|
|
2294
|
+
anchor?: DrawingAnchor;
|
|
1452
2295
|
/** Fill */
|
|
1453
2296
|
fill?: ShapeFill;
|
|
1454
2297
|
/** Outline */
|
|
@@ -1478,6 +2321,8 @@ type TextBox = {
|
|
|
1478
2321
|
*/
|
|
1479
2322
|
type TableCell = {
|
|
1480
2323
|
type: "tableCell";
|
|
2324
|
+
/** Authored cell identifier (`w:tc/@w:id`). */
|
|
2325
|
+
id?: string;
|
|
1481
2326
|
/** Cell formatting */
|
|
1482
2327
|
formatting?: TableCellFormatting;
|
|
1483
2328
|
/** Cell-level tracked property changes (w:tcPrChange) */
|
|
@@ -1494,6 +2339,29 @@ type TableCell = {
|
|
|
1494
2339
|
* the model's recursion out of every table.
|
|
1495
2340
|
*/
|
|
1496
2341
|
content: TableCellBlock[];
|
|
2342
|
+
/**
|
|
2343
|
+
* The cell-level content controls (`CT_SdtCell`) this cell sits inside,
|
|
2344
|
+
* outermost first.
|
|
2345
|
+
*
|
|
2346
|
+
* See {@link TableRow.contentControls}: a cell-level control is the same
|
|
2347
|
+
* shape one level down, and the two share the serializer that re-opens the
|
|
2348
|
+
* wrapper.
|
|
2349
|
+
*/
|
|
2350
|
+
contentControls?: SdtProperties[];
|
|
2351
|
+
};
|
|
2352
|
+
/**
|
|
2353
|
+
* A table or row child the verbatim sink kept, including the content-control
|
|
2354
|
+
* stack that owned it when it was read.
|
|
2355
|
+
*
|
|
2356
|
+
* The position alone cannot distinguish a marker just outside a control from
|
|
2357
|
+
* one at the start or end of its `w:sdtContent`. Carrying the stack keeps the
|
|
2358
|
+
* marker inside its authored wrapper and prevents one control from being
|
|
2359
|
+
* rebuilt as two wrappers around the children on either side of it.
|
|
2360
|
+
*/
|
|
2361
|
+
type TablePreservedMarkup = {
|
|
2362
|
+
children?: (PreservedChild & {
|
|
2363
|
+
contentControls?: SdtProperties[];
|
|
2364
|
+
})[];
|
|
1497
2365
|
};
|
|
1498
2366
|
/**
|
|
1499
2367
|
* Table row
|
|
@@ -1502,8 +2370,24 @@ type TableRow = {
|
|
|
1502
2370
|
type: "tableRow";
|
|
1503
2371
|
/** Row formatting */
|
|
1504
2372
|
formatting?: TableRowFormatting;
|
|
2373
|
+
/**
|
|
2374
|
+
* The table properties this row overrides (`w:tblPrEx`).
|
|
2375
|
+
*
|
|
2376
|
+
* `CT_TblPrEx` is the middle of `CT_TblPrBase` — width, justification, cell
|
|
2377
|
+
* spacing, indent, borders, shading, layout, cell margins and the look — so
|
|
2378
|
+
* it is the table's own property set narrowed to what a row may restate, and
|
|
2379
|
+
* it travels in the same shape. Word writes one when a table is built by
|
|
2380
|
+
* merging two, and a consumer reads it in place of the table's for this row
|
|
2381
|
+
* alone, so losing it silently restyles the row.
|
|
2382
|
+
*
|
|
2383
|
+
* It is not `formatting`: that is `w:trPr`, the row's own geometry, and the
|
|
2384
|
+
* two are different elements in different places in `CT_Row`.
|
|
2385
|
+
*/
|
|
2386
|
+
tablePropertyExceptions?: TablePropertyExceptionFormatting;
|
|
1505
2387
|
/** Row-level tracked property changes (w:trPrChange) */
|
|
1506
2388
|
propertyChanges?: TableRowPropertyChange[];
|
|
2389
|
+
/** Tracked changes to the property exceptions (w:tblPrExChange) */
|
|
2390
|
+
tablePropertyExceptionChanges?: TablePropertyExceptionChange[];
|
|
1507
2391
|
/** Tracked structural changes (row insert/delete) */
|
|
1508
2392
|
structuralChange?: TableStructuralChangeInfo;
|
|
1509
2393
|
/** Cells in this row */
|
|
@@ -1518,7 +2402,7 @@ type TableRow = {
|
|
|
1518
2402
|
* there is no member to be, and `index` counts the cells that preceded the
|
|
1519
2403
|
* capture.
|
|
1520
2404
|
*/
|
|
1521
|
-
preserved?:
|
|
2405
|
+
preserved?: TablePreservedMarkup;
|
|
1522
2406
|
/**
|
|
1523
2407
|
* Attributes `w:tr` carried that this record has no field for.
|
|
1524
2408
|
*
|
|
@@ -1527,6 +2411,39 @@ type TableRow = {
|
|
|
1527
2411
|
* editor creates has none, and a row split off another does not inherit one.
|
|
1528
2412
|
*/
|
|
1529
2413
|
preservedAttributes?: PreservedAttribute[];
|
|
2414
|
+
/**
|
|
2415
|
+
* Bookmark markers `w:tr` held beside its cells, with their position.
|
|
2416
|
+
*
|
|
2417
|
+
* Word writes a bookmark that selects whole rows this way. See
|
|
2418
|
+
* {@link PositionedBookmarkMarker} for why these stay typed instead of
|
|
2419
|
+
* joining {@link TableRow.preserved}.
|
|
2420
|
+
*/
|
|
2421
|
+
bookmarks?: PositionedBookmarkMarker[];
|
|
2422
|
+
/**
|
|
2423
|
+
* The row-level content controls (`CT_SdtRow`) this row sits inside,
|
|
2424
|
+
* outermost first.
|
|
2425
|
+
*
|
|
2426
|
+
* `CT_SdtRow` is transparent: what it holds is ordinary rows, and the
|
|
2427
|
+
* control adds a tag, an alias, a lock, a data binding and an end mark. So
|
|
2428
|
+
* the control is recorded *on* the rows it wrapped rather than as a member
|
|
2429
|
+
* between them — a member would need a node of its own in a table whose
|
|
2430
|
+
* children are rows, and an index would drift the moment a row moved.
|
|
2431
|
+
*
|
|
2432
|
+
* **A control may hold several rows, and then each of them carries the same
|
|
2433
|
+
* record.** `CT_SdtContentRow` admits `w:tr*`; across 5299 public packages
|
|
2434
|
+
* every one of the 23 row-level controls held exactly one row, and the same
|
|
2435
|
+
* for all 329 cell-level ones. The serializer rebuilds a multi-row wrapper
|
|
2436
|
+
* by grouping consecutive rows that name the same control, so the schema's
|
|
2437
|
+
* case survives without a `TableRowGroup` member that the ProseMirror table
|
|
2438
|
+
* schema could not carry. The cost is stated where the grouping is: two
|
|
2439
|
+
* adjacent rows in two separate but identically spelled controls come back
|
|
2440
|
+
* as one.
|
|
2441
|
+
*
|
|
2442
|
+
* The list is a stack because a control may hold a control: a repeating
|
|
2443
|
+
* section whose row is itself bound. Outermost first, as the source wrote
|
|
2444
|
+
* them.
|
|
2445
|
+
*/
|
|
2446
|
+
contentControls?: SdtProperties[];
|
|
1530
2447
|
};
|
|
1531
2448
|
/**
|
|
1532
2449
|
* Table (w:tbl)
|
|
@@ -1553,7 +2470,15 @@ type Table = {
|
|
|
1553
2470
|
* model and are read and written elsewhere, so they are not in the sink and
|
|
1554
2471
|
* the index counts rows only.
|
|
1555
2472
|
*/
|
|
1556
|
-
preserved?:
|
|
2473
|
+
preserved?: TablePreservedMarkup;
|
|
2474
|
+
/**
|
|
2475
|
+
* Bookmark markers `w:tbl` held beside its rows, with their position.
|
|
2476
|
+
*
|
|
2477
|
+
* Word writes a bookmark that selects a whole table this way. See
|
|
2478
|
+
* {@link PositionedBookmarkMarker} for why these stay typed instead of
|
|
2479
|
+
* joining {@link Table.preserved}.
|
|
2480
|
+
*/
|
|
2481
|
+
bookmarks?: PositionedBookmarkMarker[];
|
|
1557
2482
|
};
|
|
1558
2483
|
/**
|
|
1559
2484
|
* A comment (w:comment) from comments.xml
|
|
@@ -1743,10 +2668,22 @@ type BidiControl = (typeof BIDI_CONTROLS)[keyof typeof BIDI_CONTROLS];
|
|
|
1743
2668
|
* Transparent means it says something about its content without constraining
|
|
1744
2669
|
* it: it nests, it may hold anything paragraph content may hold, and dropping
|
|
1745
2670
|
* it changes what the reader sees or what the markup states rather than what
|
|
1746
|
-
* the text is.
|
|
1747
|
-
* custom-XML wrapper are the same shape and land with their parser.
|
|
2671
|
+
* the text is.
|
|
1748
2672
|
*
|
|
1749
|
-
*
|
|
2673
|
+
* The discriminant is what keeps the kinds apart structurally: a smart tag
|
|
2674
|
+
* cannot carry a bidirectional `control`, and a bidirectional wrapper cannot
|
|
2675
|
+
* carry an `element`, because neither branch declares the other's field.
|
|
2676
|
+
*
|
|
2677
|
+
* `smartTag` and `customXml` declare the same three slots because their
|
|
2678
|
+
* content models do, and they are written out rather than shared through a
|
|
2679
|
+
* helper so that the published type says what each kind carries without
|
|
2680
|
+
* naming a second one. They stay separate kinds because they are separate
|
|
2681
|
+
* elements: a smart tag is Word's own recognizer markup and a custom-XML
|
|
2682
|
+
* wrapper is a mapping into a caller's schema.
|
|
2683
|
+
*
|
|
2684
|
+
* - `bidi` is `w:dir` / `w:bdo` — ECMA-376 §17.3.2.8, §17.3.2.3.
|
|
2685
|
+
* - `smartTag` is `w:smartTag` — §17.5.1.9.
|
|
2686
|
+
* - `customXml` is the run-level `w:customXml` — §17.5.1.6.
|
|
1750
2687
|
*/
|
|
1751
2688
|
type InlineWrapper = {
|
|
1752
2689
|
type: "inlineWrapper";
|
|
@@ -1755,6 +2692,32 @@ type InlineWrapper = {
|
|
|
1755
2692
|
/** `w:val`; absent in the source means the wrapper states no direction. */
|
|
1756
2693
|
direction?: "ltr" | "rtl";
|
|
1757
2694
|
content: ParagraphContent[];
|
|
2695
|
+
} | {
|
|
2696
|
+
type: "inlineWrapper";
|
|
2697
|
+
kind: "smartTag";
|
|
2698
|
+
/** `w:element`: the local name of the tagged element. */
|
|
2699
|
+
element: string;
|
|
2700
|
+
/** `w:uri`; absent means the tag names no namespace. */
|
|
2701
|
+
uri?: string;
|
|
2702
|
+
/**
|
|
2703
|
+
* `w:smartTagPr` verbatim: an attribute bag (`w:attr` children) whose
|
|
2704
|
+
* meaning belongs to the producer that wrote it, so folio replays the
|
|
2705
|
+
* bytes rather than modelling them. See
|
|
2706
|
+
* `docs/verbatim-markup-trust-boundary.md` for what that obliges a
|
|
2707
|
+
* writer that builds a document from scratch to check.
|
|
2708
|
+
*/
|
|
2709
|
+
propertiesXml?: string;
|
|
2710
|
+
content: ParagraphContent[];
|
|
2711
|
+
} | {
|
|
2712
|
+
type: "inlineWrapper";
|
|
2713
|
+
kind: "customXml";
|
|
2714
|
+
/** `w:element`: the local name of the tagged element. */
|
|
2715
|
+
element: string;
|
|
2716
|
+
/** `w:uri`; absent means the tag names no namespace. */
|
|
2717
|
+
uri?: string;
|
|
2718
|
+
/** `w:customXmlPr` verbatim; see the `smartTag` branch. */
|
|
2719
|
+
propertiesXml?: string;
|
|
2720
|
+
content: ParagraphContent[];
|
|
1758
2721
|
};
|
|
1759
2722
|
/**
|
|
1760
2723
|
* Move-from range start marker (w:moveFromRangeStart) — ECMA-376 §17.13.5.22
|
|
@@ -1822,6 +2785,22 @@ type TablePropertyChange = {
|
|
|
1822
2785
|
/** Table properties after the tracked change (editor model convenience) */
|
|
1823
2786
|
currentFormatting?: TableFormatting;
|
|
1824
2787
|
};
|
|
2788
|
+
/**
|
|
2789
|
+
* Table property exception change (w:tblPrExChange)
|
|
2790
|
+
*
|
|
2791
|
+
* Its own type rather than a `TablePropertyChange`: it carries the row-legal
|
|
2792
|
+
* subset and is written as a different element in a different container. A
|
|
2793
|
+
* shared discriminator would let one reach the other's serializer.
|
|
2794
|
+
*/
|
|
2795
|
+
type TablePropertyExceptionChange = {
|
|
2796
|
+
type: "tablePropertyExceptionChange";
|
|
2797
|
+
/** Tracked change metadata */
|
|
2798
|
+
info: PropertyChangeInfo;
|
|
2799
|
+
/** Property exceptions before the tracked change */
|
|
2800
|
+
previousFormatting?: TablePropertyExceptionFormatting;
|
|
2801
|
+
/** Property exceptions after the tracked change (editor model convenience) */
|
|
2802
|
+
currentFormatting?: TablePropertyExceptionFormatting;
|
|
2803
|
+
};
|
|
1825
2804
|
/**
|
|
1826
2805
|
* Table row property change (w:trPrChange)
|
|
1827
2806
|
*/
|
|
@@ -1845,6 +2824,16 @@ type TableCellPropertyChange = {
|
|
|
1845
2824
|
previousFormatting?: TableCellFormatting;
|
|
1846
2825
|
/** Cell properties after the tracked change (editor model convenience) */
|
|
1847
2826
|
currentFormatting?: TableCellFormatting;
|
|
2827
|
+
/**
|
|
2828
|
+
* The cell's own insertion, deletion or merge as the snapshot recorded it.
|
|
2829
|
+
*
|
|
2830
|
+
* `CT_TcPrInner` is `CT_TcPrBase` plus `EG_CellMarkupElements`, so the
|
|
2831
|
+
* `w:tcPr` inside a `w:tcPrChange` may carry `w:cellIns`, `w:cellDel` or
|
|
2832
|
+
* `w:cellMerge` — "before this property change, the cell stood inserted".
|
|
2833
|
+
* It is not the cell's current revision, which is
|
|
2834
|
+
* {@link TableCell.structuralChange}, so it rides the change that recorded it.
|
|
2835
|
+
*/
|
|
2836
|
+
previousStructuralChange?: TableStructuralChangeInfo;
|
|
1848
2837
|
};
|
|
1849
2838
|
/**
|
|
1850
2839
|
* Section property change (w:sectPrChange)
|
|
@@ -1863,6 +2852,36 @@ type SectionPropertyChange = {
|
|
|
1863
2852
|
/** Section properties after the tracked change (editor model convenience) */
|
|
1864
2853
|
currentProperties?: SectionProperties;
|
|
1865
2854
|
};
|
|
2855
|
+
/**
|
|
2856
|
+
* Every tracked property revision the model carries: a change element that
|
|
2857
|
+
* stores the complete previous property set beside a {@link PropertyChangeInfo},
|
|
2858
|
+
* so accepting it drops the record and rejecting it restores the set.
|
|
2859
|
+
*
|
|
2860
|
+
* Structural revisions ({@link TrackedRunChange}, {@link ParagraphMarkChange},
|
|
2861
|
+
* {@link TableStructuralChangeInfo}) are deliberately outside it: they add or
|
|
2862
|
+
* remove content rather than restate properties, and they resolve by moving
|
|
2863
|
+
* content rather than by restoring a snapshot.
|
|
2864
|
+
*/
|
|
2865
|
+
type PropertyChange = RunPropertyChange | ParagraphPropertyChange | SectionPropertyChange | TablePropertyChange | TablePropertyExceptionChange | TableRowPropertyChange | TableCellPropertyChange;
|
|
2866
|
+
/** One of {@link PROPERTY_REVISION_KINDS}. */
|
|
2867
|
+
type PropertyRevisionKind = PropertyChange["type"];
|
|
2868
|
+
/**
|
|
2869
|
+
* Runtime census of {@link PropertyChange}'s discriminators.
|
|
2870
|
+
*
|
|
2871
|
+
* It is the one place the set is written down. Every consumer that resolves,
|
|
2872
|
+
* lists or compares a property revision is total over it
|
|
2873
|
+
* (`satisfies Record<PropertyRevisionKind, …>`), so a revision the model gains
|
|
2874
|
+
* is a compile error at each of those sites rather than a branch nobody wrote.
|
|
2875
|
+
*/
|
|
2876
|
+
declare const PROPERTY_REVISION_KINDS: Readonly<{
|
|
2877
|
+
readonly runPropertyChange: "runPropertyChange";
|
|
2878
|
+
readonly paragraphPropertyChange: "paragraphPropertyChange";
|
|
2879
|
+
readonly sectionPropertyChange: "sectionPropertyChange";
|
|
2880
|
+
readonly tablePropertyChange: "tablePropertyChange";
|
|
2881
|
+
readonly tablePropertyExceptionChange: "tablePropertyExceptionChange";
|
|
2882
|
+
readonly tableRowPropertyChange: "tableRowPropertyChange";
|
|
2883
|
+
readonly tableCellPropertyChange: "tableCellPropertyChange";
|
|
2884
|
+
}>;
|
|
1866
2885
|
/**
|
|
1867
2886
|
* Table structural tracked change metadata (row/cell insert/delete/merge)
|
|
1868
2887
|
*/
|
|
@@ -1886,16 +2905,16 @@ type SdtType = "richText" | "plainText" | "date" | "dropdown" | "comboBox" | "ch
|
|
|
1886
2905
|
/**
|
|
1887
2906
|
* SDT properties (`w:sdtPr`).
|
|
1888
2907
|
*
|
|
1889
|
-
*
|
|
1890
|
-
*
|
|
1891
|
-
*
|
|
1892
|
-
* `
|
|
1893
|
-
*
|
|
1894
|
-
*
|
|
1895
|
-
*
|
|
2908
|
+
* The modelled fields are the addressing and interaction surface: a tag, an
|
|
2909
|
+
* alias, a lock, the value a user picked. Everything else the schema declares
|
|
2910
|
+
* — the control-kind element, `w:dataBinding`, `w:label`, `w:tabIndex`,
|
|
2911
|
+
* `w:temporary`, `w:rPr` — and every extension-namespace child a producer
|
|
2912
|
+
* writes are in {@link SdtProperties.preserved}, at the ordinal `CT_SdtPr`'s
|
|
2913
|
+
* sequence gives them. Together the two are the whole element: the serializer
|
|
2914
|
+
* writes both halves and nothing replays the source's bytes whole.
|
|
1896
2915
|
*/
|
|
1897
2916
|
type SdtProperties = {
|
|
1898
|
-
/** SDT type (projection
|
|
2917
|
+
/** SDT type (a projection of the control-kind element the set holds). */
|
|
1899
2918
|
sdtType: SdtType;
|
|
1900
2919
|
/** Numeric id (`w:id/@w:val`). */
|
|
1901
2920
|
id?: number;
|
|
@@ -1937,13 +2956,25 @@ type SdtProperties = {
|
|
|
1937
2956
|
/** Checkbox checked state (`w14:checkbox/w14:checked`). */
|
|
1938
2957
|
checked?: boolean;
|
|
1939
2958
|
/**
|
|
1940
|
-
*
|
|
1941
|
-
*
|
|
1942
|
-
*
|
|
2959
|
+
* The `w:sdtPr` children folio does not model, at their schema ordinal.
|
|
2960
|
+
*
|
|
2961
|
+
* `CT_SdtPr` is an `xsd:sequence`, so the ordinal is the child's position
|
|
2962
|
+
* in it rather than a count of modelled siblings: the count is a mirror of
|
|
2963
|
+
* whichever properties folio models today and it moves under the capture
|
|
2964
|
+
* the moment one more of them is modelled.
|
|
1943
2965
|
*/
|
|
1944
|
-
|
|
2966
|
+
preserved?: PreservedMarkup;
|
|
1945
2967
|
/** Verbatim `<w:sdtEndPr>…</w:sdtEndPr>` captured at parse time. */
|
|
1946
2968
|
rawEndPropertiesXml?: string;
|
|
2969
|
+
/**
|
|
2970
|
+
* `w:sdtEndPr` as a record, beside the bytes above rather than instead of
|
|
2971
|
+
* them.
|
|
2972
|
+
*
|
|
2973
|
+
* The capture is replayed while it exists, and a control folio *rebuilds* —
|
|
2974
|
+
* one an edit touched, one a full repack writes — has no bytes to replay,
|
|
2975
|
+
* so before this the end mark simply disappeared from the saved control.
|
|
2976
|
+
*/
|
|
2977
|
+
endProperties?: SdtEndProperties;
|
|
1947
2978
|
/**
|
|
1948
2979
|
* Verbatim XML for any non-content direct children of `<w:sdt>` that
|
|
1949
2980
|
* appear BEFORE `<w:sdtContent>` — MS-OE376 §2.5.2.30 documents 16
|
|
@@ -1957,6 +2988,19 @@ type SdtProperties = {
|
|
|
1957
2988
|
/** Verbatim XML for non-content sdt children that appear AFTER `<w:sdtContent>`. */
|
|
1958
2989
|
rawSdtChildrenAfterContent?: string;
|
|
1959
2990
|
};
|
|
2991
|
+
/**
|
|
2992
|
+
* `w:sdtEndPr`: what the control's end-of-content mark carries.
|
|
2993
|
+
*
|
|
2994
|
+
* `CT_SdtEndPr` declares `w:rPr` and nothing else, so the record's presence is
|
|
2995
|
+
* the element's and its one field is those run properties. `<w:sdtEndPr/>`
|
|
2996
|
+
* with no `w:rPr` is what Word writes for most controls and says something an
|
|
2997
|
+
* absent element does not, which is why presence is the record rather than a
|
|
2998
|
+
* flag on {@link SdtProperties}.
|
|
2999
|
+
*/
|
|
3000
|
+
type SdtEndProperties = {
|
|
3001
|
+
/** `w:sdtEndPr/w:rPr`, absent when the element declared none. */
|
|
3002
|
+
runProperties?: TextFormatting;
|
|
3003
|
+
};
|
|
1960
3004
|
/**
|
|
1961
3005
|
* Inline SDT (content control within a paragraph).
|
|
1962
3006
|
*
|
|
@@ -1964,13 +3008,21 @@ type SdtProperties = {
|
|
|
1964
3008
|
* tracked insertions/deletions/moves, the bidirectional controls, and math at
|
|
1965
3009
|
* this level. All of them must survive parse → edit → save so docProps-bound
|
|
1966
3010
|
* fields and reviewed template content do not lose their wrapper on round-trip.
|
|
3011
|
+
*
|
|
3012
|
+
* The bookmark boundaries belong here for the reason the revision wrapper's
|
|
3013
|
+
* do: `CT_SdtContentRun` reaches them through
|
|
3014
|
+
* `EG_RunLevelElts > EG_RangeMarkupElements`, and a marker lifted out to a
|
|
3015
|
+
* sibling of the control is a bookmark whose extent has changed. A range that
|
|
3016
|
+
* covered the control's content ends up covering the control and whatever
|
|
3017
|
+
* follows it, so a `REF` field or a link to the bookmark resolves to the
|
|
3018
|
+
* wrong text.
|
|
1967
3019
|
*/
|
|
1968
3020
|
type InlineSdt = {
|
|
1969
3021
|
type: "inlineSdt";
|
|
1970
3022
|
/** SDT properties */
|
|
1971
3023
|
properties: SdtProperties;
|
|
1972
3024
|
/** Inline content held inside the control */
|
|
1973
|
-
content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | InlineWrapper | Insertion | Deletion | MoveFrom | MoveTo | MathEquation | PreservedInline)[];
|
|
3025
|
+
content: (Run | Hyperlink | BookmarkStart | BookmarkEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | Insertion | Deletion | MoveFrom | MoveTo | MathEquation | PreservedInline)[];
|
|
1974
3026
|
};
|
|
1975
3027
|
/**
|
|
1976
3028
|
* Block-level SDT (content control wrapping paragraphs/tables).
|
|
@@ -1981,7 +3033,7 @@ type InlineSdt = {
|
|
|
1981
3033
|
*/
|
|
1982
3034
|
type BlockSdt = {
|
|
1983
3035
|
type: "blockSdt";
|
|
1984
|
-
/** SDT properties
|
|
3036
|
+
/** SDT properties; `properties.preserved` carries what the model does not. */
|
|
1985
3037
|
properties: SdtProperties;
|
|
1986
3038
|
/** Block content inside the control. */
|
|
1987
3039
|
content: BlockContent[];
|
|
@@ -2226,6 +3278,8 @@ type NoteNumberRestart = "continuous" | "eachSect" | "eachPage";
|
|
|
2226
3278
|
type FootnoteProperties = {
|
|
2227
3279
|
position?: FootnotePosition;
|
|
2228
3280
|
numFmt?: NumberFormat;
|
|
3281
|
+
/** `w:numFmt/@w:format`, as authored. */
|
|
3282
|
+
numFmtFormat?: string;
|
|
2229
3283
|
numStart?: number;
|
|
2230
3284
|
numRestart?: NoteNumberRestart;
|
|
2231
3285
|
};
|
|
@@ -2235,6 +3289,8 @@ type FootnoteProperties = {
|
|
|
2235
3289
|
type EndnoteProperties = {
|
|
2236
3290
|
position?: EndnotePosition;
|
|
2237
3291
|
numFmt?: NumberFormat;
|
|
3292
|
+
/** `w:numFmt/@w:format`, as authored. */
|
|
3293
|
+
numFmtFormat?: string;
|
|
2238
3294
|
numStart?: number;
|
|
2239
3295
|
numRestart?: NoteNumberRestart;
|
|
2240
3296
|
};
|
|
@@ -2299,7 +3355,6 @@ type Column = {
|
|
|
2299
3355
|
/**
|
|
2300
3356
|
* Section properties (w:sectPr)
|
|
2301
3357
|
*/
|
|
2302
|
-
type SectionTextDirection = "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | "tbLrV" | "tb" | "rl" | "lr" | "tbV" | "rlV" | "lrV";
|
|
2303
3358
|
type SectionProperties = {
|
|
2304
3359
|
/** Page width in twips */
|
|
2305
3360
|
pageWidth?: number;
|
|
@@ -2335,8 +3390,8 @@ type SectionProperties = {
|
|
|
2335
3390
|
sectionStart?: SectionStart;
|
|
2336
3391
|
/** Vertical alignment of text */
|
|
2337
3392
|
verticalAlign?: VerticalAlign;
|
|
2338
|
-
/** Section text direction */
|
|
2339
|
-
textDirection?:
|
|
3393
|
+
/** Section text direction (`w:sectPr/w:textDirection`) */
|
|
3394
|
+
textDirection?: TextDirection;
|
|
2340
3395
|
/** Right-to-left section */
|
|
2341
3396
|
bidi?: boolean;
|
|
2342
3397
|
/** Header references */
|
|
@@ -2377,7 +3432,7 @@ type SectionProperties = {
|
|
|
2377
3432
|
/** Page background */
|
|
2378
3433
|
background?: {
|
|
2379
3434
|
color?: ColorValue;
|
|
2380
|
-
themeColor?:
|
|
3435
|
+
themeColor?: ThemeColorValue;
|
|
2381
3436
|
themeTint?: string;
|
|
2382
3437
|
themeShade?: string;
|
|
2383
3438
|
};
|
|
@@ -2407,6 +3462,8 @@ type SectionProperties = {
|
|
|
2407
3462
|
printerSettingsRelationshipId?: string;
|
|
2408
3463
|
/** Section-level tracked property changes (w:sectPrChange) */
|
|
2409
3464
|
propertyChanges?: SectionPropertyChange[];
|
|
3465
|
+
/** The `w:sectPr` children no reader took a typed value from. */
|
|
3466
|
+
preserved?: PreservedMarkup;
|
|
2410
3467
|
/**
|
|
2411
3468
|
* Attributes `w:sectPr` carried that this record has no field for.
|
|
2412
3469
|
*
|
|
@@ -2439,8 +3496,23 @@ type PreservedBlock = {
|
|
|
2439
3496
|
};
|
|
2440
3497
|
/**
|
|
2441
3498
|
* Block-level content types
|
|
2442
|
-
|
|
2443
|
-
|
|
3499
|
+
*
|
|
3500
|
+
* `BookmarkStart` and `BookmarkEnd` are members here as well as in
|
|
3501
|
+
* {@link ParagraphContent}, because `CT_Body`, `CT_Tc` and
|
|
3502
|
+
* `CT_SdtContentBlock` each declare them beside their blocks and Word writes
|
|
3503
|
+
* them there: `_GoBack` on the body, a form field's range on the cell, a
|
|
3504
|
+
* table-of-contents range around the blocks it covers. The marker is the same
|
|
3505
|
+
* element at either level, so it is the same model type, read and written by
|
|
3506
|
+
* the same parser and serializer.
|
|
3507
|
+
*
|
|
3508
|
+
* It is a member rather than a capture for a reason the two levels share.
|
|
3509
|
+
* A bookmark is a pair, and folio's pairing passes — `collectPairedBookmarkIds`
|
|
3510
|
+
* on the way in, the boundary integrity plugin on the way back — can only see a
|
|
3511
|
+
* marker the model holds. Keeping the block-level half as opaque bytes leaves
|
|
3512
|
+
* the paragraph-level half unpaired, and an unpaired boundary is deleted: the
|
|
3513
|
+
* bookmark would not merely move, it would go.
|
|
3514
|
+
*/
|
|
3515
|
+
type BlockContent = Paragraph | Table | BlockSdt | PreservedBlock | BookmarkStart | BookmarkEnd;
|
|
2444
3516
|
/** {@link BlockContent} minus the branch folio does not model inside a cell. */
|
|
2445
3517
|
type TableCellBlock = Exclude<BlockContent, BlockSdt>;
|
|
2446
3518
|
/**
|
|
@@ -2526,8 +3598,14 @@ declare const PARSE_WARNING_CODES: {
|
|
|
2526
3598
|
readonly headerFooterTypeOutsideEnum: "header-footer-type-outside-enum";
|
|
2527
3599
|
/** A value outside `ST_OnOff`'s six spellings. */
|
|
2528
3600
|
readonly unrecognisedOnOffValue: "unrecognised-on-off-value";
|
|
3601
|
+
/** A theme-colour token outside `ST_ThemeColor`, kept but not painted. */
|
|
3602
|
+
readonly unrecognisedThemeColor: "unrecognised-theme-color";
|
|
2529
3603
|
/** A `CT_Border` with no `w:val`, which has no border style to read. */
|
|
2530
3604
|
readonly borderWithoutValue: "border-without-value";
|
|
3605
|
+
/** A `w:val` outside `ST_Border`, kept verbatim rather than read as a style. */
|
|
3606
|
+
readonly borderStyleOutsideEnum: "border-style-outside-enum";
|
|
3607
|
+
/** An `a:prstDash@val` outside `ST_PresetLineDashVal`, kept verbatim. */
|
|
3608
|
+
readonly outlineDashOutsideEnum: "outline-dash-outside-enum";
|
|
2531
3609
|
/** A style set defining two styles under one id. */
|
|
2532
3610
|
readonly styleSetDuplicateStyleId: "style-set-duplicate-style-id";
|
|
2533
3611
|
/** A style set naming an initial paragraph style it does not contain. */
|
|
@@ -2714,6 +3792,33 @@ type Theme = {
|
|
|
2714
3792
|
name?: string;
|
|
2715
3793
|
};
|
|
2716
3794
|
};
|
|
3795
|
+
/**
|
|
3796
|
+
* `w:charset`: the code page a font is encoded in, numbered and named.
|
|
3797
|
+
*
|
|
3798
|
+
* Two attributes of one element rather than two fields on the font, because
|
|
3799
|
+
* `w:charset` is the thing that carries both and a producer may write either.
|
|
3800
|
+
*/
|
|
3801
|
+
type FontCharset = {
|
|
3802
|
+
/** `w:val`: the code page as a two-digit hexadecimal number. */
|
|
3803
|
+
val?: string;
|
|
3804
|
+
/** `w:characterSet`: the same set named (`ANSI_CHARSET`) rather than numbered. */
|
|
3805
|
+
characterSet?: string;
|
|
3806
|
+
};
|
|
3807
|
+
/**
|
|
3808
|
+
* One embedded face: the relationship to its binary and how to read it.
|
|
3809
|
+
*
|
|
3810
|
+
* The relationship id alone is not enough to use the face. `w:fontKey` is the
|
|
3811
|
+
* GUID the `.odttf` is obfuscated with, so a package that keeps the id and
|
|
3812
|
+
* drops the key keeps a pointer to bytes nothing can decode.
|
|
3813
|
+
*/
|
|
3814
|
+
type EmbeddedFontRef = {
|
|
3815
|
+
/** `r:id` of the relationship to the font binary, in `word/_rels/fontTable.xml.rels`. */
|
|
3816
|
+
id: string;
|
|
3817
|
+
/** `w:fontKey`: the obfuscation GUID, e.g. `{XXXXXXXX-…}`. */
|
|
3818
|
+
fontKey?: string;
|
|
3819
|
+
/** `w:subsetted`: the embedded face carries only the glyphs the document uses. */
|
|
3820
|
+
subsetted?: boolean;
|
|
3821
|
+
};
|
|
2717
3822
|
/**
|
|
2718
3823
|
* Font info from fontTable.xml
|
|
2719
3824
|
*/
|
|
@@ -2725,7 +3830,7 @@ type FontInfo = {
|
|
|
2725
3830
|
/** Panose-1 classification */
|
|
2726
3831
|
panose1?: string;
|
|
2727
3832
|
/** Character set */
|
|
2728
|
-
charset?:
|
|
3833
|
+
charset?: FontCharset;
|
|
2729
3834
|
/** Font family type */
|
|
2730
3835
|
family?: "decorative" | "modern" | "roman" | "script" | "swiss" | "auto";
|
|
2731
3836
|
/** Pitch (fixed or variable) */
|
|
@@ -2740,16 +3845,30 @@ type FontInfo = {
|
|
|
2740
3845
|
csb1?: string;
|
|
2741
3846
|
};
|
|
2742
3847
|
/** Embedded font data reference */
|
|
2743
|
-
embedRegular?:
|
|
2744
|
-
embedBold?:
|
|
2745
|
-
embedItalic?:
|
|
2746
|
-
embedBoldItalic?:
|
|
3848
|
+
embedRegular?: EmbeddedFontRef;
|
|
3849
|
+
embedBold?: EmbeddedFontRef;
|
|
3850
|
+
embedItalic?: EmbeddedFontRef;
|
|
3851
|
+
embedBoldItalic?: EmbeddedFontRef;
|
|
3852
|
+
/** Children of `w:font` the model does not hold, in source position. */
|
|
3853
|
+
preserved?: PreservedMarkup;
|
|
3854
|
+
/** Attributes of `w:font` the model has no field for. */
|
|
3855
|
+
preservedAttributes?: PreservedAttribute[];
|
|
2747
3856
|
};
|
|
2748
3857
|
/**
|
|
2749
3858
|
* Font table from fontTable.xml
|
|
2750
3859
|
*/
|
|
2751
3860
|
type FontTable = {
|
|
2752
3861
|
fonts: FontInfo[];
|
|
3862
|
+
/** Children of `w:fonts` that are not `w:font`, in source position. */
|
|
3863
|
+
preserved?: PreservedMarkup;
|
|
3864
|
+
/**
|
|
3865
|
+
* Attributes of `w:fonts` the model has no field for.
|
|
3866
|
+
*
|
|
3867
|
+
* Not the namespace declarations and not `mc:Ignorable`: a rebuilt part
|
|
3868
|
+
* binds the prefixes its own body uses and states which of them are
|
|
3869
|
+
* ignorable, so replaying the source's would name prefixes nothing binds.
|
|
3870
|
+
*/
|
|
3871
|
+
preservedAttributes?: PreservedAttribute[];
|
|
2753
3872
|
};
|
|
2754
3873
|
/**
|
|
2755
3874
|
* Relationship type
|
|
@@ -2945,4 +4064,4 @@ type Document = {
|
|
|
2945
4064
|
parseWarnings?: ParseWarning[];
|
|
2946
4065
|
};
|
|
2947
4066
|
//#endregion
|
|
2948
|
-
export {
|
|
4067
|
+
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 };
|