@docx-editor.dev/core/api
Stable DOM-facing rendering facade.
This module intentionally exposes only browser and document vocabulary. The page-flow, measurement, and paint models behind it are implementation details and may change without affecting this contract.
Functions (3)
caretAtfunctionSource ↗
Return the root-local CSS-pixel caret box for a body document position.
Header and footer positions live in separate ProseMirror documents and are deliberately not searched by this backward-compatible numeric API.
declare function caretAt(document: RenderedDocument, position: number): RenderedBox | null;rectsForfunctionSource ↗
Return root-local CSS-pixel boxes for a half-open body position range.
The result may contain boxes from multiple pages. Header/footer ranges are excluded because their numeric positions belong to independent documents.
declare function rectsFor(document: RenderedDocument, from: number, to: number): readonly RenderedBox[];renderDocumentfunctionSource ↗
Render an OOXML document into paged DOM below root.
The returned coordinates are CSS pixels relative to the root. Calling this again replaces the current painted pages with a fresh rendering.
declare function renderDocument(document: Document, root: HTMLElement): RenderedDocument;Interfaces (3)
RenderedBoxinterfaceSource ↗
A CSS-pixel rectangle within a rendered document.
interface RenderedBox| Member | Type | Summary |
|---|---|---|
| docFrom? | number | |
| docTo? | number | |
| height | number | |
| pageIndex | number | |
| region | RenderedRegion | |
| width | number | |
| x | number | |
| y | number |
RenderedDocumentinterfaceSource ↗
A snapshot of the pages currently painted below a DOM root.
interface RenderedDocument| Member | Type | Summary |
|---|---|---|
| pages | readonly RenderedPage[] | |
| root | HTMLElement |
RenderedPageinterfaceSource ↗
One painted page and the positioned DOM boxes it contains.
interface RenderedPage| Member | Type | Summary |
|---|---|---|
| boxes | readonly RenderedBox[] | |
| element | HTMLElement |
Type aliases (1)
RenderedRegiontypeSource ↗
The independent ProseMirror position space that owns a painted box.
type RenderedRegion = 'body' | 'header' | 'footer';