Options
All
  • Public
  • Public/Protected
  • All
Menu

The options to specify parameters customizing an editor, used by ctor of Editor class

Hierarchy

Index

Properties

Optional allowKeyboardEventPropagation

allowKeyboardEventPropagation: boolean

By default, we will stop propagation of a printable keyboard event (a keyboard event which is caused by printable char input). Set this option to true to override this behavior in case you still need the event to be handled by ancestor nodes of editor.

Optional allowedCustomPasteType

allowedCustomPasteType: string[]

Allowed custom content type when paste besides text/plain, text/html and images Only text types are supported, and do not add "text/" prefix to the type values

Optional coreApiOverride

coreApiOverride: Partial<CoreApiMap>

A function map to override default core API implementation Default value is null

Optional corePluginOverride

corePluginOverride: Partial<CorePlugins>

A plugin map to override default core Plugin implementation Default value is null

Optional defaultFormat

defaultFormat: DefaultFormat

Default format of editor content. This will be applied to empty content. If there is already content inside editor, format of existing content will not be changed. Default value is the computed style of editor content DIV

Optional disposeErrorHandler

disposeErrorHandler: (plugin: EditorPlugin, error: Error) => void

Type declaration

    • A callback to be invoked when any exception is thrown during disposing editor

      Parameters

      • plugin: EditorPlugin

        The plugin that causes exception

      • error: Error

        The error object we got

      Returns void

Optional doNotAdjustEditorColor

doNotAdjustEditorColor: boolean

Whether to skip the adjust editor process when for light/dark mode

Optional experimentalFeatures

Specify the enabled experimental features

Optional getDarkColor

getDarkColor: (lightColor: string) => string

Type declaration

    • (lightColor: string): string
    • A util function to transform light mode color to dark mode color Default value is to return the original light color

      Parameters

      • lightColor: string

      Returns string

Optional getVisibleViewport

getVisibleViewport: () => Rect

Type declaration

    • Retrieves the visible viewport of the Editor. The default viewport is the Rect of the scrollContainer.

      Returns Rect

Optional imageSelectionBorderColor

imageSelectionBorderColor: string

Color of the border of a selectedImage. Default color: '#DB626C'

Optional inDarkMode

inDarkMode: boolean

If the editor is currently in dark mode

Optional initialContent

initialContent: string

Initial HTML content Default value is whatever already inside the editor content DIV

Optional onExternalContentTransform

onExternalContentTransform: (element: HTMLElement, fromDarkMode: boolean, toDarkMode: boolean, darkColorHandler: DarkColorHandler) => void

Type declaration

    • (element: HTMLElement, fromDarkMode: boolean, toDarkMode: boolean, darkColorHandler: DarkColorHandler): void
    • Parameters

      • element: HTMLElement
      • fromDarkMode: boolean
      • toDarkMode: boolean
      • darkColorHandler: DarkColorHandler

      Returns void

Optional plugins

plugins: EditorPlugin[]

List of plugins. The order of plugins here determines in what order each event will be dispatched. Plugins not appear in this list will not be added to editor, including built-in plugins. Default value is empty array.

Optional scrollContainer

scrollContainer: HTMLElement

The scroll container to get scroll event from. By default, the scroll container will be the same with editor content DIV

Optional sizeTransformer

sizeTransformer: SizeTransformer
deprecated

Use zoomScale instead

Optional trustedHTMLHandler

trustedHTMLHandler: TrustedHTMLHandler

Customized trusted type handler used for sanitizing HTML string before assign to DOM tree This is required when trusted-type Content-Security-Policy (CSP) is enabled. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types

Optional undoMetadataSnapshotService

undoMetadataSnapshotService: UndoSnapshotsService<Snapshot>

Undo snapshot service based on content metadata. Use this parameter to customize the undo snapshot service. When this property is set, value of undoSnapshotService will be ignored.

Optional undoSnapshotService

undoSnapshotService: UndoSnapshotsService<string>
deprecated

Use undoMetadataSnapshotService instead Undo snapshot service. Use this parameter to customize the undo snapshot service.

Optional zoomScale

zoomScale: number

Current zoom scale, @default value is 1 When editor is put under a zoomed container, need to pass the zoom scale number using this property to let editor behave correctly especially for those mouse drag/drop behaviors

Generated using TypeDoc