import { type DocumentConfig, type WarningHandler } from "./converter/build-docx.js"; import type { ImageResolver } from "./converter/image.js"; import { type RasterizeInPlaceOptions } from "./converter/rasterize-subtree.browser.js"; import { type StyleSource } from "./converter/style-resolver.js"; export type { ImageResolver, ResolvedImage } from "./converter/image.js"; export type { StyleResolver, StyleSource } from "./converter/style-resolver.js"; export type { DocumentConfig, WarningHandler } from "./converter/build-docx.js"; export type { RasterizeInPlaceOptions } from "./converter/rasterize-subtree.browser.js"; export { buildDocxBlob, buildDocxUint8Array } from "./converter/build-docx.js"; export { snapshotComputedStylesFromDocument } from "./converter/computed-style-snapshot.js"; export { isSimpleSvgElement, rasterizeInPlace } from "./converter/rasterize-subtree.browser.js"; export interface BrowserConvertOptions extends DocumentConfig { styleSource?: StyleSource; /** Document to snapshot for `styleSource: "computed"`. Defaults to the host page. */ document?: Document; /** * Export root for `styleSource: "computed"`. Pass the live element whose `innerHTML` * you convert so computed-style paths match the fragment tree (SPA export pattern). */ root?: Element; /** * Rasterize `` and complex `` (e.g. Highcharts) under `root` to PNG `` * before conversion. Requires `root`. Clones off-screen by default so the live page is * not mutated; pass `{ mutate: true }` to replace charts in the caller's DOM. */ rasterizeInPlace?: boolean | RasterizeInPlaceOptions; /** Resolve non-`data:` `` before conversion (caller owns fetch policy). */ imageResolver?: ImageResolver; /** * Called for conditions that don't fail the conversion but silently degrade the * output — e.g. images with no `imageResolver` (or that it couldn't resolve), or * class/stylesheet-based CSS ignored on the default `"inline"` `styleSource`. * Defaults to `console.warn`; pass `null` to suppress. */ onWarning?: WarningHandler | null; } export declare function convertHtmlToDocxUint8Array(html: string, options?: BrowserConvertOptions): Promise; /** * Convert an HTML body fragment to a `.docx` Blob in the browser. * * - `inline` (default): parses `style=""` only — no live DOM required for styles. * - `computed`: batch-reads `getComputedStyle` from the export root (or full `document.body` * when `root` is omitted). Pass `root` when converting `element.innerHTML` from a live SPA. * - `rasterizeInPlace`: rasterize `` / chart `` under `root` to PNG `` first * (requires `root`; clones off-screen by default). */ export declare function convertHtmlToDocx(html: string, options?: BrowserConvertOptions): Promise; export interface DomDocxGlobal { convertHtmlToDocx: typeof convertHtmlToDocx; convertHtmlToDocxUint8Array: typeof convertHtmlToDocxUint8Array; } declare global { interface Window { domDocx?: DomDocxGlobal; } } //# sourceMappingURL=browser.d.ts.map