mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 10:29:48 +02:00
GitBook: [main] 58 pages and 7 assets modified
This commit is contained in:
committed by
gitbook-bot
parent
15966086d4
commit
a38957b849
32
docs/api/nodes/element.md
Normal file
32
docs/api/nodes/element.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Element
|
||||
|
||||
`Element` objects are a type of node in a Slate document that contain other `Element` nodes or `Text` nodes. They can be either "blocks" or "inlines" depending on the Slate editor's configuration.
|
||||
|
||||
```typescript
|
||||
interface Element {
|
||||
children: Node[]
|
||||
}
|
||||
```
|
||||
|
||||
* [Static methods](element.md#static-methods)
|
||||
* [Retrieval methods](element.md#retrieval-methods)
|
||||
* [Check methods](element.md#check-methods)
|
||||
|
||||
## Static methods
|
||||
|
||||
### Retrieval methods
|
||||
|
||||
#### `Element.matches(element: Element, props: Partial<Element>): boolean`
|
||||
|
||||
Check if an element matches a set of `props`. Note: This checks custom properties, but it does not ensure that any children are equivalent.
|
||||
|
||||
### Check methods
|
||||
|
||||
#### `Element.isElement(value: any): value is Element`
|
||||
|
||||
Check if a `value` implements the `Element` interface.
|
||||
|
||||
#### `Element.isElementList(value: any): value is Element[]`
|
||||
|
||||
Check if a `value` is an array of `Element` objects.
|
||||
|
Reference in New Issue
Block a user