mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 10:51:44 +02:00
Add beginning of History docs to Slate docs
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
|
||||
- [Slate React](libraries/slate-react.md)
|
||||
- [Slate History](libraries/slate-history.md)
|
||||
- [History](/history/history.md)
|
||||
- [Slate Hyperscript](libraries/slate-hyperscript.md)
|
||||
|
||||
## General
|
||||
|
19
docs/history/history.md
Normal file
19
docs/history/history.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# History
|
||||
|
||||
The `History` object contains the undo and redo history for the editor.
|
||||
|
||||
```typescript
|
||||
export interface History {
|
||||
redos: Batch[]
|
||||
undos: Batch[]
|
||||
}
|
||||
|
||||
interface Batch {
|
||||
operations: Operation[]
|
||||
selectionBefore: Range | null
|
||||
}
|
||||
```
|
||||
|
||||
It can be accessed from an `Editor` instance as the property `history`.
|
||||
|
||||
This property is only available on the `Editor` if it was instantiated using the `withHistory` method which adds undo/redo functionality to the Slate editor.
|
Reference in New Issue
Block a user