1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-14 03:03:58 +02:00

Added comments to with-history and with-react to help fix TypeScript errors

This commit is contained in:
Sunny Hirai
2021-03-29 01:01:25 -07:00
parent 6b94fb17c8
commit 0434182166
2 changed files with 10 additions and 0 deletions

View File

@@ -5,6 +5,11 @@ import { HistoryEditor } from './history-editor'
/**
* The `withHistory` plugin keeps track of the operation history of a Slate
* editor as operations are applied to it, using undo and redo stacks.
*
* If you are using TypeScript, you must extend Slate's CustomTypes to use
* this plugin.
*
* See https://docs.slatejs.org/concepts/11-typescript to learn how.
*/
export const withHistory = <T extends Editor>(editor: T) => {

View File

@@ -8,6 +8,11 @@ import { isDOMText, getPlainText } from '../utils/dom'
/**
* `withReact` adds React and DOM specific behaviors to the editor.
*
* If you are using TypeScript, you must extend Slate's CustomTypes to use
* this plugin.
*
* See https://docs.slatejs.org/concepts/11-typescript to learn how.
*/
export const withReact = <T extends Editor>(editor: T) => {