Creates an instance of the plugin collection class. Allows loading and initializing plugins and their dependencies. Allows providing a list of already loaded plugins. These plugins will not be destroyed along with this collection.
OptionalavailablePlugins: Iterable<PluginConstructor<TContext>>
Plugins (constructors) which the collection will be able to use
when module:core/plugincollection~PluginCollection#init is used with the plugin names (strings, instead of constructors).
Usually, the editor will pass its built-in plugins to the collection so they can later be
used in config.plugins or config.removePlugins by names.
OptionalcontextPlugins: Iterable<PluginEntry<TContext>>
A list of already initialized plugins represented by a [ PluginConstructor, pluginInstance ] pair.
Iterable interface.
Returns [ PluginConstructor, pluginInstance ] pairs.
Destroys all loaded plugins.
Checks if a plugin is loaded.
// Check if the 'Clipboard' plugin was loaded.
if ( editor.plugins.has( 'ClipboardPipeline' ) ) {
// Now use the clipboard plugin instance:
const clipboard = editor.plugins.get( 'ClipboardPipeline' );
// ...
}
The plugin constructor or module:core/plugin~PluginStaticMembers#pluginName name.
Initializes a set of plugins and adds them to the collection.
An array of module:core/plugin~PluginInterface plugin constructors or module:core/plugin~PluginStaticMembers#pluginName plugin names.
OptionalpluginsToRemove: readonly (string | PluginConstructor<TContext>)[]
Names of the plugins or plugin constructors
that should not be loaded (despite being specified in the plugins array).
OptionalpluginsSubstitutions: readonly PluginConstructor<TContext>[]
An array of module:core/plugin~PluginInterface plugin constructors
that will be used to replace plugins of the same names that were passed in plugins or that are in their dependency tree.
A useful option for replacing built-in plugins while creating tests (for mocking their APIs). Plugins that will be replaced
must follow these rules:
A promise which gets resolved once all plugins are loaded and available in the collection.
Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.