EditorChangeType is an enum that lists the possible set of change operations that can be handled the Draft model. It is represented as a Flow type, as a union of strings.

EditorChangeType 是一个枚举类型,它列出了可以处理Draft模型的更改操作的一些集合。它被表示为Flow type,具体表现为字符串的联合。

It is passed as a parameter to EditorState.push, and denotes the type of change operation that is being performed by transitioning to the new ContentState.

它作为参数传递给EditorState.push,表示转换到新的ContentState时正在执行的更改操作的类型。

Behind the scenes, this value is used to determine appropriate undo/redo handling, spellcheck behavior, and more. Therefore, while it is possible to provide an arbitrary string value as the changeType parameter here, you should avoid doing so.

在幕后,此值用于标示适当的撤消/重做处理、拼写检查行为等。因此,虽然可以在这里提供一个任意的字符串值作为changeType参数,但是应该避免这样做。

We highly recommend that you install Flow to perform static typechecking on your project. Flow will enforce the use of an appropriate EditorChangeType value.

我们强烈建议您安装Flow来在项目上执行静态类型检查。Flow将强制你使用适当的EditorChangeType值。

Values

adjust-depth

The depth value of one or more ContentBlock objects is being changed.

一个或多个ContentBlock对象的深度值层级被改变。

apply-entity

An entity is being applied (or removed via null) to one or more characters.

将一个实体应用(或通过null删除)到一个或多个字符。

backspace-character

A single character is being backward-removed.

一个字符被向后删除。

change-block-data

The data value of one or more ContentBlock objects is being changed.

一个或多个ContentBlock对象的数据值正在被改变。

change-block-type

The type value of one or more ContentBlock objects is being changed.

一个或多个ContentBlock对象的类型值被改变。

change-inline-style

An inline style is being applied or removed for one or more characters.

正在为一个或多个字符应用或删除内联样式。

move-block

A block is being moved within the BlockMap.

一个块类型被移除,块类型在 BlockMap 中定义。

delete-character

A single character is being forward-removed.

一个字符被前移。

insert-characters

One or more characters is being inserted at a selection state.

在选择状态插入一个或多个字符。

insert-fragment

A “fragment” of content (i.e. a BlockMap) is being inserted at a selection state.

一个内容片段(也就是说是一个 BlockMap )被插入到选择状态中。

redo

A redo operation is being performed. Since redo behavior is handled by the Draft core, it is unlikely that you will need to use this explicitly.

正在执行重做操作。因为重做行为是由Draft核心处理的,所以不太可能需要显式地使用它。

remove-range

Multiple characters or blocks are being removed.

删除多个字符或块类型。

spellcheck-change

A spellcheck or autocorrect change is being performed. This is used to inform the core editor whether to try to allow native undo behavior.

正在执行拼写检查或自动更正。这用于通知核心编辑器是否尝试允许本机进行撤消行为。

split-block

A single ContentBlock is being split into two, for instance when the user presses return.

一个ContentBlock被分成两个,例如当用户按return键时。

undo

An undo operation is being performed. Since undo behavior is handled by the Draft core, it is unlikely that you will need to use this explicitly.

正在执行撤消操作。因为撤销行为是由Draft核心处理的,所以不太可能需要显式地使用它。