@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.
Files changed (190) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +41 -0
  3. package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
  4. package/dist/agent/index.d.mts +531 -0
  5. package/dist/agent/index.mjs +1 -0
  6. package/dist/chunk-34K66SY4.mjs +1 -0
  7. package/dist/chunk-3UBMCDME.mjs +1 -0
  8. package/dist/chunk-4RCISPPE.mjs +1 -0
  9. package/dist/chunk-4UD54UM5.mjs +1 -0
  10. package/dist/chunk-52GB3Y42.mjs +1 -0
  11. package/dist/chunk-6NEKRDXF.mjs +1 -0
  12. package/dist/chunk-6PW4CWUG.mjs +1 -0
  13. package/dist/chunk-7DEIW7FL.mjs +1 -0
  14. package/dist/chunk-7PCO5I2O.mjs +1 -0
  15. package/dist/chunk-BI3B33LI.mjs +1 -0
  16. package/dist/chunk-BIQWVK5P.mjs +2 -0
  17. package/dist/chunk-CIRN3LZA.mjs +1 -0
  18. package/dist/chunk-DXKG3HQ5.mjs +16 -0
  19. package/dist/chunk-EUUIJVM6.mjs +0 -0
  20. package/dist/chunk-FPZBTOD6.mjs +1 -0
  21. package/dist/chunk-FZIA7OFY.mjs +1 -0
  22. package/dist/chunk-GWKJ2Y4Y.mjs +1 -0
  23. package/dist/chunk-H3JCIGWK.mjs +1 -0
  24. package/dist/chunk-HJGAQIU7.mjs +2 -0
  25. package/dist/chunk-I6KKMUUC.mjs +1 -0
  26. package/dist/chunk-IL5JZJT7.mjs +1 -0
  27. package/dist/chunk-JY6ILTNS.mjs +1 -0
  28. package/dist/chunk-KEE52TT5.mjs +1 -0
  29. package/dist/chunk-KVKLLTDP.mjs +58 -0
  30. package/dist/chunk-KXNZFTTK.mjs +1 -0
  31. package/dist/chunk-L5ISVQ3W.mjs +1 -0
  32. package/dist/chunk-LDUWIM7M.mjs +1 -0
  33. package/dist/chunk-N5Q3YN64.mjs +1 -0
  34. package/dist/chunk-NEWOMDTX.mjs +1 -0
  35. package/dist/chunk-O2QSE2I7.mjs +1 -0
  36. package/dist/chunk-OBQGPMPQ.mjs +1 -0
  37. package/dist/chunk-OJOHXQNQ.mjs +1 -0
  38. package/dist/chunk-OMR3TWCD.mjs +2 -0
  39. package/dist/chunk-P3KDV4M2.mjs +1 -0
  40. package/dist/chunk-Q7PO7V73.mjs +1 -0
  41. package/dist/chunk-QOUFE3VX.mjs +1 -0
  42. package/dist/chunk-SINEY6ZF.mjs +1 -0
  43. package/dist/chunk-T4EZMUXM.mjs +1 -0
  44. package/dist/chunk-TTRUPDAB.mjs +1 -0
  45. package/dist/chunk-TYHI7RAD.mjs +1 -0
  46. package/dist/chunk-UIEJWORW.mjs +1 -0
  47. package/dist/chunk-VAOUFAUH.mjs +1 -0
  48. package/dist/chunk-VBOTMRXV.mjs +1 -0
  49. package/dist/chunk-VCER63GQ.mjs +1 -0
  50. package/dist/chunk-WAUF2UC7.mjs +2 -0
  51. package/dist/chunk-WRWRCBLK.mjs +1 -0
  52. package/dist/chunk-X4XDO3LZ.mjs +1 -0
  53. package/dist/chunk-XQBCCJBO.mjs +9 -0
  54. package/dist/chunk-XWUOLYRQ.mjs +2 -0
  55. package/dist/chunk-XYH6XWP3.mjs +10 -0
  56. package/dist/chunk-YBIM6UJV.mjs +8 -0
  57. package/dist/chunk-YCIH2Q3E.mjs +1 -0
  58. package/dist/chunk-YUOKI2HB.mjs +1 -0
  59. package/dist/chunk-ZOV5KL7C.mjs +1 -0
  60. package/dist/colorResolver-n0o7H7ep.d.mts +290 -0
  61. package/dist/content-sSHuWw49.d.mts +2202 -0
  62. package/dist/core-plugins.d.mts +37 -0
  63. package/dist/core-plugins.mjs +1 -0
  64. package/dist/core.d.mts +451 -0
  65. package/dist/core.mjs +1 -0
  66. package/dist/displayListQueries-p-ijSzdh.d.mts +222 -0
  67. package/dist/docx/index.d.mts +618 -0
  68. package/dist/docx/index.mjs +2 -0
  69. package/dist/docx/parser.d.mts +41 -0
  70. package/dist/docx/parser.mjs +1 -0
  71. package/dist/docx/rezip.d.mts +148 -0
  72. package/dist/docx/rezip.mjs +1 -0
  73. package/dist/docx/serializer/index.d.mts +42 -0
  74. package/dist/docx/serializer/index.mjs +1 -0
  75. package/dist/docx/wrapTypes.d.mts +19 -0
  76. package/dist/docx/wrapTypes.mjs +1 -0
  77. package/dist/docxInput-DTbCa48g.d.mts +21 -0
  78. package/dist/editor/index.d.mts +170 -0
  79. package/dist/editor/index.mjs +1 -0
  80. package/dist/editorTree-DO5PyDK8.d.mts +37 -0
  81. package/dist/executor-7O2RBJ2B.mjs +1 -0
  82. package/dist/fontLoader-Bx6DK6-2.d.mts +327 -0
  83. package/dist/formatting-DoL7KBSL.d.mts +823 -0
  84. package/dist/generated/edit/docx_edit_bg.wasm +0 -0
  85. package/dist/generated/layout/docx_layout_bg.wasm +0 -0
  86. package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
  87. package/dist/generated/parse/docx_parse_bg.wasm +0 -0
  88. package/dist/headerFooterLayout-0zPT64Qc.d.mts +316 -0
  89. package/dist/headless.d.mts +69 -0
  90. package/dist/headless.mjs +1 -0
  91. package/dist/layout/flow/index.d.mts +149 -0
  92. package/dist/layout/flow/index.mjs +1 -0
  93. package/dist/layout/index.d.mts +307 -0
  94. package/dist/layout/index.mjs +1 -0
  95. package/dist/layout/measure/index.d.mts +324 -0
  96. package/dist/layout/measure/index.mjs +1 -0
  97. package/dist/layout/pagination/index.d.mts +60 -0
  98. package/dist/layout/pagination/index.mjs +1 -0
  99. package/dist/layout/pagination/types.d.mts +4 -0
  100. package/dist/layout/pagination/types.mjs +1 -0
  101. package/dist/layout/render/index.d.mts +733 -0
  102. package/dist/layout/render/index.mjs +1 -0
  103. package/dist/loadWasmAsset-CMvnVkfA.d.mts +3 -0
  104. package/dist/managers/AutoSaveManager.d.mts +81 -0
  105. package/dist/managers/AutoSaveManager.mjs +1 -0
  106. package/dist/managers/TableSelectionManager.d.mts +74 -0
  107. package/dist/managers/TableSelectionManager.mjs +1 -0
  108. package/dist/managers/types.d.mts +113 -0
  109. package/dist/managers/types.mjs +0 -0
  110. package/dist/mcp-cli.mjs +142 -0
  111. package/dist/mcp.d.mts +162 -0
  112. package/dist/mcp.mjs +16 -0
  113. package/dist/measureBlocksPipeline-Df0Bbrwy.d.mts +109 -0
  114. package/dist/measuredBlock-DZwz8zhD.d.mts +26 -0
  115. package/dist/plugin-api/RenderedDomContext.d.mts +114 -0
  116. package/dist/plugin-api/RenderedDomContext.mjs +1 -0
  117. package/dist/plugin-api/index.d.mts +7 -0
  118. package/dist/plugin-api/index.mjs +0 -0
  119. package/dist/plugin-api/resolveItemPositions.d.mts +39 -0
  120. package/dist/plugin-api/resolveItemPositions.mjs +1 -0
  121. package/dist/plugin-api/types.d.mts +193 -0
  122. package/dist/plugin-api/types.mjs +0 -0
  123. package/dist/processTemplate-HDUIZFJ5.mjs +1 -0
  124. package/dist/registry-DMM5VTdT.d.mts +165 -0
  125. package/dist/rustDisplayList-dqunvwxH.d.mts +1036 -0
  126. package/dist/rustPagination-Bj2hq013.d.mts +106 -0
  127. package/dist/sectionConfigs-DW3J8q0X.d.mts +55 -0
  128. package/dist/selectionContext-Buc9BCU1.d.mts +570 -0
  129. package/dist/selectiveSave-oFBJ1n71.d.mts +16 -0
  130. package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
  131. package/dist/settingsParser-CcGvtmCK.d.mts +33 -0
  132. package/dist/styles/index.d.mts +162 -0
  133. package/dist/styles/index.mjs +1 -0
  134. package/dist/styles-VxNcXLdi.d.mts +189 -0
  135. package/dist/types/agentApi.d.mts +456 -0
  136. package/dist/types/agentApi.mjs +1 -0
  137. package/dist/types/content.d.mts +3 -0
  138. package/dist/types/content.mjs +1 -0
  139. package/dist/types/document.d.mts +117 -0
  140. package/dist/types/document.mjs +1 -0
  141. package/dist/types-DNrYr6yQ.d.mts +1754 -0
  142. package/dist/types-dYdjUZMo.d.mts +311 -0
  143. package/dist/units-O5Y02RKQ.d.mts +34 -0
  144. package/dist/utils/autoScroll.d.mts +24 -0
  145. package/dist/utils/autoScroll.mjs +1 -0
  146. package/dist/utils/cardStyles.d.mts +22 -0
  147. package/dist/utils/cardStyles.mjs +1 -0
  148. package/dist/utils/comments.d.mts +120 -0
  149. package/dist/utils/comments.mjs +4 -0
  150. package/dist/utils/findReplace.d.mts +114 -0
  151. package/dist/utils/findReplace.mjs +2 -0
  152. package/dist/utils/findVerticalScrollParent.d.mts +25 -0
  153. package/dist/utils/findVerticalScrollParent.mjs +1 -0
  154. package/dist/utils/fontOptions.d.mts +21 -0
  155. package/dist/utils/fontOptions.mjs +1 -0
  156. package/dist/utils/headingCollector.d.mts +28 -0
  157. package/dist/utils/headingCollector.mjs +1 -0
  158. package/dist/utils/highlightColors.d.mts +14 -0
  159. package/dist/utils/highlightColors.mjs +1 -0
  160. package/dist/utils/index.d.mts +956 -0
  161. package/dist/utils/index.mjs +84 -0
  162. package/dist/utils/listState.d.mts +27 -0
  163. package/dist/utils/listState.mjs +1 -0
  164. package/dist/utils/reportIssue.d.mts +23 -0
  165. package/dist/utils/reportIssue.mjs +2 -0
  166. package/dist/utils/sidebarConstants.d.mts +10 -0
  167. package/dist/utils/sidebarConstants.mjs +1 -0
  168. package/dist/utils/stylePreview.d.mts +70 -0
  169. package/dist/utils/stylePreview.mjs +1 -0
  170. package/dist/utils/textSelection.d.mts +92 -0
  171. package/dist/utils/textSelection.mjs +1 -0
  172. package/dist/utils/units.d.mts +78 -0
  173. package/dist/utils/units.mjs +1 -0
  174. package/dist/variableDetector-Borj29SF.d.mts +115 -0
  175. package/dist/wasm-FZQ5XB2Y.mjs +1 -0
  176. package/dist/wasm-SA237OSP.mjs +1 -0
  177. package/dist/wasm-edit.d.mts +473 -0
  178. package/dist/wasm-edit.mjs +1 -0
  179. package/dist/wasm-layout.d.mts +112 -0
  180. package/dist/wasm-layout.mjs +1 -0
  181. package/dist/wasm-opc.d.mts +16 -0
  182. package/dist/wasm-opc.mjs +1 -0
  183. package/dist/wasm-parse.d.mts +18 -0
  184. package/dist/wasm-parse.mjs +1 -0
  185. package/dist/watermarkApi-DCxjutkg.d.mts +38 -0
  186. package/dist/yrs/index.d.mts +882 -0
  187. package/dist/yrs/index.mjs +1 -0
  188. package/dist/yrs/residentEngineWorker.d.mts +2 -0
  189. package/dist/yrs/residentEngineWorker.mjs +1 -0
  190. package/package.json +365 -0
