Jelajahi Sumber

Document the feed configuration object.

Maciej Gołaszewski 6 tahun lalu
induk
melakukan
9a898697ae
1 mengubah file dengan 52 tambahan dan 0 penghapusan
  1. 52 0
      packages/ckeditor5-mention/src/mention.js

+ 52 - 0
packages/ckeditor5-mention/src/mention.js

@@ -34,3 +34,55 @@ export default class Mention extends Plugin {
 		return [ MentionEditing, MentionUI ];
 		return [ MentionEditing, MentionUI ];
 	}
 	}
 }
 }
+
+/**
+ * The configuration of the {@link module:mention/mention~Mention} feature.
+ *
+ * Read more in {@link module:mention/mention~MentionConfig}.
+ *
+ * @member {module:mention/mention~MentionConfig} module:core/editor/editorconfig~EditorConfig#mention
+ * @type {Array.<module/mention~MentionFeed>}
+ */
+
+/**
+ * The mention feed descriptor. Used in {@link module:mention/mention~MentionConfig `config.mention`}.
+ *
+ * See {@link module:mention/mention~MentionConfig} to learn more.
+ *
+ *		{
+ *			marker: '@',
+ *			feed: [ 'Alice', 'Bob', ... ],
+ *		}
+ *
+ * @typedef {Object} module:mention/mention~MentionFeed
+ * @property {String} [marker='@'] The character which triggers autocompletion for mention.
+ * @property {Array.<module:mention/mention~MentionFeedItem>|Function} feed The auto complete feed items. Provide array for
+ * static configuration or a function that returns a promise for asynchronous feeds.
+ */
+
+/**
+ * The mention feed item. In configuration might be defined as string or a plain object. The strings will be used as `name` property
+ * when converting to an object in the model.
+ *
+ * *Note* When defining feed item as a plain object you must provide the at least the `name` property.
+ *
+ * @typedef {Object|String} module:mention/mention~MentionFeedItem
+ * @property {String} name Name of the mention.
+ */
+
+/**
+ * The configuration of the mention features.
+ *
+ * Read more about {@glink features/mention#configuration configuring the mention feature}.
+ *
+ *		ClassicEditor
+ *			.create( editorElement, {
+ * 				mention: ... // Media embed feature options.
+ *			} )
+ *			.then( ... )
+ *			.catch( ... );
+ *
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
+ *
+ * @interface MentionConfig
+ */