Options
All
  • Public
  • Public/Protected
  • All
Menu

The interface for the map of core API. Editor can call call API from this map under EditorCore object

Hierarchy

  • CoreApiMap

Index

Properties

addUndoSnapshot

addUndoSnapshot: AddUndoSnapshot

Call an editing callback with adding undo snapshots around, and trigger a ContentChanged event if change source is specified. Undo snapshot will not be added if this call is nested inside another addUndoSnapshot() call.

param

The EditorCore object

param

The editing callback, accepting current selection start and end position, returns an optional object used as the data field of ContentChangedEvent.

param

The ChangeSource string of ContentChangedEvent. @default ChangeSource.Format. Set to null to avoid triggering ContentChangedEvent

param

True if this action can be undone when user presses Backspace key (aka Auto Complete).

attachDomEvent

attachDomEvent: AttachDomEvent

Attach a DOM event to the editor content DIV

param

The EditorCore object

param

The DOM event name

param

Optional event type. When specified, editor will trigger a plugin event with this name when the DOM event is triggered

param

Optional callback function to be invoked when the DOM event is triggered before trigger plugin event

createPasteFragment

createPasteFragment: CreatePasteFragment

Create a DocumentFragment for paste from a ClipboardData

param

The EditorCore object.

param

Clipboard data retrieved from clipboard

param

The position to paste to

param

True to force use plain text as the content to paste, false to choose HTML or Image if any

param

True if apply format of current selection to the pasted content, false to keep original format

ensureTypeInContainer

ensureTypeInContainer: EnsureTypeInContainer

Ensure user will type into a container element rather than into the editor content DIV directly

param

The EditorCore object.

param

The position that user is about to type to

param

Optional keyboard event object

param

Deprecated parameter, not used

focus

focus: Focus

Focus to editor. If there is a cached selection range, use it as current selection

param

The EditorCore object

getContent

getContent: GetContent

Get current editor content as HTML string

param

The EditorCore object

param

specify what kind of HTML content to retrieve

returns

HTML string representing current editor content

getPendableFormatState

getPendableFormatState: GetPendableFormatState

Get the pendable format such as underline and bold

param

The EditorCore object

param

If set to true, will force get the format state from DOM tree.

returns

The pending format state of editor.

getSelectionRange

getSelectionRange: GetSelectionRange

Get current or cached selection range

param

The EditorCore object

param

Set to true to retrieve the selection range from cache if editor doesn't own the focus now

returns

A Range object of the selection range

getSelectionRangeEx

getSelectionRangeEx: GetSelectionRangeEx

Get current or cached selection range

param

The EditorCore object

param

Set to true to retrieve the selection range from cache if editor doesn't own the focus now

returns

A Range object of the selection range

getStyleBasedFormatState

getStyleBasedFormatState: GetStyleBasedFormatState

Get style based format state from current selection, including font name/size and colors

param

The EditorCore objects

param

The node to get style from

hasFocus

hasFocus: HasFocus

Check if the editor has focus now

param

The EditorCore object

returns

True if the editor has focus, otherwise false

insertNode

insertNode: InsertNode

Insert a DOM node into editor content

param

The EditorCore object. No op if null.

param

An insert option object to specify how to insert the node

restoreUndoSnapshot

restoreUndoSnapshot: RestoreUndoSnapshot

Restore an undo snapshot into editor

param

The editor core object

param

Steps to move, can be 0, positive or negative

select

select: Select

Select content according to the given information. There are a bunch of allowed combination of parameters. See IEditor.select for more details

param

The editor core object

param

A DOM Range, or SelectionRangeEx, or NodePosition, or Node, or Selection Path

param

(optional) A NodePosition, or an offset number, or a PositionType, or a TableSelection, or null

param

(optional) A Node

param

(optional) An offset number, or a PositionType

selectImage

selectImage: SelectImage

Select a image and save data of the selected range

param

The EditorCore object

param

image to select

param

the id of the image element

returns

true if successful

selectRange

selectRange: SelectRange

Change the editor selection to the given range

param

The EditorCore object

param

The range to select

param

When set to true, do nothing if the given range is the same with current selection in editor, otherwise it will always remove current selection range and set to the given one. This parameter is always treated as true in Edge to avoid some weird runtime exception.

selectTable

selectTable: SelectTable

Select a table and save data of the selected range

param

The EditorCore object

param

table to select

param

first and last cell of the selection, if this parameter is null, instead of selecting, will unselect the table.

param

Whether need to update the style elements

returns

true if successful

setContent

setContent: SetContent

Set HTML content to this editor. All existing content will be replaced. A ContentChanged event will be triggered if triggerContentChangedEvent is set to true

param

The EditorCore object

param

HTML content to set in

param

True to trigger a ContentChanged event. Default value is true

switchShadowEdit

switchShadowEdit: SwitchShadowEdit

Switch the Shadow Edit mode of editor On/Off

param

The EditorCore object

param

True to switch On, False to switch Off

transformColor

transformColor: TransformColor

Edit and transform color of elements between light mode and dark mode

param

The EditorCore object

param

The root HTML element to transform

param

True to transform the root node as well, otherwise false

param

The callback function to invoke before do color transformation

param

To specify the transform direction, light to dark, or dark to light

param

By default this function will only work when editor core is in dark mode. Pass true to this value to force do color transformation even editor core is in light mode

param

Whether the given content is already in dark mode

triggerEvent

triggerEvent: TriggerEvent

Trigger a plugin event

param

The EditorCore object

param

The event object to trigger

param

Set to true to skip the shouldHandleEventExclusively check

Generated using TypeDoc