@@ -0,0 +1,327 @@
1
+ import { Document } from './types/document.mjs';
2
+ import { s as BreakContent, P as Paragraph, R as Run, g as RunContent } from './content-sSHuWw49.mjs';
3
+
4
+ /**
5
+ * Insert Operations Utility
6
+ *
7
+ * Utility functions for inserting content into the document.
8
+ * Provides functions for inserting page breaks, horizontal rules, and other elements.
9
+ */
10
+
11
+ /**
12
+ * Insert position in the document
13
+ */
14
+ interface InsertPosition {
15
+ /** Paragraph index in the document body */
16
+ paragraphIndex: number;
17
+ /** Run index within the paragraph (optional) */
18
+ runIndex?: number;
19
+ /** Character offset within the run (optional) */
20
+ offset?: number;
21
+ }
22
+ /**
23
+ * Create a page break content element
24
+ */
25
+ declare function createPageBreak(): BreakContent;
26
+ /**
27
+ * Create a column break content element
28
+ */
29
+ declare function createColumnBreak(): BreakContent;
30
+ /**
31
+ * Create a text wrapping break (line break)
32
+ */
33
+ declare function createLineBreak(clear?: 'none' | 'left' | 'right' | 'all'): BreakContent;
34
+ /**
35
+ * Create a run containing a page break
36
+ */
37
+ declare function createPageBreakRun(): Run;
38
+ /**
39
+ * Create an empty paragraph with a page break before it
40
+ */
41
+ declare function createPageBreakParagraph(): Paragraph;
42
+ /**
43
+ * Insert a page break at a position in the document
44
+ * This inserts a new paragraph with pageBreakBefore: true
45
+ */
46
+ declare function insertPageBreak(doc: Document, position: InsertPosition): Document;
47
+ /**
48
+ * Create a horizontal rule paragraph
49
+ * Uses a paragraph with bottom border to simulate horizontal rule
50
+ */
51
+ declare function createHorizontalRule(): Paragraph;
52
+ /**
53
+ * Insert a horizontal rule at a position in the document
54
+ */
55
+ declare function insertHorizontalRule(doc: Document, position: InsertPosition): Document;
56
+ /**
57
+ * Check if content is a page break
58
+ */
59
+ declare function isPageBreak(content: RunContent): boolean;
60
+ /**
61
+ * Check if content is a column break
62
+ */
63
+ declare function isColumnBreak(content: RunContent): boolean;
64
+ /**
65
+ * Check if content is a line break
66
+ */
67
+ declare function isLineBreak(content: RunContent): boolean;
68
+ /**
69
+ * Check if content is any type of break
70
+ */
71
+ declare function isBreakContent(content: RunContent): content is BreakContent;
72
+ /**
73
+ * Check if a paragraph has pageBreakBefore
74
+ */
75
+ declare function hasPageBreakBefore(paragraph: Paragraph): boolean;
76
+ /**
77
+ * Count page breaks in a document
78
+ */
79
+ declare function countPageBreaks(doc: Document): number;
80
+ /**
81
+ * Find all page break positions in a document
82
+ */
83
+ declare function findPageBreaks(doc: Document): InsertPosition[];
84
+ /**
85
+ * Remove a page break at a specific position
86
+ */
87
+ declare function removePageBreak(doc: Document, position: InsertPosition): Document;
88
+
89
+ /**
90
+ * Google Fonts Loader
91
+ *
92
+ * Dynamically loads fonts from Google Fonts API with:
93
+ * - Loading state tracking
94
+ * - Duplicate prevention
95
+ * - Callback notifications
96
+ * - Font availability detection
97
+ */
98
+ /**
99
+ * Load a font from Google Fonts
100
+ *
101
+ * @param fontFamily - The font family name to load
102
+ * @param options - Optional configuration
103
+ * @returns Promise resolving to true if font loaded successfully, false otherwise
104
+ */
105
+ declare function loadFont(fontFamily: string, options?: {
106
+ weights?: number[];
107
+ styles?: ('normal' | 'italic')[];
108
+ }): Promise<boolean>;
109
+ /**
110
+ * Load multiple fonts from Google Fonts
111
+ *
112
+ * @param families - Array of font family names to load
113
+ * @param options - Optional configuration
114
+ * @returns Promise resolving when all fonts are loaded (or failed)
115
+ */
116
+ declare function loadFonts(families: string[], options?: {
117
+ weights?: number[];
118
+ styles?: ('normal' | 'italic')[];
119
+ }): Promise<void>;
120
+ /**
121
+ * Check if a font is loaded
122
+ *
123
+ * @param fontFamily - The font family name to check
124
+ * @returns true if the font is loaded, false otherwise
125
+ */
126
+ declare function isFontLoaded(fontFamily: string): boolean;
127
+ /**
128
+ * Enable or disable the editor's automatic Google Fonts lookup.
129
+ *
130
+ * Defaults to enabled. Set to `false` in no-egress embedders (strict CSP,
131
+ * offline) so `loadFont` / `loadFontWithMapping` never inject a
132
+ * `fonts.googleapis.com` stylesheet `<link>`. This gates ONLY the implicit
133
+ * Google Fonts lookup — font URLs you register yourself (the `fonts` prop /
134
+ * `loadFontFromUrl`) are still fetched by the browser, and embedded blobs
135
+ * (`loadFontFromBuffer`) and system fonts still resolve.
136
+ *
137
+ * The flag is page-global (module-level), not per-editor: with multiple
138
+ * editors on one page the last caller wins. Call it before loading documents;
139
+ * disabling does not cancel fetches already in flight. A document font that
140
+ * is neither local nor registered then resolves `loadFont` to `false`
141
+ * silently (no `onFontError`) and renders via its CSS fallback stack.
142
+ *
143
+ * @see isGoogleFontsEnabled
144
+ * @see loadFontFromBuffer
145
+ * @see loadFontFromUrl
146
+ *
147
+ * @public
148
+ */
149
+ declare function setGoogleFontsEnabled(enabled: boolean): void;
150
+ /**
151
+ * Whether the automatic Google Fonts lookup is currently enabled.
152
+ *
153
+ * @see setGoogleFontsEnabled
154
+ *
155
+ * @public
156
+ */
157
+ declare function isGoogleFontsEnabled(): boolean;
158
+ /**
159
+ * Check if any fonts are currently loading
160
+ *
161
+ * @returns true if any fonts are loading, false otherwise
162
+ */
163
+ declare function isLoading(): boolean;
164
+ /**
165
+ * Get list of all loaded fonts
166
+ *
167
+ * @returns Array of loaded font family names
168
+ */
169
+ declare function getLoadedFonts(): string[];
170
+ /**
171
+ * Register a callback to be notified when fonts are loaded
172
+ *
173
+ * @param callback - Function to call when fonts are loaded
174
+ * @returns Cleanup function to remove the callback
175
+ */
176
+ declare function onFontsLoaded(callback: (fonts: string[]) => void): () => void;
177
+ /**
178
+ * Register a callback to be notified when a font fails to load.
179
+ *
180
+ * Adapters subscribe and forward to their `onError` prop. Returns the unsub.
181
+ *
182
+ * @public
183
+ */
184
+ declare function onFontError(callback: (error: Error) => void): () => void;
185
+ /**
186
+ * Check if a font is available on the system using canvas measurement
187
+ *
188
+ * Compares text width with the target font vs a known fallback font (and the
189
+ * opposite fallback, for names that collide with the browser defaults). If
190
+ * the widths differ, the font is available. Reuses one shared canvas; the
191
+ * fallback widths are session constants and memoized.
192
+ *
193
+ * @param fontFamily - The font family name to check
194
+ * @param fallbackFont - Fallback font to compare against
195
+ * @returns true if font is available, false otherwise
196
+ */
197
+ declare function canRenderFont(fontFamily: string, fallbackFont?: string): boolean;
198
+ /**
199
+ * Load a font from a raw buffer (e.g., embedded in DOCX)
200
+ *
201
+ * Call before loading the document when possible: registration marks the
202
+ * family as ours, which is what keeps the metric-compatible Google fallback
203
+ * in play for subsetted faces during the document's font resolution pass.
204
+ * Late registration still self-heals on the next pass. Under
205
+ * `setGoogleFontsEnabled(false)` that fallback fetch is suppressed and
206
+ * glyphs missing from the registered faces render via the CSS stack.
207
+ *
208
+ * @param fontFamily - The font family name
209
+ * @param buffer - Font file buffer (TTF, OTF, WOFF, WOFF2)
210
+ * @param options - Font options
211
+ * @returns Promise resolving when font is loaded
212
+ */
213
+ declare function loadFontFromBuffer(fontFamily: string, buffer: ArrayBuffer, options?: {
214
+ weight?: number | string;
215
+ style?: 'normal' | 'italic';
216
+ }): Promise<boolean>;
217
+ /**
218
+ * Load a font face from a URL (woff2, woff, ttf, otf).
219
+ *
220
+ * Injects an `@font-face` rule pointing at the URL. Multiple weights of the
221
+ * same family can be registered independently. Families registered here are
222
+ * treated as potentially subsetted: the editor still fetches their
223
+ * metric-compatible Google equivalent as a glyph-coverage fallback, unless
224
+ * disabled via `setGoogleFontsEnabled(false)`.
225
+ *
226
+ * @param fontFamily - CSS font-family name to expose
227
+ * @param src - URL to the font file
228
+ * @param options - Optional weight
229
+ * @returns Promise resolving to true if the face became available
230
+ *
231
+ * @public
232
+ */
233
+ declare function loadFontFromUrl(fontFamily: string, src: string, options?: {
234
+ weight?: number | string;
235
+ }): Promise<boolean>;
236
+ /**
237
+ * Declarative description of a single font face to register with the editor.
238
+ *
239
+ * Each entry injects one `@font-face` rule pointing at a URL. Multiple
240
+ * entries can share `family` to register distinct weights as separate faces.
241
+ *
242
+ * For Google Fonts, call `loadFont(family)` directly — the `fonts` prop is
243
+ * for fonts the consumer hosts themselves. For raw bytes already in memory
244
+ * (DOCX-embedded fonts, user uploads), call `loadFontFromBuffer(family, buf)`.
245
+ *
246
+ * @public
247
+ */
248
+ interface FontDefinition {
249
+ /**
250
+ * CSS `font-family` name to expose. Match the family name your documents
251
+ * reference; the browser uses this to look up glyphs when text is rendered.
252
+ */
253
+ family: string;
254
+ /**
255
+ * URL to the font file (woff2, woff, ttf, or otf). The loader injects an
256
+ * `@font-face` rule and lets the browser fetch on demand.
257
+ */
258
+ src: string;
259
+ /**
260
+ * CSS `font-weight` for this face. Defaults to `'normal'` (≈400). Pass a
261
+ * number (`400`, `700`) or a CSS keyword (`'bold'`). Required when one
262
+ * `family` registers multiple weights as separate entries.
263
+ */
264
+ weight?: number | string;
265
+ }
266
+ /**
267
+ * Register a list of custom font faces. Used by the `fonts` prop on
268
+ * `<DocxEditor>` (React + Vue). Idempotent — safe to call on every render.
269
+ *
270
+ * @public
271
+ */
272
+ declare function loadFontDefinitions(defs: ReadonlyArray<FontDefinition> | undefined): Promise<void>;
273
+ /**
274
+ * Mapping from common Office/system fonts to Google Fonts equivalents
275
+ *
276
+ * Google Fonts doesn't have exact matches for many Microsoft fonts,
277
+ * but these are close alternatives that work well for document rendering.
278
+ */
279
+ declare const FONT_MAPPING: Record<string, string>;
280
+ /**
281
+ * Get the Google Fonts equivalent for a font name
282
+ *
283
+ * @param fontName - The original font name from the document
284
+ * @returns The Google Fonts equivalent, or the original name if no mapping exists
285
+ */
286
+ declare function getGoogleFontEquivalent(fontName: string): string;
287
+ /**
288
+ * Load a font, automatically mapping to Google Fonts equivalent if needed.
289
+ * If the font needs mapping, also creates a CSS alias so the original font
290
+ * name works in stylesheets.
291
+ *
292
+ * @param fontFamily - The font family name (may be an Office font)
293
+ * @returns Promise resolving to true if font loaded
294
+ */
295
+ declare function loadFontWithMapping(fontFamily: string): Promise<boolean>;
296
+ /**
297
+ * Load multiple fonts with automatic mapping to Google Fonts equivalents
298
+ *
299
+ * @param families - Array of font family names
300
+ * @returns Promise resolving when all fonts are loaded
301
+ */
302
+ declare function loadFontsWithMapping(families: string[]): Promise<void>;
303
+ /**
304
+ * Preload a list of common document fonts
305
+ *
306
+ * This preloads fonts commonly used in DOCX documents that have
307
+ * Google Fonts equivalents.
308
+ */
309
+ declare function preloadCommonFonts(): Promise<void>;
310
+ /**
311
+ * Extract all font families used in a document
312
+ *
313
+ * Uses loose typing to handle any document-like structure.
314
+ *
315
+ * @param document - The parsed document
316
+ * @returns Set of unique font family names
317
+ */
318
+ declare function extractFontsFromDocument(document: unknown): Set<string>;
319
+ /**
320
+ * Extract fonts from a document and load them from Google Fonts
321
+ *
322
+ * @param document - The parsed document
323
+ * @returns Promise resolving when fonts are loaded
324
+ */
325
+ declare function loadDocumentFonts(document: unknown): Promise<void>;
326
+
327
+ export { setGoogleFontsEnabled as A, type FontDefinition as B, extractFontsFromDocument as C, getGoogleFontEquivalent as D, loadDocumentFonts as E, FONT_MAPPING as F, loadFontDefinitions as G, loadFontFromUrl as H, type InsertPosition as I, loadFontWithMapping as J, loadFontsWithMapping as K, onFontError as L, countPageBreaks as a, createColumnBreak as b, canRenderFont as c, createHorizontalRule as d, createLineBreak as e, createPageBreak as f, createPageBreakParagraph as g, createPageBreakRun as h, findPageBreaks as i, getLoadedFonts as j, hasPageBreakBefore as k, insertHorizontalRule as l, insertPageBreak as m, isBreakContent as n, isColumnBreak as o, isFontLoaded as p, isLoading as q, isGoogleFontsEnabled as r, isLineBreak as s, isPageBreak as t, loadFont as u, loadFontFromBuffer as v, loadFonts as w, onFontsLoaded as x, preloadCommonFonts as y, removePageBreak as z };