Node
is not a publicly accessible module, but instead an interface that Document
, Block
and Inline
all implement.
- Properties
- Computed Properties
- Retrieval Methods
filterDescendants
findDescendant
getBlocksAtRange
getBlocks
getCharactersAtRange
getChild
getClosestBlock
getClosestInline
getClosest
getDepth
getDescendant
getFragmentAtRange
getInlinesAtRange
getMarksAtRange
getNextBlock
getNextSibling
getNextText
getParent
getPreviousBlock
getPreviousSibling
getPreviousText
getTextAtOffset
getTextsAtRange
hasChild
hasDescendant
- Transform Methods
Immutable.List
A list of child nodes. Defaults to a list with a single text node child.
String
An immutable string value of 'block'
for easily separating this node from Inline
or Text
nodes.
Number
The sum of the lengths of all of the descendant Text
nodes of this node.
String
A concatenated string of all of the descendant Text
nodes of this node.
filterDescendants(iterator: Function) => List
Deeply filter the descendant nodes of a node by iterator
.
findDescendant(iterator: Function) => Node || Void
Deeply find a descendant node by iterator
.
getBlocksAtRange(range: Selection) => List
Get all of the bottom-most Block
nodes in a range
.
getBlocks() => List
Get all of the bottom-most Block
node descendants.
getCharactersAtRange(range: Selection) => List
Get a list of all of the Charaters
in a range
.
getChild(key: Key || Node) => Node || Void
Get a child by key
.
getClosestBlock(key: String || Node) => Node || Void
Get the closest Block
node to a descendant node by key
.
getClosestInline(key: String || Node) => Node || Void
Get the closest Inline
node to a descendant node by key
.
getClosest(key: String || Node, match: Function) => Node || Void
Get the closest parent node of a descendant node by key
that matches a match
function.
getDepth(key: String || Node) => Number
Get the depth of a descendant node by key
.
getDescendant(key: String || Node) => Node || Void
Get a descendant node by key
.
getFragmentAtRange(range: Selection) => Document
Get a document fragment of the nodes in a range
.
getInlinesAtRange(range: Selection) => List
Get all of the top-most Inline
nodes in a range
.
getMarksAtRange(range: Selection) => Set
Get a set of all of the marks in a range
.
getNextBlock(key: String || Node) => Node || Void
Get the next, bottom-most Block
node after a descendant by key
.
getNextSibling(key: String || Node) => Node || Void
Get the next sibling of a descendant by key
.
getNextText(key: String || Node) => Node || Void
Get the next Text
node after a descendant by key
.
getParent(key: String || Node) => Node || Void
Get the parent node of a descendant by key
.
getPreviousBlock(key: String || Node) => Node || Void
Get the previous, bottom-most Block
node before a descendant by key
.
getPreviousSibling(key: String || Node) => Node || Void
Get the previous sibling of a descendant by key
.
getPreviousText(key: String || Node) => Node || Void
Get the previous Text
node before a descendant by key
.
getTextAtOffset(offset: Number) => Text || Void
Get the Text
node at an offset
.
getTextsAtRange(range: Selection) => List
Get all of the Text
nodes in a range
.
hasChild(key: String || Node) => Boolean
Check whether the node has a child node by key
.
hasDescendant(key: String || Node) => Boolean
Check whether the node has a descendant node by key
.
Since nodes are immutable, all of the transform methods return a new copy of the node in question.
mapDescendants(iterator: Function) => Node
Map all of the descendant nodes of a node through an iterator
function.
removeDescendant(key: String || Node) => Node
Remove a descendant node from the tree by key
.
updateDescendant(node: Node) => Node
Update a descendant node
to the new value.