New

docx-editor 1.x has shipped. Vue support, i18n, agents. Read the migration guide →

API Referencev1.3.3

@eigenpal/docx-editor-core/docx/serializer

DOCX XML Serializers

Lower-level Document → OOXML transforms. For the round-trip "model in, `.docx` archive out" path, use `./docx` instead.

Functions(11)

Serialize a single block content item (paragraph, table, or block SDT).

Exported so the footnote/endnote serializer can reuse the exact same block-level emission the document body uses — preserving tracked-change wrappers (`w:ins`/`w:del`), paragraph/run properties, fields, and tables inside note bodies instead of reimplementing a minimal serializer.

declare function serializeBlockContent(block: BlockContent): string;

Serialize comments array to comments.xml content (backwards-compatible wrapper)

declare function serializeComments(comments: Comment[]): string;

Serialize a complete Document to valid document.xml

declare function serializeDocument(doc: Document): string;

Serialize a DocumentBody to document.xml body content

declare function serializeDocumentBody(body: DocumentBody): string;

Serialize endnotes to word/endnotes.xml content.

declare function serializeEndnotes(endnotes: Endnote[]): string;

Serialize footnotes to word/footnotes.xml content.

declare function serializeFootnotes(footnotes: Footnote[]): string;

Serialize a HeaderFooter object to valid OOXML XML

declare function serializeHeaderFooter(hf: HeaderFooter): string;

Serialize a paragraph to OOXML XML (w:p)

declare function serializeParagraph(paragraph: Paragraph): string;

Serialize a run to OOXML XML (w:r)

declare function serializeRun(run: Run): string;
fn

serializeSectionProperties

packages/core/src/core.ts:36

Serialize section properties (w:sectPr)

declare function serializeSectionProperties(props: SectionProperties | undefined): string;

Serialize a table to OOXML XML (w:tbl)

declare function serializeTable(table: Table): string;