@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,290 @@
|
|
|
1
|
+
import { Document } from './types/document.mjs';
|
|
2
|
+
import { C as ColorValue, a as Theme, z as ThemeColorSlot } from './formatting-DoL7KBSL.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Template Processing Utility
|
|
6
|
+
*
|
|
7
|
+
* Uses docxtemplater to substitute template variables in DOCX documents:
|
|
8
|
+
* - Processes {variable_name} patterns (docxtemplater default syntax)
|
|
9
|
+
* - Preserves all formatting (fonts, styles, colors, tables)
|
|
10
|
+
* - Error handling with useful messages
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Options for template processing
|
|
14
|
+
*/
|
|
15
|
+
interface ProcessTemplateOptions {
|
|
16
|
+
/** How to handle undefined variables */
|
|
17
|
+
nullGetter?: 'keep' | 'empty' | 'error';
|
|
18
|
+
/** Custom parser for variable names */
|
|
19
|
+
parser?: (tag: string) => {
|
|
20
|
+
get: (scope: Record<string, unknown>) => unknown;
|
|
21
|
+
};
|
|
22
|
+
/** Line breaks: keep raw \n or convert to w:br */
|
|
23
|
+
linebreaks?: boolean;
|
|
24
|
+
/** Delimiter settings */
|
|
25
|
+
delimiters?: {
|
|
26
|
+
start?: string;
|
|
27
|
+
end?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Result of template processing
|
|
32
|
+
*/
|
|
33
|
+
interface ProcessTemplateResult {
|
|
34
|
+
/** The processed document buffer */
|
|
35
|
+
buffer: ArrayBuffer;
|
|
36
|
+
/** Variables that were found and replaced */
|
|
37
|
+
replacedVariables: string[];
|
|
38
|
+
/** Variables that were not replaced (no value provided) */
|
|
39
|
+
unreplacedVariables: string[];
|
|
40
|
+
/** Any warnings during processing */
|
|
41
|
+
warnings: string[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Error details from template processing
|
|
45
|
+
*/
|
|
46
|
+
interface TemplateError {
|
|
47
|
+
/** Error message */
|
|
48
|
+
message: string;
|
|
49
|
+
/** Variable name that caused the error (if applicable) */
|
|
50
|
+
variable?: string;
|
|
51
|
+
/** Error type */
|
|
52
|
+
type: 'parse' | 'render' | 'undefined' | 'unknown';
|
|
53
|
+
/** Original error */
|
|
54
|
+
originalError?: Error;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Process a DOCX template with variable substitution
|
|
58
|
+
*
|
|
59
|
+
* @param buffer - The DOCX file as ArrayBuffer
|
|
60
|
+
* @param variables - Map of variable names to values
|
|
61
|
+
* @param options - Processing options
|
|
62
|
+
* @returns Processed DOCX as ArrayBuffer
|
|
63
|
+
*/
|
|
64
|
+
declare function processTemplate(buffer: ArrayBuffer, variables: Record<string, string>, options?: ProcessTemplateOptions): ArrayBuffer;
|
|
65
|
+
/**
|
|
66
|
+
* Process template with detailed result
|
|
67
|
+
*
|
|
68
|
+
* @param buffer - The DOCX file as ArrayBuffer
|
|
69
|
+
* @param variables - Map of variable names to values
|
|
70
|
+
* @param options - Processing options
|
|
71
|
+
* @returns Detailed processing result
|
|
72
|
+
*/
|
|
73
|
+
declare function processTemplateDetailed(buffer: ArrayBuffer, variables: Record<string, string>, options?: ProcessTemplateOptions): ProcessTemplateResult;
|
|
74
|
+
/**
|
|
75
|
+
* Process template and return as Blob
|
|
76
|
+
*
|
|
77
|
+
* @param buffer - The DOCX file as ArrayBuffer
|
|
78
|
+
* @param variables - Map of variable names to values
|
|
79
|
+
* @param options - Processing options
|
|
80
|
+
* @returns Processed DOCX as Blob
|
|
81
|
+
*/
|
|
82
|
+
declare function processTemplateAsBlob(buffer: ArrayBuffer, variables: Record<string, string>, options?: ProcessTemplateOptions): Blob;
|
|
83
|
+
/**
|
|
84
|
+
* Process template and trigger download
|
|
85
|
+
*
|
|
86
|
+
* @param buffer - The DOCX file as ArrayBuffer
|
|
87
|
+
* @param variables - Map of variable names to values
|
|
88
|
+
* @param filename - Output filename (without extension)
|
|
89
|
+
* @param options - Processing options
|
|
90
|
+
*/
|
|
91
|
+
declare function processTemplateAndDownload(buffer: ArrayBuffer, variables: Record<string, string>, filename?: string, options?: ProcessTemplateOptions): void;
|
|
92
|
+
/**
|
|
93
|
+
* Get all template tags in a document without processing
|
|
94
|
+
*
|
|
95
|
+
* @param buffer - The DOCX file as ArrayBuffer
|
|
96
|
+
* @returns List of tag names found
|
|
97
|
+
*/
|
|
98
|
+
declare function getTemplateTags(buffer: ArrayBuffer): string[];
|
|
99
|
+
/**
|
|
100
|
+
* Validate that a document is a valid docxtemplater template
|
|
101
|
+
*
|
|
102
|
+
* @param buffer - The DOCX file as ArrayBuffer
|
|
103
|
+
* @returns Validation result
|
|
104
|
+
*/
|
|
105
|
+
declare function validateTemplate(buffer: ArrayBuffer): {
|
|
106
|
+
valid: boolean;
|
|
107
|
+
errors: TemplateError[];
|
|
108
|
+
tags: string[];
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Check if all required variables have values
|
|
112
|
+
*
|
|
113
|
+
* @param tags - List of template tags
|
|
114
|
+
* @param variables - Provided variable values
|
|
115
|
+
* @returns Missing variable names
|
|
116
|
+
*/
|
|
117
|
+
declare function getMissingVariables(tags: string[], variables: Record<string, string>): string[];
|
|
118
|
+
/**
|
|
119
|
+
* Preview what the document will look like after processing
|
|
120
|
+
* Returns the document text with variables replaced (for preview purposes)
|
|
121
|
+
*
|
|
122
|
+
* @param buffer - The DOCX file as ArrayBuffer
|
|
123
|
+
* @param variables - Map of variable names to values
|
|
124
|
+
* @returns Preview text
|
|
125
|
+
*/
|
|
126
|
+
declare function previewTemplate(buffer: ArrayBuffer, variables: Record<string, string>): string;
|
|
127
|
+
/**
|
|
128
|
+
* Process template with conditional sections
|
|
129
|
+
* Supports #if, #unless, #each loops
|
|
130
|
+
*
|
|
131
|
+
* @param buffer - The DOCX file as ArrayBuffer
|
|
132
|
+
* @param data - Full data object (can include arrays, nested objects)
|
|
133
|
+
* @param options - Processing options
|
|
134
|
+
* @returns Processed DOCX as ArrayBuffer
|
|
135
|
+
*/
|
|
136
|
+
declare function processTemplateAdvanced(buffer: ArrayBuffer, data: Record<string, unknown>, options?: ProcessTemplateOptions): ArrayBuffer;
|
|
137
|
+
/**
|
|
138
|
+
* Create a template processor with preset options
|
|
139
|
+
*/
|
|
140
|
+
declare function createTemplateProcessor(defaultOptions?: ProcessTemplateOptions): (buffer: ArrayBuffer, variables: Record<string, string>) => ArrayBuffer;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Create Document Utility
|
|
144
|
+
*
|
|
145
|
+
* Provides functions to create new documents programmatically.
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Options for creating an empty document
|
|
150
|
+
*/
|
|
151
|
+
interface CreateEmptyDocumentOptions {
|
|
152
|
+
/** Page width in twips (default: 12240 = 8.5 inches) */
|
|
153
|
+
pageWidth?: number;
|
|
154
|
+
/** Page height in twips (default: 15840 = 11 inches) */
|
|
155
|
+
pageHeight?: number;
|
|
156
|
+
/** Page orientation (default: 'portrait') */
|
|
157
|
+
orientation?: 'portrait' | 'landscape';
|
|
158
|
+
/** Top margin in twips (default: 1440 = 1 inch) */
|
|
159
|
+
marginTop?: number;
|
|
160
|
+
/** Bottom margin in twips (default: 1440 = 1 inch) */
|
|
161
|
+
marginBottom?: number;
|
|
162
|
+
/** Left margin in twips (default: 1440 = 1 inch) */
|
|
163
|
+
marginLeft?: number;
|
|
164
|
+
/** Right margin in twips (default: 1440 = 1 inch) */
|
|
165
|
+
marginRight?: number;
|
|
166
|
+
/** Initial text content (default: empty string) */
|
|
167
|
+
initialText?: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Create an empty document with a single paragraph
|
|
171
|
+
*
|
|
172
|
+
* @param options - Optional configuration for the document
|
|
173
|
+
* @returns A new empty Document object
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```ts
|
|
177
|
+
* // Create a blank document
|
|
178
|
+
* const doc = createEmptyDocument();
|
|
179
|
+
*
|
|
180
|
+
* // Create with custom margins
|
|
181
|
+
* const doc = createEmptyDocument({
|
|
182
|
+
* marginTop: 720, // 0.5 inch
|
|
183
|
+
* marginBottom: 720,
|
|
184
|
+
* });
|
|
185
|
+
*
|
|
186
|
+
* // Create with initial text
|
|
187
|
+
* const doc = createEmptyDocument({
|
|
188
|
+
* initialText: 'Hello, World!'
|
|
189
|
+
* });
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
declare function createEmptyDocument(options?: CreateEmptyDocumentOptions): Document;
|
|
193
|
+
/**
|
|
194
|
+
* Create a document with a single paragraph containing the given text
|
|
195
|
+
*
|
|
196
|
+
* @param text - The text content for the document
|
|
197
|
+
* @param options - Optional configuration for the document
|
|
198
|
+
* @returns A new Document object with the specified text
|
|
199
|
+
*/
|
|
200
|
+
declare function createDocumentWithText(text: string, options?: Omit<CreateEmptyDocumentOptions, 'initialText'>): Document;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Color Resolver - Convert OOXML colors to CSS
|
|
204
|
+
*
|
|
205
|
+
* The generic color machinery (theme slots, tint/shade math, blending, the
|
|
206
|
+
* picker matrix) is re-exported here. This module keeps the WordprocessingML-
|
|
207
|
+
* specific pieces: w:highlight named colors, w:shd shading semantics, and
|
|
208
|
+
* ColorValue construction helpers.
|
|
209
|
+
*
|
|
210
|
+
* OOXML Color References:
|
|
211
|
+
* - w:color/@w:val - RGB hex or "auto"
|
|
212
|
+
* - w:color/@w:themeColor - Theme color slot
|
|
213
|
+
* - w:color/@w:themeTint - Tint modifier (0-255, hex)
|
|
214
|
+
* - w:color/@w:themeShade - Shade modifier (0-255, hex)
|
|
215
|
+
*/
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Resolve a highlight color name to CSS
|
|
219
|
+
*
|
|
220
|
+
* @param highlight - Highlight color name (e.g., "yellow", "cyan")
|
|
221
|
+
* @returns CSS color string or empty string for "none"
|
|
222
|
+
*/
|
|
223
|
+
declare function resolveHighlightColor(highlight: string | undefined): string;
|
|
224
|
+
/**
|
|
225
|
+
* Resolve a shading fill or pattern color to CSS
|
|
226
|
+
*
|
|
227
|
+
* @param color - ColorValue for fill
|
|
228
|
+
* @param theme - Theme for resolving theme colors
|
|
229
|
+
* @returns CSS color string
|
|
230
|
+
*/
|
|
231
|
+
declare function resolveShadingColor(color: ColorValue | undefined | null, theme: Theme | null | undefined): string;
|
|
232
|
+
/**
|
|
233
|
+
* Check if a color is effectively black
|
|
234
|
+
*
|
|
235
|
+
* @param color - ColorValue object
|
|
236
|
+
* @param theme - Theme for resolving theme colors
|
|
237
|
+
* @returns True if color resolves to black or very dark
|
|
238
|
+
*/
|
|
239
|
+
declare function isBlack(color: ColorValue | undefined | null, theme: Theme | null | undefined): boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Check if a color is effectively white
|
|
242
|
+
*
|
|
243
|
+
* @param color - ColorValue object
|
|
244
|
+
* @param theme - Theme for resolving theme colors
|
|
245
|
+
* @returns True if color resolves to white or very light
|
|
246
|
+
*/
|
|
247
|
+
declare function isWhite(color: ColorValue | undefined | null, theme: Theme | null | undefined): boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Parse a color string (various formats) to ColorValue
|
|
250
|
+
*
|
|
251
|
+
* @param colorString - Color string like "FF0000", "auto", or theme color name
|
|
252
|
+
* @returns ColorValue object
|
|
253
|
+
*/
|
|
254
|
+
declare function parseColorString(colorString: string | undefined): ColorValue | undefined;
|
|
255
|
+
/**
|
|
256
|
+
* Create a ColorValue from theme color reference
|
|
257
|
+
*
|
|
258
|
+
* @param themeColor - Theme color slot name
|
|
259
|
+
* @param tint - Optional tint modifier
|
|
260
|
+
* @param shade - Optional shade modifier
|
|
261
|
+
* @returns ColorValue object
|
|
262
|
+
*/
|
|
263
|
+
declare function createThemeColor(themeColor: ThemeColorSlot, tint?: number, shade?: number): ColorValue;
|
|
264
|
+
/**
|
|
265
|
+
* Create a ColorValue from RGB hex
|
|
266
|
+
*
|
|
267
|
+
* @param hex - 6-character hex color (no #)
|
|
268
|
+
* @returns ColorValue object
|
|
269
|
+
*/
|
|
270
|
+
declare function createRgbColor(hex: string): ColorValue;
|
|
271
|
+
/**
|
|
272
|
+
* Ensure a hex color string has a '#' prefix.
|
|
273
|
+
*/
|
|
274
|
+
declare function ensureHexPrefix(hex: string): string;
|
|
275
|
+
/**
|
|
276
|
+
* Resolve a highlight color value to a CSS-ready string.
|
|
277
|
+
* Tries OOXML named highlight first, then ensures hex prefix.
|
|
278
|
+
*/
|
|
279
|
+
declare function resolveHighlightToCss(value: string): string;
|
|
280
|
+
/**
|
|
281
|
+
* Check if two colors are equal
|
|
282
|
+
*
|
|
283
|
+
* @param color1 - First color
|
|
284
|
+
* @param color2 - Second color
|
|
285
|
+
* @param theme - Theme for resolving
|
|
286
|
+
* @returns True if colors resolve to the same value
|
|
287
|
+
*/
|
|
288
|
+
declare function colorsEqual(color1: ColorValue | undefined | null, color2: ColorValue | undefined | null, theme: Theme | null | undefined): boolean;
|
|
289
|
+
|
|
290
|
+
export { type CreateEmptyDocumentOptions as C, type ProcessTemplateOptions as P, type TemplateError as T, type ProcessTemplateResult as a, createDocumentWithText as b, colorsEqual as c, createEmptyDocument as d, createRgbColor as e, createTemplateProcessor as f, createThemeColor as g, getMissingVariables as h, getTemplateTags as i, isBlack as j, isWhite as k, previewTemplate as l, processTemplate as m, processTemplateAdvanced as n, processTemplateAsBlob as o, parseColorString as p, processTemplateDetailed as q, resolveHighlightColor as r, resolveShadingColor as s, ensureHexPrefix as t, resolveHighlightToCss as u, validateTemplate as v, processTemplateAndDownload as w };
|