Maciej Bukowski пре 6 година
родитељ
комит
d3fbe2b4a0

+ 16 - 14
packages/ckeditor5-watchdog/src/contextwatchdog.js

@@ -111,7 +111,8 @@ export default class ContextWatchdog extends Watchdog {
 	 * Adds items to the watchdog. Internally watchdogs will be created for these items and they will be available later using
 	 * the {@link #getWatchdog} method.
 	 *
-	 * @param {Array.<Object.<String,module:watchdog/contextwatchdog~WatchdogItemConfiguration>>} itemConfigurations
+	 * // @param {Array.<Object.<String,module:watchdog/contextwatchdog~WatchdogItemConfiguration>>} itemConfigurations
+	 * @param {Array.<Object>} itemConfigurations
 	 * @returns {Promise}
 	 */
 	add( itemConfigurations ) {
@@ -212,8 +213,8 @@ export default class ContextWatchdog extends Watchdog {
 	/**
 	 * Restarts the `ContextWatchdog`.
 	 *
-	 * @returns {Promise}
 	 * @protected
+	 * @returns {Promise}
 	 */
 	_restart() {
 		return this._actionQueue.enqueue( () => {
@@ -314,7 +315,7 @@ export default class ContextWatchdog extends Watchdog {
 }
 
 /**
- * An action queue is used to queue async functions.
+ * An action queue that allows queuing async functions.
  *
  * @private
  */
@@ -373,8 +374,18 @@ class ActionQueue {
 	}
 
 	/**
-	 * It handles actions one by one.
+	 * Clears all queued actions (e.g. in case of an error).
+	 *
+	 * @protected
+	 */
+	_clear() {
+		this._queuedActions = [];
+	}
+
+	/**
+	 * It handles queued actions one by one.
 	 *
+	 * @private
 	 * @param {Function} res
 	 * @param {Function} rej
 	 */
@@ -402,15 +413,6 @@ class ActionQueue {
 			} )
 			.catch( err => rej( err ) );
 	}
-
-	/**
-	 * @protected
-	 *
-	 * Clears all queued actions (e.g. in case of an error).
-	 */
-	clear() {
-		this._queuedActions = [];
-	}
 }
 
 /**
@@ -431,5 +433,5 @@ class ActionQueue {
  * @property {String|HTMLElement} sourceElementOrData The source element or data which will be passed
  * as the first argument to the `Editor.create()` method.
  *
- * @property {any} config An editor configuration.
+ * @property {Object} config An editor configuration.
  */

+ 4 - 4
packages/ckeditor5-watchdog/src/editorwatchdog.js

@@ -153,7 +153,7 @@ export default class EditorWatchdog extends Watchdog {
 
 	/**
 	 * Creates a watched editor instance using the creator passed to the {@link #setCreator `setCreator()`} method or
-	 * the {@link module:watchdog/watchdog~Watchdog.for `Watchdog.for()`} helper.
+	 * the {@link module:watchdog/editorwatchdog~EditorWatchdog.for `Watchdog.for()`} helper.
 	 *
 	 * @param {HTMLElement|String|Object.<String|String>} [elementOrData]
 	 * @param {module:core/editor/editorconfig~EditorConfig} [config]
@@ -167,8 +167,8 @@ export default class EditorWatchdog extends Watchdog {
 				if ( !this._creator ) {
 					/**
 					 * The watchdog's editor creator is not defined. Define it by using
-					 * {@link module:watchdog/watchdog~Watchdog#setCreator `Watchdog#setCreator()`} or
-					 * the {@link module:watchdog/watchdog~Watchdog.for `Watchdog.for()`} helper.
+					 * {@link module:watchdog/editorwatchdog~EditorWatchdog#setCreator `Watchdog#setCreator()`} or
+					 * the {@link module:watchdog/editorwatchdog~EditorWatchdog.for `Watchdog.for()`} helper.
 					 *
 					 * @error watchdog-creator-not-defined
 					 */
@@ -329,7 +329,7 @@ export default class EditorWatchdog extends Watchdog {
 	 *		watchdog.create( elementOrData, config );
 	 *
 	 * @param {*} Editor The editor class.
-	 * @param {module:watchdog/watchdog~WatchdogConfig} [watchdogConfig] The watchdog plugin configuration.
+	 * @param {module:watchdog/editorwatchdog~EditorWatchdogConfig} [watchdogConfig] The watchdog plugin configuration.
 	 */
 	static for( Editor, watchdogConfig ) {
 		const watchdog = new this( watchdogConfig );

+ 3 - 3
packages/ckeditor5-watchdog/tests/contextwatchdog.js

@@ -197,7 +197,7 @@ describe( 'ContextWatchdog', () => {
 				err = _err;
 			}
 
-			mainWatchdog._actionQueue.clear();
+			mainWatchdog._actionQueue._clear();
 
 			await mainWatchdog.destroy();
 
@@ -218,7 +218,7 @@ describe( 'ContextWatchdog', () => {
 				err = _err;
 			}
 
-			mainWatchdog._actionQueue.clear();
+			mainWatchdog._actionQueue._clear();
 
 			await mainWatchdog.destroy();
 
@@ -282,7 +282,7 @@ describe( 'ContextWatchdog', () => {
 				err = _err;
 			}
 
-			mainWatchdog._actionQueue.clear();
+			mainWatchdog._actionQueue._clear();
 
 			await mainWatchdog.destroy();