Przeglądaj źródła

Merge branch 'docs'. Closes #256.

Thanks to @denisname!
Piotrek Koszuliński 7 lat temu
rodzic
commit
b41d960610

+ 2 - 2
packages/ckeditor5-utils/src/ckeditorerror.js

@@ -51,9 +51,9 @@ export default class CKEditorError extends Error {
 		this.name = 'CKEditorError';
 
 		/**
-		 * The additional error data passed to the constructor.
+		 * The additional error data passed to the constructor. Undefined if none was passed.
 		 *
-		 * @member {Object}
+		 * @member {Object|undefined}
 		 */
 		this.data = data;
 	}

+ 3 - 3
packages/ckeditor5-utils/src/collection.js

@@ -290,7 +290,7 @@ export default class Collection {
 	 * @param {Function} callback
 	 * @param {Object} callback.item
 	 * @param {Number} callback.index
-	 * @params {Object} ctx Context in which the `callback` will be called.
+	 * @param {Object} ctx Context in which the `callback` will be called.
 	 * @returns {Array} The result of mapping.
 	 */
 	map( callback, ctx ) {
@@ -303,8 +303,8 @@ export default class Collection {
 	 * @param {Function} callback
 	 * @param {Object} callback.item
 	 * @param {Number} callback.index
+	 * @param {Object} ctx Context in which the `callback` will be called.
 	 * @returns {Object} The item for which `callback` returned a true value.
-	 * @params {Object} ctx Context in which the `callback` will be called.
 	 */
 	find( callback, ctx ) {
 		return this._items.find( callback, ctx );
@@ -316,7 +316,7 @@ export default class Collection {
 	 * @param {Function} callback
 	 * @param {Object} callback.item
 	 * @param {Number} callback.index
-	 * @params {Object} ctx Context in which the `callback` will be called.
+	 * @param {Object} ctx Context in which the `callback` will be called.
 	 * @returns {Object[]} The array with matching items.
 	 */
 	filter( callback, ctx ) {

+ 2 - 2
packages/ckeditor5-utils/src/dom/createelement.js

@@ -20,8 +20,8 @@ import { isString } from 'lodash-es';
  *
  * @param {Document} doc Document used to create element.
  * @param {String} name Name of the element.
- * @param {Object} attributes Object keys will become attributes keys and object values will became attributes values.
- * @param {Node|String|Array.<Node|String>} children Child or array of children. Strings will be automatically turned
+ * @param {Object} [attributes] Object keys will become attributes keys and object values will became attributes values.
+ * @param {Node|String|Array.<Node|String>} [children] Child or array of children. Strings will be automatically turned
  * into Text nodes.
  * @returns {Element} Created element.
  */

+ 1 - 1
packages/ckeditor5-utils/src/dom/getborderwidths.js

@@ -11,7 +11,7 @@
  * Returns an object containing CSS border widths of a specified HTML element.
  *
  * @param {HTMLElement} element An element which has CSS borders.
- * @param {Object} An object containing `top`, `left`, `right` and `bottom` properties
+ * @returns {Object} An object containing `top`, `left`, `right` and `bottom` properties
  * with numerical values of the `border-[top,left,right,bottom]-width` CSS styles.
  */
 export default function getBorderWidths( element ) {

+ 1 - 1
packages/ckeditor5-utils/src/dom/getpositionedancestor.js

@@ -12,7 +12,7 @@ import global from './global';
 /**
  * For a given element, returns the nearest ancestor element which CSS position is not "static".
  *
- * @param {HTMLElement} element Native DOM element to be checked.
+ * @param {HTMLElement} element The native DOM element to be checked.
  * @returns {HTMLElement|null}
  */
 export default function getPositionedAncestor( element ) {

+ 1 - 1
packages/ckeditor5-utils/src/dom/position.js

@@ -67,7 +67,7 @@ import { isFunction } from 'lodash-es';
  *
  *		// The best position which fits into document.body and the viewport. May be useful
  *		// to set proper class on the `element`.
- *		console.log( name ); -> "myNorthEastPosition"
+ *		console.log( name ); // -> "myNorthEastPosition"
  *
  *		// Using the absolute coordinates which has been found to position the element
  *		// as in the diagram depicting the "myNorthEastPosition" position.

+ 1 - 1
packages/ckeditor5-utils/src/emittermixin.js

@@ -635,5 +635,5 @@ function removeCallback( emitter, event, callback ) {
  *
  * @method #to
  * @param {module:utils/emittermixin~Emitter} emitter An `EmitterMixin` instance which is the destination for delegated events.
- * @param {String|Function} nameOrFunction A custom event name or function which converts the original name string.
+ * @param {String|Function} [nameOrFunction] A custom event name or function which converts the original name string.
  */

+ 1 - 1
packages/ckeditor5-utils/src/keystrokehandler.js

@@ -82,7 +82,7 @@ export default class KeystrokeHandler {
 	 * the {@link module:utils/keyboard~parseKeystroke} function.
 	 * @param {Function} callback A function called with the
 	 * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
-	 * a helper to both `preventDefault` and `stopPropagation` of the event.
+	 * a helper funcion to call both `preventDefault()` and `stopPropagation()` on the underlying event.
 	 * @param {Object} [options={}] Additional options.
 	 * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke
 	 * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority

+ 1 - 1
packages/ckeditor5-utils/src/locale.js

@@ -44,7 +44,7 @@ export default class Locale {
 		 *
 		 * @method #t
 		 * @param {String} str The string to translate.
-		 * @param {String[]} values Values that should be used to interpolate the string.
+		 * @param {String[]} [values] Values that should be used to interpolate the string.
 		 */
 		this.t = ( ...args ) => this._t( ...args );
 	}

+ 2 - 0
packages/ckeditor5-utils/src/mapsequal.js

@@ -10,6 +10,8 @@
 /**
  * Checks whether given {Map}s are equal, that is has same size and same key-value pairs.
  *
+ * @param {Map} mapA The first map to compare.
+ * @param {Map} mapB The second map to compare.
  * @returns {Boolean} `true` if given maps are equal, `false` otherwise.
  */
 export default function mapsEqual( mapA, mapB ) {