Node

Node is not a publicly accessible module, but instead an interface that Document, Block and Inline all implement.

Properties

key

String

A short-lived, unique identifier for the node.

By default, keys are not meant to be long-lived unique identifiers for nodes that you might store in a database, or elsewhere. They are meant purely to identify a node inside of a single Slate instance. For that reason, they are simply auto-incrementing strings. (eg. '0', '1', '2', ...)

If you want to make your keys uniqueness long-lived, you'll need to supply your own key generating function via the setKeyGenerator util.

nodes

Immutable.List

A list of child nodes. Defaults to a list with a single text node child.

object

String

An immutable string value of 'document', 'block', 'inline' or 'text' for easily separating this node from Inline or Text nodes.

Computed Properties

text

String

A concatenated string of all of the descendant Text nodes of this node.