Skip to content
lit-docx
Developer docs
Preview · unreleased

API reference

Public functions, types and errors for reading and generating DOCX, with signatures generated from source.

The signatures and descriptions below are extracted automatically from the public entry of @quirekit/lit-docx. For LitAST node types, see The LitAST node model.

Reading

parseDocx

@quirekit/lit-docxCommercial license

Parses DOCX bytes into LitAST. Runs in browsers and Node; no file-system access is needed. @param buffer - Complete DOCX file bytes. @param options - Optional parsing behavior. @returns The document tree and non-fatal warnings. @throws DocxPackageError when the bytes are not a ZIP package, or are an OLE container such as an encrypted document or legacy `.doc`.

parseDocxts

ParseOptions

@quirekit/lit-docxCommercial license

Options accepted by `parseDocx`.

ParseOptionsts

ParseResult

@quirekit/lit-docxCommercial license

Result of `parseDocx`: the document tree and every non-fatal problem found while reading it.

ParseResultts

ParseWarning

@quirekit/lit-docxCommercial license

One non-fatal problem found while parsing.

ParseWarningts

DocxPackageError

@quirekit/lit-docxCommercial license

Typed failure raised before document-part parsing begins.

DocxPackageErrorts

Generating

generateDocx

@quirekit/lit-docxCommercial license

Generates a complete DOCX file from LitAST, rebuilding the whole package from the tree. Runs in browsers and Node. @param ast - Document AST root. @returns Complete DOCX ZIP bytes.

generateDocxts
lit-docx · QuireKitA DOCX parser and generator, licensed under AGPL-3.0 with a commercial option.