1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-25 08:11:53 +02:00

docs: Add API reference for NodeEntry

This commit is contained in:
Sunny Hirai
2021-06-06 13:01:31 -07:00
parent d8dde5be3d
commit 33083833fb
3 changed files with 11 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ type Ancestor = Editor | Element
```
- [Node](./node.md)
- [NodeEntry](./node-entry.md)
- [Editor](./editor.md)
- [Element](./element.md)
- [Text](./text.md)

View File

@@ -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 extends Node = Node> = [T, Path]
```