API Referencev1.0.2
@eigenpal/docx-editor-core/utils/headingCollector
Functions(1)
fn
packages/core/src/utils/headingCollector.ts:27collectHeadings
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)
interface
packages/core/src/utils/headingCollector.ts:11HeadingInfo
Information about a heading found in the document.
interface HeadingInfo| Member | Type | Summary |
|---|---|---|
| level | number | Outline level (0 = Heading 1, 1 = Heading 2, etc.) |
| pmPos | number | ProseMirror document position of the paragraph node |
| text | string | The text content of the heading |