Content Methods
getHTML
Get document as HTML string.
Configuration options
string
- HTML representation
getJSON
Get document as ProseMirror JSON.
Returns: Object
- ProseMirror document JSON
getUpdatedJson
Get JSON prepared for export with comment processing.
Returns: Object
- Export-ready JSON
Export Methods
exportDocx
Export document as DOCX file.
Export configuration
Promise<Blob>
- DOCX file blob
loadXmlData
Load and parse DOCX file data.
DOCX file source
Whether running in Node.js
Promise<[xmlFiles, mediaUrls, mediaBase64, fonts]>
Editor Control
mount
Mount editor to DOM element.
Target DOM element
unmount
Unmount editor from DOM (keeps instance alive).
destroy
Completely destroy editor and clean up.
This is irreversible. The editor instance cannot be used after calling destroy.
focus
Focus the editor.
setEditable
Set editor editability.
Whether editor should be editable
Whether to emit update event
Mode Control
setDocumentMode
Change document editing mode.
Document mode
Command Methods
chain
Create a command chain.
Returns: ChainedCommands
- Chainable command object
can
Check if commands can run without executing.
Returns: Commands
- Commands in check mode
Direct Commands
Access all commands directly.insertContent
Insert content into the document with automatic format detection.
Content to insert (HTML, Markdown, text, or JSON)
Insert options
boolean
- Success status
When importing HTML or Markdown, all inline styles are removed to ensure Word compatibility.
Content Manipulation
replaceContent
Replace entire editor content.
ProseMirror JSON content
replaceNodeWithHTML
Replace specific node with HTML.
ProseMirror node to replace
HTML replacement
replaceFile
Replace current DOCX file.
New DOCX file
Promise<void>
Annotation Methods
These methods are available with the field-annotation extension.
annotate
Apply field annotations to document.
Annotation values
Field IDs to hide
Remove empty fields
previewAnnotations
Preview annotations (reversible).
Annotation values
Field IDs to hide
closePreview
Revert annotation preview.
Search Methods
search
Search for text or regex.
Search query
Array<SearchResult>
- Search matches
Utility Methods
getNodesOfType
Get all nodes of specific type.
Node type name
Array<Node>
- Matching nodes
isActive
Check if node or mark is active.
Node/mark name or attributes
Additional attributes to check
boolean
- Whether active
getAttributes
Get attributes of active node or mark.
Name or type to get attributes for
Object
- Attributes
Properties
ProseMirror EditorState
ProseMirror EditorView
ProseMirror Schema
All available commands
Extension helper methods
Extension storage
Whether editor is editable
Whether editor is destroyed
Whether editor has focus