UNPKG

@ckeditor/ckeditor5-engine

Version:

The editing engine of CKEditor 5 – the best browser-based rich text editor.

34 lines (33 loc) 926 B
/** * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ /** * @module engine/conversion/conversionhelpers */ /** * Base class for conversion helpers. */ export class ConversionHelpers { _dispatchers; /** * Creates a conversion helpers instance. */ constructor(dispatchers) { this._dispatchers = dispatchers; } /** * Registers a conversion helper. * * **Note**: See full usage example in the `{@link module:engine/conversion/conversion~Conversion#for conversion.for()}` * method description. * * @param conversionHelper The function to be called on event. */ add(conversionHelper) { for (const dispatcher of this._dispatchers) { conversionHelper(dispatcher); } return this; } }