1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00

Add withHistory page to docs, reorganize the History docs in general and update Summary.md

This commit is contained in:
Sunny Hirai
2023-04-12 21:44:53 -07:00
parent f89aca22f6
commit 2f3fb37ffc
6 changed files with 24 additions and 24 deletions

View File

@@ -0,0 +1,27 @@
# History
The `History` object contains the undo and redo history for the editor.
It can be accessed from an `Editor` instance as the property `history`.
This property is only available on the `Editor` if the editor was instantiated using the `withHistory` method which adds undo/redo functionality to the Slate editor.
```typescript
export interface History {
redos: Batch[]
undos: Batch[]
}
interface Batch {
operations: Operation[]
selectionBefore: Range | null
}
```
- [Static Methods](history.md#static-methods)
## Static Methods
#### `History.isHistory(value: any): value is History`
Returns `true` if the passed in `value` is a `History` object and also acts as a type guard for `History`.