1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-24 07:52:50 +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

@@ -35,6 +35,7 @@
- [Editor](api/nodes/editor.md) - [Editor](api/nodes/editor.md)
- [Element](api/nodes/element.md) - [Element](api/nodes/element.md)
- [Node](api/nodes/node.md) - [Node](api/nodes/node.md)
- [NodeEntry](api/nodes/node-entry.md)
- [Text](api/nodes/text.md) - [Text](api/nodes/text.md)
- [Location Types](api/locations/README.md) - [Location Types](api/locations/README.md)
- [Location](api/locations/location.md) - [Location](api/locations/location.md)

View File

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