1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 02:49:56 +02:00

GitBook: [main] 58 pages and 7 assets modified

This commit is contained in:
Ian Storm Taylor
2021-04-01 23:20:52 +00:00
committed by gitbook-bot
parent 15966086d4
commit a38957b849
51 changed files with 855 additions and 991 deletions

38
docs/api/nodes/text.md Normal file
View File

@@ -0,0 +1,38 @@
# Text
`Text` objects represent the nodes that contain the actual text content of a Slate document along with any formatting properties. They are always leaf nodes in the document tree as they cannot contain any children.
```typescript
interface Text {
text: string
}
```
* [Static methods](text.md#static-methods)
* [Retrieval methods](text.md#retrieval-methods)
* [Check methods](text.md#check-methods)
## Static methods
### Retrieval methods
#### `Text.matches(text: Text, props: Partial<Text>): boolean`
Check if a `text` matches a set of `props`.
#### `Text.decorations(node: Text, decorations: Range[]): Text[]`
Get the leaves for a text node, given `decorations`.
### Check methods
#### `Text.equals(text: Text, another: Text, options?): boolean`
Check if two text nodes are equal.
Options: `{loose?: boolean}`
#### `Text.isText(value: any): value is Text`
Check if a `value` implements the `Text` interface.