8
0
Quellcode durchsuchen

Docs: Added 'typedef' for promise resolving to array of plugins return type.

Krzysztof Krztoń vor 7 Jahren
Ursprung
Commit
fd5ee512ec

+ 2 - 2
packages/ckeditor5-core/src/editor/editor.js

@@ -219,8 +219,8 @@ export default class Editor {
 	/**
 	 * Loads and initializes plugins specified in the config.
 	 *
-	 * @returns {Promise} A promise which resolves once the initialization is completed.
-	 * @returns {Array.<module:core/plugin~PluginInterface>} return.loadedPlugins Array of loaded plugins.
+	 * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which resolves
+	 * once the initialization is completed providing an array of loaded plugins.
 	 */
 	initPlugins() {
 		const config = this.config;

+ 6 - 0
packages/ckeditor5-core/src/plugin.js

@@ -169,3 +169,9 @@ mix( Plugin, ObservableMixin );
  * @method #destroy
  * @returns {null|Promise}
  */
+
+/**
+ * Array of loaded plugins.
+ *
+ * @typedef {Array.<module:core/plugin~PluginInterface>} module:core/plugin~LoadedPlugins
+ */

+ 2 - 3
packages/ckeditor5-core/src/plugincollection.js

@@ -151,9 +151,8 @@ export default class PluginCollection {
 	 * `availablePlugins` were passed to the {@link #constructor}.
 	 * @param {Array.<String|Function>} [removePlugins] Names of plugins or plugin constructors
 	 * that should not be loaded (despite being specified in the `plugins` array).
-	 * @returns {Promise} A promise which gets resolved once all plugins are loaded and available in the
-	 * collection.
-	 * @returns {Array.<module:core/plugin~PluginInterface>} return.loadedPlugins The array of loaded plugins.
+	 * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which gets resolved once all plugins are loaded
+	 * and available in the collection.
 	 */
 	init( plugins, removePlugins = [] ) {
 		const that = this;