@ckeditor/ckeditor5-integrations-common
Version:
This package implements common utility modules for integration projects.
16 lines (15 loc) • 955 B
TypeScript
import { EditorConfig } from 'ckeditor5';
import { EditorRelaxedConfig } from '../types/EditorRelaxedConfig.js';
/**
* Assigns the `data` property to the appropriate field in the editor configuration,
* ensuring compatibility with different CKEditor 5 versions.
*
* Version differences:
* 1. LTS (47.x): Uses the top-level `initialData` property and does not support per-root configurations.
* 2. Latest (48.x+): Uses `roots.main.initialData` and deprecates the top-level `initialData`.
*
* @param config The editor configuration object.
* @param data The editor data. Used to log warnings if data is passed both via config and component properties.
* @param ignoreConfigInitialData If `true`, the provided `data` argument will override any initial data defined in the `config`.
*/
export declare function assignInitialDataToEditorConfig(config: EditorRelaxedConfig, data?: string | undefined, ignoreConfigInitialData?: boolean): EditorConfig;