1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +02:00

feat(docs): add missing Element methods (#4943)

This commit is contained in:
Horacio Herrera
2022-04-13 19:56:59 +02:00
committed by GitHub
parent 99d24a63af
commit 0e598ab229

View File

@@ -60,6 +60,10 @@ Check if an element matches a set of `props`. Note: This checks custom propertie
### Check methods ### Check methods
#### `Element.isAncestor(value: any) => value is Ancestor`
Check if a value implements the 'Ancestor' interface.
#### `Element.isElement(value: any) => value is Element` #### `Element.isElement(value: any) => value is Element`
Check if a `value` implements the `Element` interface. Check if a `value` implements the `Element` interface.
@@ -67,3 +71,8 @@ Check if a `value` implements the `Element` interface.
#### `Element.isElementList(value: any) => value is Element[]` #### `Element.isElementList(value: any) => value is Element[]`
Check if a `value` is an array of `Element` objects. Check if a `value` is an array of `Element` objects.
#### `Element.isElementType<T Extends Element>(value: any, elementVal: string, ElementKey: string = 'type'): value is T`
Check if a value implements the `Element` interface and has elementKey with selected value.
Default it check to `type` key value