import { Document } from 'slate'
The top-level node in Slate's document model.
Documents are made up of block nodes, inline nodes, and text nodes—just like in the DOM.
In some places, you'll see mention of "fragments", which are also Document
objects, just that aren't attached to the main State
. For example, when cutting-and-pasting a selection of content, that content will be referred to as a document "fragment".
Document({
nodes: Immutable.List<Node>,
})
Immutable.List
A list of child nodes.
String
An immutable string value of 'document'
for easily separating this node from Block
, 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.
Document.create(properties: Object) => Document
Create a block from a plain Javascript object of properties
.
Documents implement the Node
interface. For information about all of the node methods, see the Node
reference.