@betteroffice/docx 0.0.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/LICENSE +201 -0
- package/README.md +41 -0
- package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
- package/dist/agent/index.d.mts +531 -0
- package/dist/agent/index.mjs +1 -0
- package/dist/chunk-34K66SY4.mjs +1 -0
- package/dist/chunk-3UBMCDME.mjs +1 -0
- package/dist/chunk-4RCISPPE.mjs +1 -0
- package/dist/chunk-4UD54UM5.mjs +1 -0
- package/dist/chunk-52GB3Y42.mjs +1 -0
- package/dist/chunk-6NEKRDXF.mjs +1 -0
- package/dist/chunk-6PW4CWUG.mjs +1 -0
- package/dist/chunk-7DEIW7FL.mjs +1 -0
- package/dist/chunk-7PCO5I2O.mjs +1 -0
- package/dist/chunk-BI3B33LI.mjs +1 -0
- package/dist/chunk-BIQWVK5P.mjs +2 -0
- package/dist/chunk-CIRN3LZA.mjs +1 -0
- package/dist/chunk-DXKG3HQ5.mjs +16 -0
- package/dist/chunk-EUUIJVM6.mjs +0 -0
- package/dist/chunk-FPZBTOD6.mjs +1 -0
- package/dist/chunk-FZIA7OFY.mjs +1 -0
- package/dist/chunk-GWKJ2Y4Y.mjs +1 -0
- package/dist/chunk-H3JCIGWK.mjs +1 -0
- package/dist/chunk-HJGAQIU7.mjs +2 -0
- package/dist/chunk-I6KKMUUC.mjs +1 -0
- package/dist/chunk-IL5JZJT7.mjs +1 -0
- package/dist/chunk-JY6ILTNS.mjs +1 -0
- package/dist/chunk-KEE52TT5.mjs +1 -0
- package/dist/chunk-KVKLLTDP.mjs +58 -0
- package/dist/chunk-KXNZFTTK.mjs +1 -0
- package/dist/chunk-L5ISVQ3W.mjs +1 -0
- package/dist/chunk-LDUWIM7M.mjs +1 -0
- package/dist/chunk-N5Q3YN64.mjs +1 -0
- package/dist/chunk-NEWOMDTX.mjs +1 -0
- package/dist/chunk-O2QSE2I7.mjs +1 -0
- package/dist/chunk-OBQGPMPQ.mjs +1 -0
- package/dist/chunk-OJOHXQNQ.mjs +1 -0
- package/dist/chunk-OMR3TWCD.mjs +2 -0
- package/dist/chunk-P3KDV4M2.mjs +1 -0
- package/dist/chunk-Q7PO7V73.mjs +1 -0
- package/dist/chunk-QOUFE3VX.mjs +1 -0
- package/dist/chunk-SINEY6ZF.mjs +1 -0
- package/dist/chunk-T4EZMUXM.mjs +1 -0
- package/dist/chunk-TTRUPDAB.mjs +1 -0
- package/dist/chunk-TYHI7RAD.mjs +1 -0
- package/dist/chunk-UIEJWORW.mjs +1 -0
- package/dist/chunk-VAOUFAUH.mjs +1 -0
- package/dist/chunk-VBOTMRXV.mjs +1 -0
- package/dist/chunk-VCER63GQ.mjs +1 -0
- package/dist/chunk-WAUF2UC7.mjs +2 -0
- package/dist/chunk-WRWRCBLK.mjs +1 -0
- package/dist/chunk-X4XDO3LZ.mjs +1 -0
- package/dist/chunk-XQBCCJBO.mjs +9 -0
- package/dist/chunk-XWUOLYRQ.mjs +2 -0
- package/dist/chunk-XYH6XWP3.mjs +10 -0
- package/dist/chunk-YBIM6UJV.mjs +8 -0
- package/dist/chunk-YCIH2Q3E.mjs +1 -0
- package/dist/chunk-YUOKI2HB.mjs +1 -0
- package/dist/chunk-ZOV5KL7C.mjs +1 -0
- package/dist/colorResolver-n0o7H7ep.d.mts +290 -0
- package/dist/content-sSHuWw49.d.mts +2202 -0
- package/dist/core-plugins.d.mts +37 -0
- package/dist/core-plugins.mjs +1 -0
- package/dist/core.d.mts +451 -0
- package/dist/core.mjs +1 -0
- package/dist/displayListQueries-p-ijSzdh.d.mts +222 -0
- package/dist/docx/index.d.mts +618 -0
- package/dist/docx/index.mjs +2 -0
- package/dist/docx/parser.d.mts +41 -0
- package/dist/docx/parser.mjs +1 -0
- package/dist/docx/rezip.d.mts +148 -0
- package/dist/docx/rezip.mjs +1 -0
- package/dist/docx/serializer/index.d.mts +42 -0
- package/dist/docx/serializer/index.mjs +1 -0
- package/dist/docx/wrapTypes.d.mts +19 -0
- package/dist/docx/wrapTypes.mjs +1 -0
- package/dist/docxInput-DTbCa48g.d.mts +21 -0
- package/dist/editor/index.d.mts +170 -0
- package/dist/editor/index.mjs +1 -0
- package/dist/editorTree-DO5PyDK8.d.mts +37 -0
- package/dist/executor-7O2RBJ2B.mjs +1 -0
- package/dist/fontLoader-Bx6DK6-2.d.mts +327 -0
- package/dist/formatting-DoL7KBSL.d.mts +823 -0
- package/dist/generated/edit/docx_edit_bg.wasm +0 -0
- package/dist/generated/layout/docx_layout_bg.wasm +0 -0
- package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
- package/dist/generated/parse/docx_parse_bg.wasm +0 -0
- package/dist/headerFooterLayout-0zPT64Qc.d.mts +316 -0
- package/dist/headless.d.mts +69 -0
- package/dist/headless.mjs +1 -0
- package/dist/layout/flow/index.d.mts +149 -0
- package/dist/layout/flow/index.mjs +1 -0
- package/dist/layout/index.d.mts +307 -0
- package/dist/layout/index.mjs +1 -0
- package/dist/layout/measure/index.d.mts +324 -0
- package/dist/layout/measure/index.mjs +1 -0
- package/dist/layout/pagination/index.d.mts +60 -0
- package/dist/layout/pagination/index.mjs +1 -0
- package/dist/layout/pagination/types.d.mts +4 -0
- package/dist/layout/pagination/types.mjs +1 -0
- package/dist/layout/render/index.d.mts +733 -0
- package/dist/layout/render/index.mjs +1 -0
- package/dist/loadWasmAsset-CMvnVkfA.d.mts +3 -0
- package/dist/managers/AutoSaveManager.d.mts +81 -0
- package/dist/managers/AutoSaveManager.mjs +1 -0
- package/dist/managers/TableSelectionManager.d.mts +74 -0
- package/dist/managers/TableSelectionManager.mjs +1 -0
- package/dist/managers/types.d.mts +113 -0
- package/dist/managers/types.mjs +0 -0
- package/dist/mcp-cli.mjs +142 -0
- package/dist/mcp.d.mts +162 -0
- package/dist/mcp.mjs +16 -0
- package/dist/measureBlocksPipeline-Df0Bbrwy.d.mts +109 -0
- package/dist/measuredBlock-DZwz8zhD.d.mts +26 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +114 -0
- package/dist/plugin-api/RenderedDomContext.mjs +1 -0
- package/dist/plugin-api/index.d.mts +7 -0
- package/dist/plugin-api/index.mjs +0 -0
- package/dist/plugin-api/resolveItemPositions.d.mts +39 -0
- package/dist/plugin-api/resolveItemPositions.mjs +1 -0
- package/dist/plugin-api/types.d.mts +193 -0
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-HDUIZFJ5.mjs +1 -0
- package/dist/registry-DMM5VTdT.d.mts +165 -0
- package/dist/rustDisplayList-dqunvwxH.d.mts +1036 -0
- package/dist/rustPagination-Bj2hq013.d.mts +106 -0
- package/dist/sectionConfigs-DW3J8q0X.d.mts +55 -0
- package/dist/selectionContext-Buc9BCU1.d.mts +570 -0
- package/dist/selectiveSave-oFBJ1n71.d.mts +16 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
- package/dist/settingsParser-CcGvtmCK.d.mts +33 -0
- package/dist/styles/index.d.mts +162 -0
- package/dist/styles/index.mjs +1 -0
- package/dist/styles-VxNcXLdi.d.mts +189 -0
- package/dist/types/agentApi.d.mts +456 -0
- package/dist/types/agentApi.mjs +1 -0
- package/dist/types/content.d.mts +3 -0
- package/dist/types/content.mjs +1 -0
- package/dist/types/document.d.mts +117 -0
- package/dist/types/document.mjs +1 -0
- package/dist/types-DNrYr6yQ.d.mts +1754 -0
- package/dist/types-dYdjUZMo.d.mts +311 -0
- package/dist/units-O5Y02RKQ.d.mts +34 -0
- package/dist/utils/autoScroll.d.mts +24 -0
- package/dist/utils/autoScroll.mjs +1 -0
- package/dist/utils/cardStyles.d.mts +22 -0
- package/dist/utils/cardStyles.mjs +1 -0
- package/dist/utils/comments.d.mts +120 -0
- package/dist/utils/comments.mjs +4 -0
- package/dist/utils/findReplace.d.mts +114 -0
- package/dist/utils/findReplace.mjs +2 -0
- package/dist/utils/findVerticalScrollParent.d.mts +25 -0
- package/dist/utils/findVerticalScrollParent.mjs +1 -0
- package/dist/utils/fontOptions.d.mts +21 -0
- package/dist/utils/fontOptions.mjs +1 -0
- package/dist/utils/headingCollector.d.mts +28 -0
- package/dist/utils/headingCollector.mjs +1 -0
- package/dist/utils/highlightColors.d.mts +14 -0
- package/dist/utils/highlightColors.mjs +1 -0
- package/dist/utils/index.d.mts +956 -0
- package/dist/utils/index.mjs +84 -0
- package/dist/utils/listState.d.mts +27 -0
- package/dist/utils/listState.mjs +1 -0
- package/dist/utils/reportIssue.d.mts +23 -0
- package/dist/utils/reportIssue.mjs +2 -0
- package/dist/utils/sidebarConstants.d.mts +10 -0
- package/dist/utils/sidebarConstants.mjs +1 -0
- package/dist/utils/stylePreview.d.mts +70 -0
- package/dist/utils/stylePreview.mjs +1 -0
- package/dist/utils/textSelection.d.mts +92 -0
- package/dist/utils/textSelection.mjs +1 -0
- package/dist/utils/units.d.mts +78 -0
- package/dist/utils/units.mjs +1 -0
- package/dist/variableDetector-Borj29SF.d.mts +115 -0
- package/dist/wasm-FZQ5XB2Y.mjs +1 -0
- package/dist/wasm-SA237OSP.mjs +1 -0
- package/dist/wasm-edit.d.mts +473 -0
- package/dist/wasm-edit.mjs +1 -0
- package/dist/wasm-layout.d.mts +112 -0
- package/dist/wasm-layout.mjs +1 -0
- package/dist/wasm-opc.d.mts +16 -0
- package/dist/wasm-opc.mjs +1 -0
- package/dist/wasm-parse.d.mts +18 -0
- package/dist/wasm-parse.mjs +1 -0
- package/dist/watermarkApi-DCxjutkg.d.mts +38 -0
- package/dist/yrs/index.d.mts +882 -0
- package/dist/yrs/index.mjs +1 -0
- package/dist/yrs/residentEngineWorker.d.mts +2 -0
- package/dist/yrs/residentEngineWorker.mjs +1 -0
- package/package.json +365 -0
|
@@ -0,0 +1,823 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme parsing — colors and fonts from a DrawingML theme part
|
|
3
|
+
* (e.g. word/theme/theme1.xml, ppt/theme/theme1.xml).
|
|
4
|
+
*
|
|
5
|
+
* Extracts color scheme (dk1, lt1, dk2, lt2, accent1-6, hlink, folHlink)
|
|
6
|
+
* and font scheme (majorFont, minorFont) from the theme.
|
|
7
|
+
*
|
|
8
|
+
* OOXML Reference:
|
|
9
|
+
* - Uses DrawingML namespace (a:)
|
|
10
|
+
* - Colors can be srgbClr, sysClr, or schemeClr
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Theme color scheme (a:clrScheme)
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
interface ThemeColorScheme {
|
|
19
|
+
/** Dark 1 color (usually black) */
|
|
20
|
+
dk1?: string;
|
|
21
|
+
/** Light 1 color (usually white) */
|
|
22
|
+
lt1?: string;
|
|
23
|
+
/** Dark 2 color */
|
|
24
|
+
dk2?: string;
|
|
25
|
+
/** Light 2 color */
|
|
26
|
+
lt2?: string;
|
|
27
|
+
/** Accent colors 1-6 */
|
|
28
|
+
accent1?: string;
|
|
29
|
+
accent2?: string;
|
|
30
|
+
accent3?: string;
|
|
31
|
+
accent4?: string;
|
|
32
|
+
accent5?: string;
|
|
33
|
+
accent6?: string;
|
|
34
|
+
/** Hyperlink color */
|
|
35
|
+
hlink?: string;
|
|
36
|
+
/** Followed hyperlink color */
|
|
37
|
+
folHlink?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Theme font (with script variants)
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
interface ThemeFont {
|
|
45
|
+
/** Latin font */
|
|
46
|
+
latin?: string;
|
|
47
|
+
/** East Asian font */
|
|
48
|
+
ea?: string;
|
|
49
|
+
/** Complex script font */
|
|
50
|
+
cs?: string;
|
|
51
|
+
/** Script-specific fonts */
|
|
52
|
+
fonts?: Record<string, string>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Theme font scheme (a:fontScheme)
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
interface ThemeFontScheme {
|
|
60
|
+
/** Major font (headings) */
|
|
61
|
+
majorFont?: ThemeFont;
|
|
62
|
+
/** Minor font (body text) */
|
|
63
|
+
minorFont?: ThemeFont;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Theme (from a theme1.xml part)
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
interface Theme {
|
|
71
|
+
/** Theme name */
|
|
72
|
+
name?: string;
|
|
73
|
+
/** Color scheme */
|
|
74
|
+
colorScheme?: ThemeColorScheme;
|
|
75
|
+
/** Font scheme */
|
|
76
|
+
fontScheme?: ThemeFontScheme;
|
|
77
|
+
/** Format scheme (fills, lines, effects) - simplified */
|
|
78
|
+
formatScheme?: {
|
|
79
|
+
name?: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Color primitives and math shared across OOXML formats.
|
|
85
|
+
*
|
|
86
|
+
* Handles theme color slot references (accent1, dk1, ...), RGB hex values,
|
|
87
|
+
* tint/shade modifiers, and the derived color helpers (lighten/darken/blend/
|
|
88
|
+
* contrast) built on top of them.
|
|
89
|
+
*
|
|
90
|
+
* Tint/Shade Calculations (ECMA-376 §17.3.2.41):
|
|
91
|
+
* - Tint makes a color lighter (per-channel interpolation toward white)
|
|
92
|
+
* - Shade makes a color darker (per-channel interpolation toward black)
|
|
93
|
+
* - The wire value is a hex byte (00-FF) meaning "how much color to keep"
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Theme color slots from a theme's clrScheme (plus the WordprocessingML
|
|
98
|
+
* alias slots background1/text1/background2/text2).
|
|
99
|
+
*
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
type ThemeColorSlot = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'background1' | 'text1' | 'background2' | 'text2';
|
|
103
|
+
/**
|
|
104
|
+
* ECMA-376 color reference — either a direct RGB hex, a theme slot
|
|
105
|
+
* reference (with optional tint/shade), or `auto` for context-dependent
|
|
106
|
+
* defaults (usually black for text on light backgrounds). When both
|
|
107
|
+
* `rgb` and `themeColor` are set, the theme wins on Word import and the
|
|
108
|
+
* `rgb` acts as a fallback for renderers without theme support.
|
|
109
|
+
*
|
|
110
|
+
* See ECMA-376 §17.18.39 (`ST_ThemeColor`).
|
|
111
|
+
*
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
interface ColorValue {
|
|
115
|
+
/** RGB hex value without # (e.g., "FF0000") */
|
|
116
|
+
rgb?: string;
|
|
117
|
+
/** Theme color slot reference */
|
|
118
|
+
themeColor?: ThemeColorSlot;
|
|
119
|
+
/** Tint modifier (0-255 as hex string, e.g., "80") - makes color lighter */
|
|
120
|
+
themeTint?: string;
|
|
121
|
+
/** Shade modifier (0-255 as hex string) - makes color darker */
|
|
122
|
+
themeShade?: string;
|
|
123
|
+
/** Auto color - context-dependent (usually black for text) */
|
|
124
|
+
auto?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Resolve a ColorValue to a CSS color string
|
|
128
|
+
*
|
|
129
|
+
* @param color - ColorValue object with rgb, themeColor, tint/shade, or auto
|
|
130
|
+
* @param theme - Theme for resolving theme colors
|
|
131
|
+
* @param defaultColor - Default color if auto or undefined (default: black)
|
|
132
|
+
* @returns CSS color string (e.g., "#FF0000" or "inherit")
|
|
133
|
+
*
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
declare function resolveColor(color: ColorValue | undefined | null, theme: Theme | null | undefined, defaultColor?: string): string;
|
|
137
|
+
/**
|
|
138
|
+
* Resolve any ColorValue (text, fill/shading, border, underline) to a 6-char
|
|
139
|
+
* uppercase hex string — or `undefined` if transparent/unset/unresolvable.
|
|
140
|
+
*
|
|
141
|
+
* Shared display-side resolver. Prefer this over reading `.rgb` directly so
|
|
142
|
+
* that `themeColor` + `themeTint`/`themeShade` are honored consistently across
|
|
143
|
+
* all render paths.
|
|
144
|
+
*
|
|
145
|
+
* When a themed color is present but `theme` is null/undefined, falls back to
|
|
146
|
+
* `color.rgb` if Word wrote one for compat; otherwise returns `undefined`.
|
|
147
|
+
*
|
|
148
|
+
* @returns 6-char uppercase hex without `#`, or `undefined`.
|
|
149
|
+
*
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
declare function resolveColorToHex(color: ColorValue | undefined | null, theme: Theme | null | undefined): string | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* Get contrasting text color for a background
|
|
155
|
+
*
|
|
156
|
+
* @param backgroundColor - Background ColorValue
|
|
157
|
+
* @param theme - Theme for resolving theme colors
|
|
158
|
+
* @returns Black or white hex color for best contrast
|
|
159
|
+
*
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
declare function getContrastingColor(backgroundColor: ColorValue | undefined | null, theme: Theme | null | undefined): string;
|
|
163
|
+
/**
|
|
164
|
+
* Darken a color by a percentage
|
|
165
|
+
*
|
|
166
|
+
* @param color - ColorValue to darken
|
|
167
|
+
* @param theme - Theme for resolving
|
|
168
|
+
* @param percent - Percentage to darken (0-100)
|
|
169
|
+
* @returns CSS color string
|
|
170
|
+
*
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
declare function darkenColor(color: ColorValue | undefined | null, theme: Theme | null | undefined, percent: number): string;
|
|
174
|
+
/**
|
|
175
|
+
* Lighten a color by a percentage
|
|
176
|
+
*
|
|
177
|
+
* @param color - ColorValue to lighten
|
|
178
|
+
* @param theme - Theme for resolving
|
|
179
|
+
* @param percent - Percentage to lighten (0-100)
|
|
180
|
+
* @returns CSS color string
|
|
181
|
+
*
|
|
182
|
+
* @public
|
|
183
|
+
*/
|
|
184
|
+
declare function lightenColor(color: ColorValue | undefined | null, theme: Theme | null | undefined, percent: number): string;
|
|
185
|
+
/**
|
|
186
|
+
* Blend two colors together
|
|
187
|
+
*
|
|
188
|
+
* @param color1 - First color
|
|
189
|
+
* @param color2 - Second color
|
|
190
|
+
* @param ratio - Blend ratio (0 = all color1, 1 = all color2)
|
|
191
|
+
* @param theme - Theme for resolving
|
|
192
|
+
* @returns CSS color string
|
|
193
|
+
*
|
|
194
|
+
* @public
|
|
195
|
+
*/
|
|
196
|
+
declare function blendColors(color1: ColorValue | undefined | null, color2: ColorValue | undefined | null, ratio: number, theme: Theme | null | undefined): string;
|
|
197
|
+
/**
|
|
198
|
+
* Theme color matrix cell
|
|
199
|
+
*
|
|
200
|
+
* @public
|
|
201
|
+
*/
|
|
202
|
+
interface ThemeMatrixCell {
|
|
203
|
+
/** Resolved hex color (6 chars, no #) */
|
|
204
|
+
hex: string;
|
|
205
|
+
/** Theme color slot */
|
|
206
|
+
themeSlot: ThemeColorSlot;
|
|
207
|
+
/** Tint hex modifier if applicable (e.g., "CC") */
|
|
208
|
+
tint?: string;
|
|
209
|
+
/** Shade hex modifier if applicable (e.g., "BF") */
|
|
210
|
+
shade?: string;
|
|
211
|
+
/** Human-readable label (e.g., "Accent 1, Lighter 60%") */
|
|
212
|
+
label: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Compute a single tinted or shaded hex color from a base color.
|
|
216
|
+
*
|
|
217
|
+
* @param baseHex - 6-character hex color (no #)
|
|
218
|
+
* @param type - 'tint' to lighten, 'shade' to darken
|
|
219
|
+
* @param fraction - Amount (0-1). For tint: 0=no change, 1=white. For shade: 0=black, 1=no change.
|
|
220
|
+
* @returns 6-character hex color (no #)
|
|
221
|
+
*
|
|
222
|
+
* @public
|
|
223
|
+
*/
|
|
224
|
+
declare function getThemeTintShadeHex(baseHex: string, type: 'tint' | 'shade', fraction: number): string;
|
|
225
|
+
/**
|
|
226
|
+
* Generate the 10×6 theme color matrix for an advanced color picker.
|
|
227
|
+
*
|
|
228
|
+
* Columns: lt1, dk1, lt2, dk2, accent1-6 (matches Word's order)
|
|
229
|
+
* Rows: base, 80% tint, 60% tint, 40% tint, 25% shade, 50% shade
|
|
230
|
+
*
|
|
231
|
+
* @param colorScheme - Theme color scheme (falls back to Office 2016 defaults)
|
|
232
|
+
* @returns 6 rows × 10 columns of ThemeMatrixCell
|
|
233
|
+
*
|
|
234
|
+
* @public
|
|
235
|
+
*/
|
|
236
|
+
declare function generateThemeTintShadeMatrix(colorScheme?: ThemeColorScheme | null): ThemeMatrixCell[][];
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Color & Styling Primitives
|
|
240
|
+
*
|
|
241
|
+
* Basic types used throughout OOXML for colors, borders, and shading.
|
|
242
|
+
* The color primitives (ColorValue, ThemeColorSlot) are shared across OOXML
|
|
243
|
+
* formats; the WordprocessingML border/shading types stay here.
|
|
244
|
+
*/
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* One side of a border — style, color, width, spacing. Used by paragraph
|
|
248
|
+
* borders, table borders (per-cell or whole-table), and page borders.
|
|
249
|
+
* `size` is in eighths of a point (Word's wire format); `space` is in
|
|
250
|
+
* points.
|
|
251
|
+
*
|
|
252
|
+
* See ECMA-376 §17.18.2 (`ST_Border`).
|
|
253
|
+
*/
|
|
254
|
+
interface BorderSpec {
|
|
255
|
+
/** Border style */
|
|
256
|
+
style: 'none' | 'single' | 'double' | 'dotted' | 'dashed' | 'thick' | 'triple' | 'thinThickSmallGap' | 'thickThinSmallGap' | 'thinThickMediumGap' | 'thickThinMediumGap' | 'thinThickLargeGap' | 'thickThinLargeGap' | 'wave' | 'doubleWave' | 'dashSmallGap' | 'dashDotStroked' | 'threeDEmboss' | 'threeDEngrave' | 'outset' | 'inset' | 'nil';
|
|
257
|
+
/** Color of the border */
|
|
258
|
+
color?: ColorValue;
|
|
259
|
+
/** Width in eighths of a point (1/8 pt) */
|
|
260
|
+
size?: number;
|
|
261
|
+
/** Spacing from text in points */
|
|
262
|
+
space?: number;
|
|
263
|
+
/** Shadow effect */
|
|
264
|
+
shadow?: boolean;
|
|
265
|
+
/** Frame effect */
|
|
266
|
+
frame?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Relationship id for relationship-backed border art. Undefined means a
|
|
269
|
+
* normal line border; renderers must not fetch external relationships.
|
|
270
|
+
*/
|
|
271
|
+
relationshipId?: string;
|
|
272
|
+
/** Optional authored art/corner token retained when `style` is approximated. */
|
|
273
|
+
artName?: string;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Cell/paragraph/run shading — Word's combined "fill + pattern overlay"
|
|
277
|
+
* model. `fill` is the solid background; `color` is the pattern overlay
|
|
278
|
+
* drawn on top; `pattern` selects the pattern type (defaults to
|
|
279
|
+
* `'clear'` = solid `fill`, no pattern).
|
|
280
|
+
*
|
|
281
|
+
* See ECMA-376 §17.4.32 (`CT_Shd`).
|
|
282
|
+
*/
|
|
283
|
+
interface ShadingProperties {
|
|
284
|
+
/** Pattern fill color */
|
|
285
|
+
color?: ColorValue;
|
|
286
|
+
/** Background fill color */
|
|
287
|
+
fill?: ColorValue;
|
|
288
|
+
/** Shading pattern type */
|
|
289
|
+
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';
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Text, Paragraph, and Table Formatting Types
|
|
294
|
+
*
|
|
295
|
+
* Properties that control how text, paragraphs, and table structures
|
|
296
|
+
* are formatted in OOXML (w:rPr, w:pPr, w:tblPr, etc.).
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Underline style options
|
|
301
|
+
*/
|
|
302
|
+
type UnderlineStyle = 'none' | 'single' | 'words' | 'double' | 'thick' | 'dotted' | 'dottedHeavy' | 'dash' | 'dashedHeavy' | 'dashLong' | 'dashLongHeavy' | 'dotDash' | 'dashDotHeavy' | 'dotDotDash' | 'dashDotDotHeavy' | 'wave' | 'wavyHeavy' | 'wavyDouble';
|
|
303
|
+
/**
|
|
304
|
+
* Text effect animations
|
|
305
|
+
*/
|
|
306
|
+
type TextEffect = 'none' | 'blinkBackground' | 'lights' | 'antsBlack' | 'antsRed' | 'shimmer' | 'sparkle';
|
|
307
|
+
/**
|
|
308
|
+
* Emphasis mark type
|
|
309
|
+
*/
|
|
310
|
+
type EmphasisMark = 'none' | 'dot' | 'comma' | 'circle' | 'underDot';
|
|
311
|
+
/** Word font-binding hint from `w:rFonts/@w:hint`. Undefined means `default`. */
|
|
312
|
+
type RunFontHint = 'default' | 'eastAsia' | 'cs';
|
|
313
|
+
/**
|
|
314
|
+
* Modern (Office 2010+ `w14:*`) run text effects — glow, modern shadow,
|
|
315
|
+
* reflection, text fill, and compound text outline. Distances/radii are in
|
|
316
|
+
* CSS px (converted from EMU at parse); directions are degrees clockwise;
|
|
317
|
+
* opacities are 0..1 fractions; colors are resolved `#rrggbb` strings.
|
|
318
|
+
* All members optional and additive so documents without w14 effects
|
|
319
|
+
* round-trip byte-identically.
|
|
320
|
+
*/
|
|
321
|
+
interface TextModernEffects {
|
|
322
|
+
/** `w14:glow` — colored halo around the glyph outline. */
|
|
323
|
+
glow?: {
|
|
324
|
+
color?: string;
|
|
325
|
+
radius?: number;
|
|
326
|
+
};
|
|
327
|
+
/** `w14:shadow` — parameterized modern shadow. */
|
|
328
|
+
shadow?: {
|
|
329
|
+
color?: string;
|
|
330
|
+
blurRadius?: number;
|
|
331
|
+
distance?: number;
|
|
332
|
+
direction?: number;
|
|
333
|
+
};
|
|
334
|
+
/** `w14:reflection` — mirrored copy below the text. */
|
|
335
|
+
reflection?: {
|
|
336
|
+
blurRadius?: number;
|
|
337
|
+
startOpacity?: number;
|
|
338
|
+
endOpacity?: number;
|
|
339
|
+
distance?: number;
|
|
340
|
+
direction?: number;
|
|
341
|
+
};
|
|
342
|
+
/** `w14:textFill` — solid or gradient glyph fill replacing the run color. */
|
|
343
|
+
textFill?: {
|
|
344
|
+
kind?: 'none' | 'solid' | 'gradient';
|
|
345
|
+
color?: string;
|
|
346
|
+
angle?: number;
|
|
347
|
+
stops?: Array<{
|
|
348
|
+
position?: number;
|
|
349
|
+
color?: string;
|
|
350
|
+
}>;
|
|
351
|
+
};
|
|
352
|
+
/** `w14:textOutline` — stroked glyph outline. Width in px. */
|
|
353
|
+
textOutline?: {
|
|
354
|
+
color?: string;
|
|
355
|
+
width?: number;
|
|
356
|
+
dash?: string;
|
|
357
|
+
noFill?: boolean;
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* The three independent language slots in `w:lang`. Missing slots inherit
|
|
362
|
+
* through the style/default chain and therefore have no effect.
|
|
363
|
+
*/
|
|
364
|
+
interface RunLanguage {
|
|
365
|
+
/** Latin/default language (`w:lang/@w:val`). */
|
|
366
|
+
latin?: string;
|
|
367
|
+
/** East Asian language (`w:lang/@w:eastAsia`). */
|
|
368
|
+
eastAsia?: string;
|
|
369
|
+
/** Complex-script language (`w:lang/@w:bidi`). */
|
|
370
|
+
bidi?: string;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Character-level formatting (`w:rPr`) — the full set of run properties
|
|
374
|
+
* Word supports: weight, slant, font, size, color, highlight, underline,
|
|
375
|
+
* strikethrough, vertical position, language, complex-script variants,
|
|
376
|
+
* spacing/kerning, emphasis marks, and more.
|
|
377
|
+
*
|
|
378
|
+
* Most fields mirror their ECMA-376 element names (see §17.3.2). Missing
|
|
379
|
+
* keys inherit from the run's paragraph style → linked style → document
|
|
380
|
+
* defaults chain.
|
|
381
|
+
*/
|
|
382
|
+
interface TextFormatting {
|
|
383
|
+
/** Bold (w:b) */
|
|
384
|
+
bold?: boolean;
|
|
385
|
+
/** Bold complex script (w:bCs) */
|
|
386
|
+
boldCs?: boolean;
|
|
387
|
+
/** Italic (w:i) */
|
|
388
|
+
italic?: boolean;
|
|
389
|
+
/** Italic complex script (w:iCs) */
|
|
390
|
+
italicCs?: boolean;
|
|
391
|
+
/** Underline style and color (w:u) */
|
|
392
|
+
underline?: {
|
|
393
|
+
style: UnderlineStyle;
|
|
394
|
+
color?: ColorValue;
|
|
395
|
+
};
|
|
396
|
+
/** Strikethrough (w:strike) */
|
|
397
|
+
strike?: boolean;
|
|
398
|
+
/** Double strikethrough (w:dstrike) */
|
|
399
|
+
doubleStrike?: boolean;
|
|
400
|
+
/** Superscript/subscript (w:vertAlign) */
|
|
401
|
+
vertAlign?: 'baseline' | 'superscript' | 'subscript';
|
|
402
|
+
/** Small caps (w:smallCaps) */
|
|
403
|
+
smallCaps?: boolean;
|
|
404
|
+
/** All caps (w:caps) */
|
|
405
|
+
allCaps?: boolean;
|
|
406
|
+
/** Hidden text (w:vanish) */
|
|
407
|
+
hidden?: boolean;
|
|
408
|
+
/** Text color (w:color) */
|
|
409
|
+
color?: ColorValue;
|
|
410
|
+
/** Highlight/background color (w:highlight) */
|
|
411
|
+
highlight?: 'black' | 'blue' | 'cyan' | 'darkBlue' | 'darkCyan' | 'darkGray' | 'darkGreen' | 'darkMagenta' | 'darkRed' | 'darkYellow' | 'green' | 'lightGray' | 'magenta' | 'none' | 'red' | 'white' | 'yellow';
|
|
412
|
+
/** Character shading (w:shd) */
|
|
413
|
+
shading?: ShadingProperties;
|
|
414
|
+
/** Font size in half-points (w:sz) - e.g., 24 = 12pt */
|
|
415
|
+
fontSize?: number;
|
|
416
|
+
/** Font size complex script (w:szCs) */
|
|
417
|
+
fontSizeCs?: number;
|
|
418
|
+
/** Font family (w:rFonts) */
|
|
419
|
+
fontFamily?: {
|
|
420
|
+
ascii?: string;
|
|
421
|
+
hAnsi?: string;
|
|
422
|
+
eastAsia?: string;
|
|
423
|
+
cs?: string;
|
|
424
|
+
/** Theme font reference */
|
|
425
|
+
asciiTheme?: 'majorAscii' | 'majorHAnsi' | 'majorEastAsia' | 'majorBidi' | 'minorAscii' | 'minorHAnsi' | 'minorEastAsia' | 'minorBidi';
|
|
426
|
+
hAnsiTheme?: string;
|
|
427
|
+
eastAsiaTheme?: string;
|
|
428
|
+
csTheme?: string;
|
|
429
|
+
/** Script-binding hint (`w:rFonts/@w:hint`). Undefined = `default`. */
|
|
430
|
+
hint?: RunFontHint;
|
|
431
|
+
};
|
|
432
|
+
/** Three-slot run language (`w:lang`). Undefined = inherit/no override. */
|
|
433
|
+
language?: RunLanguage;
|
|
434
|
+
/** Character spacing in twips (w:spacing) */
|
|
435
|
+
spacing?: number;
|
|
436
|
+
/** Raised/lowered text position in half-points (w:position) */
|
|
437
|
+
position?: number;
|
|
438
|
+
/** Horizontal text scale percentage (w:w) */
|
|
439
|
+
scale?: number;
|
|
440
|
+
/** Kerning threshold in half-points (w:kern) */
|
|
441
|
+
kerning?: number;
|
|
442
|
+
/** Text effect animation (w:effect) */
|
|
443
|
+
effect?: TextEffect;
|
|
444
|
+
/** Emphasis mark (w:em) */
|
|
445
|
+
emphasisMark?: EmphasisMark;
|
|
446
|
+
/** Emboss effect (w:emboss) */
|
|
447
|
+
emboss?: boolean;
|
|
448
|
+
/** Imprint/engrave effect (w:imprint) */
|
|
449
|
+
imprint?: boolean;
|
|
450
|
+
/** Outline effect (w:outline) */
|
|
451
|
+
outline?: boolean;
|
|
452
|
+
/** Shadow effect (w:shadow) */
|
|
453
|
+
shadow?: boolean;
|
|
454
|
+
/** Modern w14 text effects (glow/shadow/reflection/textFill/textOutline). */
|
|
455
|
+
modernEffects?: TextModernEffects;
|
|
456
|
+
/** Right-to-left text (w:rtl) */
|
|
457
|
+
rtl?: boolean;
|
|
458
|
+
/** Complex script formatting (w:cs) */
|
|
459
|
+
cs?: boolean;
|
|
460
|
+
/** Character style ID (w:rStyle) */
|
|
461
|
+
styleId?: string;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Tab stop alignment
|
|
465
|
+
*/
|
|
466
|
+
type TabStopAlignment = 'left' | 'center' | 'right' | 'decimal' | 'bar' | 'clear' | 'num';
|
|
467
|
+
/**
|
|
468
|
+
* Tab leader character
|
|
469
|
+
*/
|
|
470
|
+
type TabLeader = 'none' | 'dot' | 'hyphen' | 'underscore' | 'heavy' | 'middleDot';
|
|
471
|
+
/**
|
|
472
|
+
* Tab stop definition
|
|
473
|
+
*/
|
|
474
|
+
interface TabStop {
|
|
475
|
+
/** Position in twips from left margin */
|
|
476
|
+
position: number;
|
|
477
|
+
/** Alignment at tab stop */
|
|
478
|
+
alignment: TabStopAlignment;
|
|
479
|
+
/** Leader character */
|
|
480
|
+
leader?: TabLeader;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Line spacing rule
|
|
484
|
+
*/
|
|
485
|
+
type LineSpacingRule = 'auto' | 'exact' | 'atLeast';
|
|
486
|
+
/**
|
|
487
|
+
* Paragraph alignment/justification
|
|
488
|
+
*/
|
|
489
|
+
type ParagraphAlignment = 'left' | 'center' | 'right' | 'both' | 'distribute' | 'mediumKashida' | 'highKashida' | 'lowKashida' | 'thaiDistribute';
|
|
490
|
+
/**
|
|
491
|
+
* Per-side flags identifying which `<w:spacing>` attrs were inline (not
|
|
492
|
+
* inherited from a style chain). Used to suppress style-only spacing on
|
|
493
|
+
* empty paragraphs per Word's behavior.
|
|
494
|
+
*/
|
|
495
|
+
type SpacingExplicit = {
|
|
496
|
+
before?: boolean;
|
|
497
|
+
after?: boolean;
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* Paragraph-level formatting (`w:pPr`) — alignment, indentation, spacing
|
|
501
|
+
* (before/after, line height), pagination flags (keepNext, keepLines,
|
|
502
|
+
* pageBreakBefore, widowControl), tabs, borders, shading, numbering
|
|
503
|
+
* reference, style reference, and frame/anchored-text properties.
|
|
504
|
+
*
|
|
505
|
+
* Most fields mirror their ECMA-376 element names (see §17.3.1).
|
|
506
|
+
* Inheritance: direct formatting beats the linked style which beats
|
|
507
|
+
* document defaults.
|
|
508
|
+
*/
|
|
509
|
+
interface ParagraphFormatting {
|
|
510
|
+
/** Paragraph alignment (w:jc) */
|
|
511
|
+
alignment?: ParagraphAlignment;
|
|
512
|
+
/** Text direction (w:bidi) */
|
|
513
|
+
bidi?: boolean;
|
|
514
|
+
/** Spacing before in twips (w:spacing/@w:before) */
|
|
515
|
+
spaceBefore?: number;
|
|
516
|
+
/** Spacing after in twips (w:spacing/@w:after) */
|
|
517
|
+
spaceAfter?: number;
|
|
518
|
+
/** Line spacing value (w:spacing/@w:line) */
|
|
519
|
+
lineSpacing?: number;
|
|
520
|
+
/** Line spacing rule (w:spacing/@w:lineRule) */
|
|
521
|
+
lineSpacingRule?: LineSpacingRule;
|
|
522
|
+
/** Auto space before (w:spacing/@w:beforeAutospacing) */
|
|
523
|
+
beforeAutospacing?: boolean;
|
|
524
|
+
/** Auto space after (w:spacing/@w:afterAutospacing) */
|
|
525
|
+
afterAutospacing?: boolean;
|
|
526
|
+
/**
|
|
527
|
+
* Per-side flags marking which `<w:spacing>` attrs came from this
|
|
528
|
+
* paragraph's own pPr (vs inherited). Word collapses style-inherited
|
|
529
|
+
* spacing on empty paragraphs but honors the explicit values.
|
|
530
|
+
*/
|
|
531
|
+
spacingExplicit?: SpacingExplicit;
|
|
532
|
+
/** Left indent in twips (w:ind/@w:left) */
|
|
533
|
+
indentLeft?: number;
|
|
534
|
+
/** Right indent in twips (w:ind/@w:right) */
|
|
535
|
+
indentRight?: number;
|
|
536
|
+
/** First line indent in twips - positive for indent, negative for hanging (w:ind/@w:firstLine or @w:hanging) */
|
|
537
|
+
indentFirstLine?: number;
|
|
538
|
+
/** Whether first line is hanging indent */
|
|
539
|
+
hangingIndent?: boolean;
|
|
540
|
+
/** Paragraph borders (w:pBdr) */
|
|
541
|
+
borders?: {
|
|
542
|
+
top?: BorderSpec;
|
|
543
|
+
bottom?: BorderSpec;
|
|
544
|
+
left?: BorderSpec;
|
|
545
|
+
right?: BorderSpec;
|
|
546
|
+
between?: BorderSpec;
|
|
547
|
+
bar?: BorderSpec;
|
|
548
|
+
};
|
|
549
|
+
/** Paragraph shading (w:shd) */
|
|
550
|
+
shading?: ShadingProperties;
|
|
551
|
+
/** Custom tab stops (w:tabs) */
|
|
552
|
+
tabs?: TabStop[];
|
|
553
|
+
/** Keep with next paragraph (w:keepNext) */
|
|
554
|
+
keepNext?: boolean;
|
|
555
|
+
/** Keep lines together (w:keepLines) */
|
|
556
|
+
keepLines?: boolean;
|
|
557
|
+
/** Widow/orphan control (w:widowControl) */
|
|
558
|
+
widowControl?: boolean;
|
|
559
|
+
/** Page break before (w:pageBreakBefore) */
|
|
560
|
+
pageBreakBefore?: boolean;
|
|
561
|
+
/** Contextual spacing — suppress space between paragraphs of the same style (w:contextualSpacing) */
|
|
562
|
+
contextualSpacing?: boolean;
|
|
563
|
+
/** Numbering properties (w:numPr) */
|
|
564
|
+
numPr?: {
|
|
565
|
+
/** Numbering definition ID (w:numId) */
|
|
566
|
+
numId?: number;
|
|
567
|
+
/** List level (0-8) (w:ilvl) */
|
|
568
|
+
ilvl?: number;
|
|
569
|
+
};
|
|
570
|
+
/**
|
|
571
|
+
* When `numPr` was resolved from the paragraph STYLE's pPr rather than the
|
|
572
|
+
* paragraph's own `<w:numPr>`, this records the style-sourced value. The
|
|
573
|
+
* serializer omits `numPr` while it still equals this value — writing it as
|
|
574
|
+
* direct formatting would flip Word's indent precedence (a directly
|
|
575
|
+
* referenced level's indents beat the style's; a style-referenced level's
|
|
576
|
+
* do not) and break the document on save/reload. Cleared the moment the
|
|
577
|
+
* user changes the numbering (values diverge).
|
|
578
|
+
*/
|
|
579
|
+
numPrFromStyle?: {
|
|
580
|
+
numId?: number;
|
|
581
|
+
ilvl?: number;
|
|
582
|
+
};
|
|
583
|
+
/** Outline level 0-9 (w:outlineLvl) */
|
|
584
|
+
outlineLevel?: number;
|
|
585
|
+
/** Paragraph style ID (w:pStyle) */
|
|
586
|
+
styleId?: string;
|
|
587
|
+
/** Text frame properties (w:framePr) */
|
|
588
|
+
frame?: {
|
|
589
|
+
width?: number;
|
|
590
|
+
height?: number;
|
|
591
|
+
hAnchor?: 'text' | 'margin' | 'page';
|
|
592
|
+
vAnchor?: 'text' | 'margin' | 'page';
|
|
593
|
+
x?: number;
|
|
594
|
+
y?: number;
|
|
595
|
+
xAlign?: 'left' | 'center' | 'right' | 'inside' | 'outside';
|
|
596
|
+
yAlign?: 'top' | 'center' | 'bottom' | 'inside' | 'outside' | 'inline';
|
|
597
|
+
wrap?: 'around' | 'auto' | 'none' | 'notBeside' | 'through' | 'tight';
|
|
598
|
+
};
|
|
599
|
+
/** Suppress line numbers (w:suppressLineNumbers) */
|
|
600
|
+
suppressLineNumbers?: boolean;
|
|
601
|
+
/** Suppress auto hyphens (w:suppressAutoHyphens) */
|
|
602
|
+
suppressAutoHyphens?: boolean;
|
|
603
|
+
/** Run properties to apply to all runs (w:rPr) */
|
|
604
|
+
runProperties?: TextFormatting;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Table width type
|
|
608
|
+
*/
|
|
609
|
+
type TableWidthType = 'auto' | 'dxa' | 'nil' | 'pct';
|
|
610
|
+
/**
|
|
611
|
+
* Table measurement (width or height)
|
|
612
|
+
*/
|
|
613
|
+
interface TableMeasurement {
|
|
614
|
+
/** Value in twips (for dxa) or fifths of a percent (for pct) */
|
|
615
|
+
value: number;
|
|
616
|
+
/** Measurement type */
|
|
617
|
+
type: TableWidthType;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Table borders
|
|
621
|
+
*/
|
|
622
|
+
interface TableBorders {
|
|
623
|
+
top?: BorderSpec;
|
|
624
|
+
bottom?: BorderSpec;
|
|
625
|
+
left?: BorderSpec;
|
|
626
|
+
right?: BorderSpec;
|
|
627
|
+
insideH?: BorderSpec;
|
|
628
|
+
insideV?: BorderSpec;
|
|
629
|
+
/** Logical leading edge (`w:start`); undefined = no authored edge. */
|
|
630
|
+
start?: BorderSpec;
|
|
631
|
+
/** Logical trailing edge (`w:end`); undefined = no authored edge. */
|
|
632
|
+
end?: BorderSpec;
|
|
633
|
+
/** Top-left to bottom-right diagonal (`w:tl2br`). */
|
|
634
|
+
tl2br?: BorderSpec;
|
|
635
|
+
/** Top-right to bottom-left diagonal (`w:tr2bl`). */
|
|
636
|
+
tr2bl?: BorderSpec;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Cell margins
|
|
640
|
+
*/
|
|
641
|
+
interface CellMargins {
|
|
642
|
+
top?: TableMeasurement;
|
|
643
|
+
bottom?: TableMeasurement;
|
|
644
|
+
left?: TableMeasurement;
|
|
645
|
+
right?: TableMeasurement;
|
|
646
|
+
/** Logical leading margin (`w:start`); undefined falls back to physical left/right. */
|
|
647
|
+
start?: TableMeasurement;
|
|
648
|
+
/** Logical trailing margin (`w:end`); undefined falls back to physical left/right. */
|
|
649
|
+
end?: TableMeasurement;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Table look flags (for table styles)
|
|
653
|
+
*/
|
|
654
|
+
interface TableLook {
|
|
655
|
+
firstColumn?: boolean;
|
|
656
|
+
firstRow?: boolean;
|
|
657
|
+
lastColumn?: boolean;
|
|
658
|
+
lastRow?: boolean;
|
|
659
|
+
noHBand?: boolean;
|
|
660
|
+
noVBand?: boolean;
|
|
661
|
+
/** Original hexadecimal `w:tblLook/@w:val`; undefined = derive from flags. */
|
|
662
|
+
value?: string;
|
|
663
|
+
}
|
|
664
|
+
/** One conditional region selected by `w:tblStylePr`/`w:cnfStyle`. */
|
|
665
|
+
type TableStyleRegion = 'band1Horz' | 'band1Vert' | 'band2Horz' | 'band2Vert' | 'firstCol' | 'firstRow' | 'lastCol' | 'lastRow' | 'neCell' | 'nwCell' | 'seCell' | 'swCell';
|
|
666
|
+
/**
|
|
667
|
+
* Lossless style-cascade provenance carried after resolution. Every member is
|
|
668
|
+
* optional; an absent object means legacy direct-formatting behavior.
|
|
669
|
+
*/
|
|
670
|
+
interface TableStyleCascade {
|
|
671
|
+
/** Explicitly selected `w:tblStyle`, if any. */
|
|
672
|
+
selectedStyleId?: string;
|
|
673
|
+
/** Type-default table style used when no explicit style exists. */
|
|
674
|
+
defaultStyleId?: string;
|
|
675
|
+
/** `basedOn` chain, base first. Undefined = not resolved yet. */
|
|
676
|
+
basedOnStyleIds?: string[];
|
|
677
|
+
/** Exact conditional regions applied, in cascade order. */
|
|
678
|
+
appliedRegions?: TableStyleRegion[];
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Floating table properties
|
|
682
|
+
*/
|
|
683
|
+
interface FloatingTableProperties {
|
|
684
|
+
/** Horizontal anchor */
|
|
685
|
+
horzAnchor?: 'margin' | 'page' | 'text';
|
|
686
|
+
/** Vertical anchor */
|
|
687
|
+
vertAnchor?: 'margin' | 'page' | 'text';
|
|
688
|
+
/** Horizontal position */
|
|
689
|
+
tblpX?: number;
|
|
690
|
+
tblpXSpec?: 'left' | 'center' | 'right' | 'inside' | 'outside';
|
|
691
|
+
/** Vertical position */
|
|
692
|
+
tblpY?: number;
|
|
693
|
+
tblpYSpec?: 'top' | 'center' | 'bottom' | 'inside' | 'outside' | 'inline';
|
|
694
|
+
/** Distance from surrounding text */
|
|
695
|
+
topFromText?: number;
|
|
696
|
+
bottomFromText?: number;
|
|
697
|
+
leftFromText?: number;
|
|
698
|
+
rightFromText?: number;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Table formatting properties (w:tblPr)
|
|
702
|
+
*/
|
|
703
|
+
interface TableFormatting {
|
|
704
|
+
/** Table width */
|
|
705
|
+
width?: TableMeasurement;
|
|
706
|
+
/** Table justification */
|
|
707
|
+
justification?: 'left' | 'center' | 'right';
|
|
708
|
+
/** Cell spacing */
|
|
709
|
+
cellSpacing?: TableMeasurement;
|
|
710
|
+
/** Table indent from left margin */
|
|
711
|
+
indent?: TableMeasurement;
|
|
712
|
+
/** Table borders */
|
|
713
|
+
borders?: TableBorders;
|
|
714
|
+
/** Default cell margins */
|
|
715
|
+
cellMargins?: CellMargins;
|
|
716
|
+
/** Table layout */
|
|
717
|
+
layout?: 'fixed' | 'autofit';
|
|
718
|
+
/** Table style ID */
|
|
719
|
+
styleId?: string;
|
|
720
|
+
/** Table look (conditional formatting flags) */
|
|
721
|
+
look?: TableLook;
|
|
722
|
+
/** Shading/background */
|
|
723
|
+
shading?: ShadingProperties;
|
|
724
|
+
/** Overlap for floating tables */
|
|
725
|
+
overlap?: 'never' | 'overlap';
|
|
726
|
+
/** Floating table properties */
|
|
727
|
+
floating?: FloatingTableProperties;
|
|
728
|
+
/** Right to left table */
|
|
729
|
+
bidi?: boolean;
|
|
730
|
+
/** Horizontal band size (`w:tblStyleRowBandSize`). Undefined = 1. */
|
|
731
|
+
styleRowBandSize?: number;
|
|
732
|
+
/** Vertical band size (`w:tblStyleColBandSize`). Undefined = 1. */
|
|
733
|
+
styleColBandSize?: number;
|
|
734
|
+
/** Optional resolved style provenance. Undefined = legacy cascade. */
|
|
735
|
+
styleCascade?: TableStyleCascade;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Table row formatting properties (w:trPr)
|
|
739
|
+
*/
|
|
740
|
+
interface TableRowFormatting {
|
|
741
|
+
/** Row height */
|
|
742
|
+
height?: TableMeasurement;
|
|
743
|
+
/** Height rule */
|
|
744
|
+
heightRule?: 'auto' | 'atLeast' | 'exact';
|
|
745
|
+
/** Header row (repeats on each page) */
|
|
746
|
+
header?: boolean;
|
|
747
|
+
/** Allow row to break across pages */
|
|
748
|
+
cantSplit?: boolean;
|
|
749
|
+
/** Row justification */
|
|
750
|
+
justification?: 'left' | 'center' | 'right';
|
|
751
|
+
/** Hidden row */
|
|
752
|
+
hidden?: boolean;
|
|
753
|
+
/** Conditional format style */
|
|
754
|
+
conditionalFormat?: ConditionalFormatStyle;
|
|
755
|
+
/** Leading omitted grid columns (`w:gridBefore`). Undefined = 0. */
|
|
756
|
+
gridBefore?: number;
|
|
757
|
+
/** Trailing omitted grid columns (`w:gridAfter`). Undefined = 0. */
|
|
758
|
+
gridAfter?: number;
|
|
759
|
+
/** Preferred width before cells (`w:wBefore`). */
|
|
760
|
+
widthBefore?: TableMeasurement;
|
|
761
|
+
/** Preferred width after cells (`w:wAfter`). */
|
|
762
|
+
widthAfter?: TableMeasurement;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Conditional format style
|
|
766
|
+
*/
|
|
767
|
+
interface ConditionalFormatStyle {
|
|
768
|
+
/** First row */
|
|
769
|
+
firstRow?: boolean;
|
|
770
|
+
/** Last row */
|
|
771
|
+
lastRow?: boolean;
|
|
772
|
+
/** First column */
|
|
773
|
+
firstColumn?: boolean;
|
|
774
|
+
/** Last column */
|
|
775
|
+
lastColumn?: boolean;
|
|
776
|
+
/** Odd horizontal band */
|
|
777
|
+
oddHBand?: boolean;
|
|
778
|
+
/** Even horizontal band */
|
|
779
|
+
evenHBand?: boolean;
|
|
780
|
+
/** Odd vertical band */
|
|
781
|
+
oddVBand?: boolean;
|
|
782
|
+
/** Even vertical band */
|
|
783
|
+
evenVBand?: boolean;
|
|
784
|
+
/** Northwest corner */
|
|
785
|
+
nwCell?: boolean;
|
|
786
|
+
/** Northeast corner */
|
|
787
|
+
neCell?: boolean;
|
|
788
|
+
/** Southwest corner */
|
|
789
|
+
swCell?: boolean;
|
|
790
|
+
/** Southeast corner */
|
|
791
|
+
seCell?: boolean;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* Table cell formatting properties (w:tcPr)
|
|
795
|
+
*/
|
|
796
|
+
interface TableCellFormatting {
|
|
797
|
+
/** Cell width */
|
|
798
|
+
width?: TableMeasurement;
|
|
799
|
+
/** Cell borders */
|
|
800
|
+
borders?: TableBorders;
|
|
801
|
+
/** Cell margins (override table default) */
|
|
802
|
+
margins?: CellMargins;
|
|
803
|
+
/** Cell shading/background */
|
|
804
|
+
shading?: ShadingProperties;
|
|
805
|
+
/** Vertical alignment */
|
|
806
|
+
verticalAlign?: 'top' | 'center' | 'bottom';
|
|
807
|
+
/** Text direction */
|
|
808
|
+
textDirection?: 'lr' | 'lrV' | 'rl' | 'rlV' | 'tb' | 'tbV' | 'tbRl' | 'tbRlV' | 'btLr';
|
|
809
|
+
/** Grid span (horizontal merge) */
|
|
810
|
+
gridSpan?: number;
|
|
811
|
+
/** Vertical merge */
|
|
812
|
+
vMerge?: 'restart' | 'continue';
|
|
813
|
+
/** Fit text to cell width */
|
|
814
|
+
fitText?: boolean;
|
|
815
|
+
/** Wrap text */
|
|
816
|
+
noWrap?: boolean;
|
|
817
|
+
/** Hide cell marker */
|
|
818
|
+
hideMark?: boolean;
|
|
819
|
+
/** Conditional format style */
|
|
820
|
+
conditionalFormat?: ConditionalFormatStyle;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
export { type ThemeFont as A, type BorderSpec as B, type ColorValue as C, type ThemeFontScheme as D, type EmphasisMark as E, type FloatingTableProperties as F, type ThemeMatrixCell as G, generateThemeTintShadeMatrix as H, getThemeTintShadeHex as I, resolveColorToHex as J, type LineSpacingRule as L, type ParagraphFormatting as P, type RunFontHint as R, type ShadingProperties as S, type TextFormatting as T, type UnderlineStyle as U, type Theme as a, blendColors as b, type CellMargins as c, darkenColor as d, type ConditionalFormatStyle as e, type ParagraphAlignment as f, getContrastingColor as g, type RunLanguage as h, type TabLeader as i, type TabStop as j, type TabStopAlignment as k, lightenColor as l, type TableBorders as m, type TableCellFormatting as n, type TableFormatting as o, type TableLook as p, type TableMeasurement as q, resolveColor as r, type TableRowFormatting as s, type TableStyleCascade as t, type TableStyleRegion as u, type TableWidthType as v, type TextEffect as w, type TextModernEffects as x, type ThemeColorScheme as y, type ThemeColorSlot as z };
|