diff --git a/docs/Summary.md b/docs/Summary.md index aa0f3a587..47390569a 100644 --- a/docs/Summary.md +++ b/docs/Summary.md @@ -35,6 +35,7 @@ - [Editor](api/nodes/editor.md) - [Element](api/nodes/element.md) - [Node](api/nodes/node.md) + - [NodeEntry](api/nodes/node-entry.md) - [Text](api/nodes/text.md) - [Location Types](api/locations/README.md) - [Location](api/locations/location.md) diff --git a/docs/api/nodes/README.md b/docs/api/nodes/README.md index 5a1fe83c9..6c4b1667b 100644 --- a/docs/api/nodes/README.md +++ b/docs/api/nodes/README.md @@ -10,6 +10,7 @@ type Ancestor = Editor | Element ``` - [Node](./node.md) +- [NodeEntry](./node-entry.md) - [Editor](./editor.md) - [Element](./element.md) - [Text](./text.md) diff --git a/docs/api/nodes/node-entry.md b/docs/api/nodes/node-entry.md new file mode 100644 index 000000000..9ad817eca --- /dev/null +++ b/docs/api/nodes/node-entry.md @@ -0,0 +1,9 @@ +# NodeEntry + +`NodeEntry` objects are returned when iterating over the nodes in a Slate document tree. They consist of the node and its `Path` relative to the root node in the document. + +They are generics meaning that sometimes they will return a subset of `Node` types like an `Element` or `Text`. + +```typescript +type NodeEntry = [T, Path] +```