import type { Browser, Page } from "playwright"; import { type StyleResolver, type StyleSource } from "./converter/style-resolver.js"; import type { ImageResolver } from "./converter/image.js"; import type { DocumentConfig, WarningHandler } from "./converter/build-docx.js"; import type { RasterizeInPlaceOptions } from "./converter/rasterize-subtree.browser.js"; export type { StyleResolver, StyleSource } from "./converter/style-resolver.js"; export type { ImageResolver, ResolvedImage } from "./converter/image.js"; export type { DocumentConfig, WarningHandler } from "./converter/build-docx.js"; export type { RasterizeInPlaceOptions } from "./converter/rasterize-subtree.browser.js"; export { buildDocxUint8Array, buildDocxBlob } from "./converter/build-docx.js"; export interface ConvertOptions extends DocumentConfig { styleSource?: StyleSource; /** Reuse an open Playwright browser for computed style resolution (benchmark loops). */ browser?: Browser; /** * Browser-native computed styles: read from this already-rendered page's ambient DOM * instead of spawning a fresh page. Used when `styleSource: "computed"` or * `rasterizeInPlace` needs a live Chromium context. */ page?: Page; /** * CSS selector for the export root when converting `element.innerHTML` from a live page * (must match the node whose innerHTML was passed as `html`). Playwright `page` path only. */ rootSelector?: string; /** * Rasterize `` and complex `` (e.g. Highcharts) under the export root to PNG * `` before conversion. Uses the same Playwright/Chromium context as computed styles. * Ephemeral spawn pages mutate in place by default; live `page` + `rootSelector` clones * off-screen unless `{ mutate: true }`. */ rasterizeInPlace?: boolean | RasterizeInPlaceOptions; /** * Resolve non-`data:` `` (e.g. `http(s):` / `file:`). The library never fetches * on its own — supply this hook to enable remote/local images, and own the fetch plus its * security policy (host allowlist, SSRF/private-IP blocking, auth, size caps). Without it, * only inline `data:` URLs embed; other images fall back to alt text. */ 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 buildDocxBuffer(html: string, styleResolver: StyleResolver, imageResolver?: ImageResolver, docConfig?: DocumentConfig, onWarning?: WarningHandler | null): Promise; export declare function convertHtmlToDocx(html: string, options?: ConvertOptions): Promise; //# sourceMappingURL=converter.d.ts.map