OptionalafterThe third (and last) stage of the plugin initialization. See also ~PluginConstructor and ~PluginInterface#init.
Note: This method is optional. A plugin instance does not need to have it defined.
OptionaldestroyDestroys the plugin.
Note: This method is optional. A plugin instance does not need to have it defined.
OptionalinitThe second stage (after plugin constructor) of the plugin initialization. Unlike the plugin constructor this method can be asynchronous.
A plugin's init() method is called after its ~PluginStaticMembers#requires dependencies are initialized,
so in the same order as the constructors of these plugins.
Note: This method is optional. A plugin instance does not need to have it defined.
The base interface for CKEditor plugins.
In its minimal form a plugin can be a simple function that accepts module:core/editor/editor~Editor the editor as a parameter:
In most cases however, you will want to inherit from the ~Plugin class which implements the module:utils/observablemixin~Observable and is, therefore, more convenient:
The plugin class can have
pluginNameandrequiresstatic members. See ~PluginStaticMembers for more details.The plugin can also implement methods (e.g. ~PluginInterface#init
init()or ~PluginInterface#destroydestroy()) which, when present, will be used to properly initialize and destroy the plugin.Note: When defined as a plain function, the plugin acts as a constructor and will be called in parallel with other plugins' ~PluginConstructor constructors. This means the code of that plugin will be executed before ~PluginInterface#init
init()and ~PluginInterface#afterInitafterInit()methods of other plugins and, for instance, you cannot use it to extend other plugins' {@glink framework/architecture/editing-engine#schema schema} rules as they are defined later on during theinit()stage.