IPlugin<T\>
Updated 9 Nov 2026
Defined in: packages/core/src/utils/index.ts:242
Interface for extending MDAST to DOCX conversion using plugins.
Type Parameters
T
Properties
block?
optional block?: (docx, node, paraProps, blockChildrenProcessor, inlineChildrenProcessor) => (Paragraph | Table)[]
Defined in: packages/core/src/utils/index.ts:246
Processes block-level MDAST nodes and converts them to DOCX elements.
Parameters
docx
__module
node
ExtendedRootContent<T>
paraProps
MutableParaOptions
blockChildrenProcessor
BlockNodeChildrenProcessor
inlineChildrenProcessor
InlineChildrenProcessor
Returns
(Paragraph | Table)[]
inline?
optional inline?: (docx, node, runProps, definitions, footnoteDefinitions, inlineChildrenProcessor) => InlineDocxNodes[]
Defined in: packages/core/src/utils/index.ts:257
Processes inline-level MDAST nodes and converts them to DOCX runs.
Parameters
docx
__module
node
ExtendedRootContent<T>
runProps
MutableRunOptions
definitions
Definitions
footnoteDefinitions
FootnoteDefinitions
inlineChildrenProcessor
InlineChildrenProcessor
Returns
InlineDocxNodes[]
postprocess?
optional postprocess?: (sections) => void | Promise<void>
Defined in: packages/core/src/utils/index.ts:289
Post-processes the final DOCX document after conversion. Plugins can use this for cleanup or applying final transformations.
Parameters
sections
DocxSection[]
Returns
void | Promise<void>
preprocess?
optional preprocess?: (tree, definitions, docxProps?) => void | Promise<void>
Defined in: packages/core/src/utils/index.ts:279
Preprocesses the MDAST tree before the DOCX conversion begins.
Parameters
tree
definitions
Definitions
docxProps?
Returns
void | Promise<void>
root?
optional root?: (props, astInputs?) => void
Defined in: packages/core/src/utils/index.ts:271
Modifies document-level DOCX properties, such as styles, numbering, headers, or footers. Useful for applying global formatting customizations.
Parameters
props
astInputs?
Root | object[]
Returns
void
Deprecated
Use preprocess(tree, definitions, docxProps) instead.