/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ /** * @module core/editor/editorconfig */ import type { ArrayOrItem, Translations } from '@ckeditor/ckeditor5-utils'; import { type Context } from '../context.js'; import type { PluginConstructor } from '../plugin.js'; import { type Editor } from './editor.js'; import type { MenuBarConfig } from '@ckeditor/ckeditor5-ui'; import type { EngineConfig } from '@ckeditor/ckeditor5-engine'; /** * CKEditor configuration options. * * An object defining the editor configuration can be passed when initializing the editor: * * ```ts * EditorClass * .create( { * toolbar: [ 'bold', 'italic' ], * image: { * styles: [ * ... * ] * } * } ) * .then( ... ) * .catch( ... ); * ``` */ export interface EditorConfig extends EngineConfig { /** * The DOM element that will be the source for the created editor. * * **Note:** This option is only available in the {@link module:editor-classic/classiceditor~ClassicEditor}. * Other editor types expect configuration for the root elements to be passed in the * {@link module:core/editor/editorconfig~EditorConfig#roots `config.roots`} configuration. * * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization * and the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element editor element} will replace the passed element * in the DOM (the original one will be hidden and the editor will be injected next to it). * * If the {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy} * option is set to `true`, the editor data will be set back to the original element once the editor is destroyed and when a form, * in which this element is contained, is submitted (if the original element is a `