/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { EditorState, Plugin, Transaction, EditorView, Schema, Node } from '@progress/kendo-editor-common'; import { EditorUtils } from './utils/index.js'; import { Editor } from './Editor.js'; interface EditorEvent { /** * An event target. */ target: Editor; } /** * Represents the object of the `onChange` Editor event. */ export interface EditorChangeEvent extends EditorEvent { /** * Represents the [Editor document](https://prosemirror.net/docs/guide/#doc). */ value: Node; /** * A getter of the Editor HTML content. * Once called, it will convert the Editor document into HTML string. * Note that, since onChange event is triggered on every key while typing, * this conversion may not be suitable if the Editor is dealing with large amount of content. */ html: string; /** * The Editor Schema object. */ schema: Schema; /** * The Transaction which causes the change. */ transaction: Transaction; } /** * Represents the object of the `onMount` Editor event. */ export interface EditorMountEvent extends EditorEvent { /** * The content-editable DOM element of the Editor. */ dom: HTMLDivElement; /** * The default plugins collection of the Editor. */ plugins: Array; /** * The default key bindings of the Editor. */ shortcuts: EditorUtils.Shortcuts; /** * The default [viewProps](https://prosemirror.net/docs/ref/#view.DirectEditorProps) object of the Editor. */ viewProps: { state: EditorState; [key: string]: any; }; } /** * Represents the object of the `onPaste` Editor event. */ export interface EditorPasteEvent extends EditorEvent { /** * The HTML that will be pasted in the Editor. */ pastedHtml: string; /** * The native paste event. */ nativeEvent: ClipboardEvent; } /** * Represents the object of the `onExecute` Editor event. */ export interface EditorExecuteEvent extends EditorEvent { /** * The transaction that will be executed. */ transaction: Transaction; /** * The state of the Editor. */ state: EditorState; } /** * Represents the object of the `onFocus` Editor event. */ export interface EditorFocusEvent extends EditorEvent { /** * The native focus event. */ nativeEvent: FocusEvent; } /** * Represents the object of the `onBlur` Editor event. */ export interface EditorBlurEvent extends EditorEvent { /** * The native blur event. */ nativeEvent: FocusEvent; } /** * Represents the object of the `onIFrameInit` Editor event. */ export interface EditorIFrameInitEvent extends EditorEvent { /** * The object that represents the iframe element inside the Editor. */ iframe: HTMLIFrameElement; } /** * Represents the props of the [KendoReact Editor component](https://www.telerik.com/kendo-react-ui/components/editor). */ export interface EditorProps { /** * Sets the default HTML content of the Editor. This content is rendered * when the Editor is initialized and no value is provided. * * @example * ```jsx * * ``` */ defaultContent?: string; /** * Sets the initial edit mode of the Editor. Defaults to `iframe`. * - `iframe`: The Editor content is rendered inside an `