From 5f56c2bc269dd2f8806e39b56a5f923605f96bed Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Tue, 11 Apr 2023 18:35:58 -0700 Subject: [PATCH] Flesh out docs for Slate History with methods --- docs/history/history.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/history/history.md b/docs/history/history.md index e4522a3a6..a3ddebb2c 100644 --- a/docs/history/history.md +++ b/docs/history/history.md @@ -2,6 +2,10 @@ 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[] @@ -14,6 +18,10 @@ interface Batch { } ``` -It can be accessed from an `Editor` instance as the property `history`. +- [Static Methods](history.md#static-methods) -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. +## 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`.