import { type ImageResolver } from "./image.js"; import { type StyleResolver } from "./style-resolver.js"; /** * Diagnostic callback for conditions that don't fail the conversion but silently * degrade the output (an image that never embeds, styling that never applies). * Pass `null` to suppress the default `console.warn`. */ export type WarningHandler = (message: string) => void; /** Page/font/metadata options (Tier 1 `ConvertOptions`). All lengths in inches / points. */ export interface DocumentConfig { /** `"letter"` (default), `"a4"`, or a custom size in inches. */ pageSize?: "letter" | "a4" | { width: number; height: number; }; orientation?: "portrait" | "landscape"; /** Page margins in inches (each side defaults to 1). */ margins?: { top?: number; right?: number; bottom?: number; left?: number; }; /** Default body font family and size (points). */ defaultFont?: { family?: string; sizePt?: number; }; /** Core document properties written to `docProps/core.xml`. */ metadata?: { title?: string; subject?: string; creator?: string; keywords?: string[]; description?: string; }; /** HTML fragment rendered as the page header (its own inline-styled fragment). */ headerHtml?: string; /** HTML fragment rendered as the page footer. */ footerHtml?: string; /** * Append a page-number paragraph to the footer (created if `footerHtml` is absent). * - `true` — shorthand for `"Page {page}"` * - `string` — template with `{page}` and/or `{pages}` sugar, e.g. `"{page} / {pages}"` * * Prefer `` markers in chrome HTML for full control; * `{page}` / `{pages}` lower to the same markers. See allowlist in API.md. */ pageNumber?: boolean | string; /** Document language (spell-check locale), e.g. `"en-US"`, `"ar-SA"`. */ lang?: string; /** Text direction; `"rtl"` sets right-to-left paragraphs. */ direction?: "ltr" | "rtl"; /** * HTML fragment rendered as a cover page: the first content in the document, * before the table of contents (if any), followed by an automatic page break so * the TOC/body start on the next page. Uses the inline style path like * `headerHtml`/`footerHtml` — inline `style="…"` and `data:` images (e.g. a logo) * work. When a header/footer/page number is configured, it is suppressed on the * cover page (Word "different first page"). */ coverHtml?: string; /** * HTML fragment rendered as a table-of-contents "slot": placed after the cover * page (if any) and before the body. You control the markup and styling — a * numbered or boxed list, columns, whatever — and in-page links (``) * jump to the matching `id` in the body (dom-docx bookmarks `id` attributes). Add * a trailing `
` if you want it on its own page. */ tocHtml?: string; } /** Platform-neutral DOCX bytes from an HTML body fragment and style resolver. */ export declare function buildDocxUint8Array(html: string, styleResolver: StyleResolver, imageResolver?: ImageResolver, documentConfig?: DocumentConfig, onWarning?: WarningHandler | null): Promise; /** Browser entry — returns a `.docx` Blob. */ export declare function buildDocxBlob(html: string, styleResolver: StyleResolver, imageResolver?: ImageResolver, documentConfig?: DocumentConfig, onWarning?: WarningHandler | null): Promise; //# sourceMappingURL=build-docx.d.ts.map