Lifecycle
06createDocx({ paragraphs? }?) => DocxopenDocx(bytes: Uint8Array) => DocxfromBlob(blob: Blob) => Promise<Docx>toUint8Array(doc: Docx) => Uint8ArraytoBlob(doc: Docx) => Blobclone(doc: Docx) => Docx
§ 03 · API reference
@office-kit/docx exposes 121 standalone functions
and constants. Each one takes a Docx as its first argument (where
applicable) and is side-effect-free at the module level, so bundlers can tree-shake
anything you don't import. For full signatures and parameter shapes, see src/index.ts and the repository.
createDocx ({ paragraphs? }?) => DocxopenDocx (bytes: Uint8Array) => DocxfromBlob (blob: Blob) => Promise<Docx>toUint8Array (doc: Docx) => Uint8ArraytoBlob (doc: Docx) => Blobclone (doc: Docx) => DocxappendParagraph insertParagraphAt removeParagraph appendHeading appendPageBreak appendLineBreak appendSectionBreak clearBody paragraphs replaceText replaceTextEverywhere findText findTextEverywhere appendTextRun setParagraphText paragraphText setRunFormat clearRunFormat getRunFormat setParagraphAlignment getParagraphAlignment setParagraphIndent setParagraphSpacing setParagraphBorders setParagraphShading getParagraphStyle getParagraphNumbering mergeAdjacentRuns mergeAdjacentRunsInBody addStyle removeStyle listStyles ensureHeadingStyles findStyleIdByName setParagraphStyle addBulletList addNumberedList applyListToParagraph mergeStylesFromTemplate addTable tables removeTable removeAllTables unwrapTable appendTableRow removeTableRow setTableRowAsHeader setTableRowHeight setTableBorders setTableCellText getTableCellText setTableCellShading setTableCellVerticalAlign addImage addImageRun insertImageInto images imageReferences replaceImage replaceImageByAltText removeAllImages addHeader addFooter addPageNumberFooter setPageSize setPageMargins setPageOrientation headers footers removeAllHeaders removeAllFooters addComment addFootnote addEndnote removeAllComments removeAllFootnotes removeAllEndnotes addHyperlink addInternalHyperlink externalHyperlinks setHyperlinkUrl removeAllHyperlinks addBookmark removeBookmark removeAllBookmarks bookmarks appendField addTableOfContents appendMergeField acceptAllRevisions rejectAllRevisions coreProperties setCoreProperties appProperties setAppProperties title author setTitle setAuthor validate validatePackage statistics outline fields text stylesPart numberingPart commentsPart footnotesPart endnotesPart PAGE_SIZE_A4 PAGE_SIZE_LETTER MARGINS_NORMAL VERSION previewToDOM (source, container, options?) => Promise<Handle>Need usage shapes? Read the getting-started page or the type-checked recipes.