1
0
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:
Sunny Hirai
2023-04-11 18:23:16 -07:00
parent 07b049f59b
commit 7b5949ccc9
2 changed files with 20 additions and 0 deletions

View File

@@ -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
View 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.