Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Dec 18, 2024
1 parent 4c8ffab commit 68a0f3a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-cooks-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/slate-utils': patch
---

Add `getFirstNodeText`
5 changes: 5 additions & 0 deletions .changeset/happy-buses-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/slate': patch
---

export type NodeTextsOptions
16 changes: 16 additions & 0 deletions apps/www/content/docs/api/slate-utils.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ Retrieves a consistent property value from a fragment of nodes.
The consistent property value found in the fragment, or undefined if no consistent value is found.
</APIReturns>

### getFirstNodeText

Gets the first text node from a node.

<APIParameters>
<APIItem name="root" type="TNode">
The root node to search for text nodes.
</APIItem>
<APIItem name="options" type="NodeTextsOptions<N, R>" optional>
Options for getting node texts.
</APIItem>
</APIParameters>
<APIReturns>
Returns the first text node entry or `undefined` if no text nodes are found.
</APIReturns>

### getLastChild

Returns the last child of a node or `null` if no children.
Expand Down

0 comments on commit 68a0f3a

Please sign in to comment.