mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 18:09:49 +02:00
doc: add missing APIs in the doc (#5835)
* doc: add missing APIs in the doc * refactor: apply lint
This commit is contained in:
@@ -10,9 +10,16 @@ interface PathRef {
|
||||
}
|
||||
```
|
||||
|
||||
- [Instance methods](path-ref.md#instance-methods)
|
||||
- [Static methods](path-ref.md#static-methods)
|
||||
- [Transform methods](path-ref.md#trasnform-methods)
|
||||
|
||||
## Instance methods
|
||||
|
||||
#### `unref() => Path | null`
|
||||
|
||||
Free the resources used by the PathRef. This should be called when you no longer need to track the path. Returns the final path value before being unrefed, or null if the path was already invalid.
|
||||
|
||||
## Static methods
|
||||
|
||||
### Transform methods
|
||||
|
@@ -115,6 +115,10 @@ Check is a value implements the `Path` interface.
|
||||
|
||||
Check if a path is a sibling of another.
|
||||
|
||||
#### `Path.operationCanTransformPath(operation: Operation) => operation is InsertNodeOperation | RemoveNodeOperation | MergeNodeOperation | SplitNodeOperation | MoveNodeOperation`
|
||||
|
||||
Returns whether this operation can affect paths or not.
|
||||
|
||||
### Transform method
|
||||
|
||||
#### `Path.transform(path: Path, operation: Operation, options?) => Path | null`
|
||||
|
@@ -16,7 +16,7 @@ interface PointRef {
|
||||
|
||||
## Instance methods
|
||||
|
||||
#### `unRef() => Point`
|
||||
#### `unref() => Point | null`
|
||||
|
||||
Call this when you no longer need to sync this point.
|
||||
It also returns the current value.
|
||||
|
@@ -27,7 +27,7 @@ Transforms.select(editor, selectionRef.unref())
|
||||
|
||||
## Instance methods
|
||||
|
||||
#### `unref() => Range`
|
||||
#### `unref() => Range | null`
|
||||
|
||||
Call this when you no longer need to sync this range.
|
||||
It also returns the current value.
|
||||
|
Reference in New Issue
Block a user