/** * Represents an entity in editor. * An entity is an HTML element with special CSS classes and will be treated as an atom from the editor. * Editor provides basic operations and will trigger related events to let plugins know that there is * operation target to an entity. * Plugin can insert/remove an entity, handle entity events, query entities within the editor. * Plugin can also set an entity to be readonly so that user can't modify content within an entity. */ export default interface Entity { /** * Type of this entity. Specified when insert an entity, can be an valid CSS class-like string. */ type: string; /** * Id of this entity, generated by editor code and will be unique within an editor */ id: string; /** * The wrapper DOM node of this entity which holds the info CSS classes of this entity */ wrapper: HTMLElement; /** * Whether this is a readonly entity */ isReadonly: boolean; }