Przeglądaj źródła

Add documentation entries.

Mateusz Samsel 6 lat temu
rodzic
commit
a97af12f8e

+ 8 - 0
packages/ckeditor5-link/src/link.js

@@ -34,3 +34,11 @@ export default class Link extends Plugin {
 		return 'Link';
 		return 'Link';
 	}
 	}
 }
 }
+
+/**
+ * The configuration of the {@link module:link/link~Link} feature.
+ *
+ * Read more in {@link module:link/linkt~LinkConfig}.
+ *
+ * @member {module:link/link~LinkConfig} module:core/editor/editorconfig~EditorConfig#link
+ */

+ 22 - 0
packages/ckeditor5-link/src/utils/automaticdecorators.js

@@ -7,11 +7,27 @@
  * @module link/utils/automaticdecorators
  * @module link/utils/automaticdecorators
  */
  */
 
 
+/**
+ * Helper class which stores information about automatic decorators for link plugin
+ * and provides dispatcher which applies all of them to the view.
+ */
 export default class AutomaticDecorators {
 export default class AutomaticDecorators {
 	constructor() {
 	constructor() {
+		/**
+		 * Stores definition of automatic decorators. Based on those values proper conversion has happens.
+		 *
+		 * @private
+		 * @type {Set}
+		 */
 		this._definitions = new Set();
 		this._definitions = new Set();
 	}
 	}
 
 
+	/**
+	 * Add item or array of items with autoamtic rules for applying decorators to link plugin.
+	 *
+	 * @param {Object|Array.<Object>} item configuration object of automatic rules for decorating links.
+	 * It might be also array of such objects.
+	 */
 	add( item ) {
 	add( item ) {
 		if ( Array.isArray( item ) ) {
 		if ( Array.isArray( item ) ) {
 			item.forEach( item => this._definitions.add( item ) );
 			item.forEach( item => this._definitions.add( item ) );
@@ -20,6 +36,12 @@ export default class AutomaticDecorators {
 		}
 		}
 	}
 	}
 
 
+	/**
+	 * Gets the conversion helper used in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method.
+	 *
+	 * @returns {Function} dispatcher function used as conversion helper
+	 * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}
+	 */
 	getDispatcher() {
 	getDispatcher() {
 		return dispatcher => {
 		return dispatcher => {
 			dispatcher.on( 'attribute:linkHref', ( evt, data, conversionApi ) => {
 			dispatcher.on( 'attribute:linkHref', ( evt, data, conversionApi ) => {