Options
All
  • Public
  • Public/Protected
  • All
Menu

Provide a chance for plugins to handle entity related events. See type EntityOperation for more details about each operation

Hierarchy

Index

Properties

entity

entity: Entity

The entity that editor is operating on

Optional eventDataCache

eventDataCache: {}

An optional event cache. This will be consumed by event cache API to store some expensive calculation result. So that for the same event across plugins, the result doesn't need to be calculated again

Type declaration

  • [key: string]: any

eventType

eventType: "entityOperation"

Type of this event

Optional formattableRoots

formattableRoots: FormattableRoot[]

For entity operation "beforeFormat" (happens when user wants to do format change), we will set this array in event and plugins can check if there is any elements inside the entity that should also apply the format

operation

operation: EntityOperation

Operation to this entity

Optional rawEvent

rawEvent: Event

Optional raw event. Need to do null check before use its value

Optional shouldPersist

shouldPersist: boolean

For entity operation "newEntity", plugin can set this property to true then the entity will be persisted. A persisted entity won't be touched during undo/redo, unless it does not exist after undo/redo. For other operation types, this value will be ignored.

Optional state

state: string

For entity operation "updateEntityState", we use this object to pass the new entity state to plugin. For other operation types, it is not used.

Generated using TypeDoc