/** * Compile a processed document into DocxIR. * * The input is the authoring tree after schema validation, custom-component * expansion, theme resolution and component defaults (`ProcessedDocument`), * paired with the section and column plan (`LayoutPlan`). What remains, and * what this module does, is the last mile: the inline mini-language becomes * inline nodes, points become twips and half-points, theme colour tokens become * hex, and a font weight becomes the family alias it resolves to. * * No renderer is imported here, and none may be. The output is plain data. * * Scope: this is the first vertical slice — document metadata and settings, * sections and page setup, headers and footers, paragraphs and headings with * their runs, bookmarks, inline images and simple tables. Anything outside it * is reported through `unsupported`, so a caller can tell "not yet compiled" * from "compiled to nothing", and the default pipeline stays on the pre-IR path * until the gap closes. */ import { type FeatureRequirement } from '@json-to-office/shared/rendering'; import type { GenerationWarning } from '@json-to-office/shared'; import type { LayoutPlan } from '../core/layout'; import type { ProcessedDocument } from '../core/structure'; import type { ImageResources } from '../core/imageResources'; import type { DocxFeature } from './features'; import { type DocxIR } from './types'; /** A component the compiler does not yet lower into IR. */ export interface UnsupportedComponent { name: string; path: string; /** What about it is not handled, when the component itself is. */ detail?: string; } export interface DocxCompileResult { ir: DocxIR; /** Backend capabilities the IR needs, with the IR path that needs them. */ required: readonly FeatureRequirement[]; warnings: GenerationWarning[]; /** * What the compiler could not lower. Empty once the migration is complete; * until then this is what keeps the pre-IR path authoritative instead of * silently dropping content. */ unsupported: UnsupportedComponent[]; } export declare function compileDocument(structure: ProcessedDocument, layout: LayoutPlan, warnings?: GenerationWarning[], images?: ImageResources, options?: { echoWarnings?: boolean; }): DocxCompileResult; //# sourceMappingURL=compiler.d.ts.map