/** * DocxIR → docx.js objects. * * Each function maps one IR node onto the option bag docx.js expects. Every * cascade, default and unit conversion already happened in the compiler, so * this layer only translates vocabulary — with two exceptions that are * genuinely properties of *this* backend: * * - A line break is not a node here. docx.js expresses it as `break: 1` on the * run that follows, so a `lineBreak` in the IR is folded into the next run. * - A tab is a run containing a `Tab`, because a tab character inside `` * is dropped by Word and paragraph tab stops only bind to real tab runs. */ import { AlignmentType, Paragraph, Table, TableOfContents, type IParagraphOptions, type IRunOptions, type ParagraphChild } from 'docx'; import type { DocxIrBlock, DocxIrFloating, DocxIrImageRun, DocxIrInline, DocxIrParagraph, DocxIrParagraphFormatting, DocxIrRunFormatting, DocxIrTable } from '../../ir/types'; export declare const ALIGNMENT: Readonly>; /** * Image runs, keyed by IR resource id. * * docx.js needs an `ImageRun` object, and building one for a vector image is * asynchronous — it rasterises a fallback. So the renderer builds them all * before the document, and this layer only places them. */ export type EmitResources = ReadonlyMap; /** Builds the run for one placement, which carries its own size and anchor. */ export type ImageRunFactory = (image: DocxIrImageRun) => ParagraphChild; export declare function runOptions(formatting: DocxIrRunFormatting | undefined): IRunOptions; /** * Turn inline nodes into paragraph children. * * `pendingBreaks` carries a run of `lineBreak` nodes forward onto whichever run * comes next, which is where docx.js puts them. */ export declare function inlineChildren(children: readonly DocxIrInline[], resources?: EmitResources): ParagraphChild[]; /** An IR anchor as docx.js floating options. */ export declare function floatingOptions(floating: DocxIrFloating): Record; export declare function paragraphOptions(formatting: DocxIrParagraphFormatting | undefined): Partial; export declare function emitParagraph(block: DocxIrParagraph, resources?: EmitResources): Paragraph; export declare function emitBlock(block: DocxIrBlock, resources?: EmitResources): Paragraph | Table | TableOfContents; export declare function emitTable(block: DocxIrTable, resources?: EmitResources): Table; //# sourceMappingURL=emit.d.ts.map