@ckeditor/ckeditor5-vue
Version:
Official Vue.js 3+ component for CKEditor 5 – the best browser-based rich text editor.
38 lines (37 loc) • 1.93 kB
TypeScript
/**
* @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
*/
import type { EditorRelaxedConstructor } from '@ckeditor/ckeditor5-integrations-common';
import type { EditorWithWatchdogRelaxedConstructor } from '../types.js';
import type { Editor, EditorWatchdog, WatchdogConfig } from 'ckeditor5';
declare const EDITOR_WATCHDOG_SYMBOL: unique symbol;
export type EditorWithAttachedWatchdog<TEditor extends Editor = Editor> = TEditor & {
[EDITOR_WATCHDOG_SYMBOL]?: EditorWatchdog;
};
/**
* `EditorWatchdog#create` method does not return editor instance (returns `undefined` instead).
* This function wraps editor constructor with EditorWatchdog and returns fake constructor that
* returns editor instance assigned to initialized watchdog.
*
* It stores watchdog instance in hidden symbol assigned to editor. It simplifies storing both
* instances in component's state (it's no longer required to store them separately).
*
* @param Editor The Editor creator to wrap.
* @param watchdogConfig Watchdog configuration.
* @returns The Editor creator wrapped with a watchdog.
*/
export declare function wrapWithWatchdogIfPresent<TEditor extends Editor>(Editor: EditorWithWatchdogRelaxedConstructor<TEditor>, watchdogConfig?: WatchdogConfig): EditorRelaxedConstructor<EditorWithAttachedWatchdog<TEditor>>;
/**
* Unwraps the EditorWatchdog from the editor instance.
*
* @param editor Editor with attached watchdog.
*/
export declare function unwrapEditorWatchdog(editor: EditorWithAttachedWatchdog): EditorWatchdog | null;
/**
* It destroys the editor watchdog if it is assigned to the editor. If it is not, the editor is destroyed.
*
* @param editor Editor with attached watchdog.
*/
export declare function destroyEditorWithWatchdog(editor: EditorWithAttachedWatchdog): Promise<void>;
export {};