Document
insertTextNode(options)⇒ object | undefined
object | undefinedParameters
Param
Type
Description
Example
// Insert new empty paragraph at cursor position (or last if no cursor in text)
import {api} from 'writer'
api.document.insertTextNode()Example
// Insert a preamble with content after the first node in the document as part of your own transaction
import {api} from 'writer'
const firstNode = api.document.nodes()
api.editorSession.transaction(tx => {
api.document.insert({
tx: tx,
type: 'preamble',
text: 'My new preamble',
mode: 'after',
refNode: nodes[0] // First node
})
})insertBlockNode(options)⇒ object | undefined
object | undefinedParameters
Param
Type
Description
Example
Example
nodes(filter)⇒ array
arrayParameters
Param
Type
Default
Description
Example
node(nodeId)⇒ Node | null
Node | nullParameters
Param
Type
Example
triggerFetchResourceNode(node, info)
Parameters
Param
Type
Description
Example
getPreviousNode(nodeId)⇒ *
*Parameters
Param
Type
deleteNode(name, node, options)
Parameters
Param
Type
Description
Example
getDocumentNodes()⇒ Array
Array