New

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

API Referencev1.0.2

@eigenpal/docx-editor-core/utils/headingCollector

Functions(1)

Collect all headings from a ProseMirror document.

Detection logic: 1. Check `outlineLevel` attr (set by OOXML parsing or style resolution) 2. Fallback to `styleId` matching /^[Hh]eading(d)$/

declare function collectHeadings(doc: Node): HeadingInfo[];

Interfaces(1)

Information about a heading found in the document.

interface HeadingInfo
MemberTypeSummary
levelnumberOutline level (0 = Heading 1, 1 = Heading 2, etc.)
pmPosnumberProseMirror document position of the paragraph node
textstringThe text content of the heading