updates #1100 More jsdoc docstrings

This commit is contained in:
JC Brand 2018-05-11 13:42:35 +02:00
parent 38499917a9
commit 72001cb9df
2 changed files with 39 additions and 12 deletions

View File

@ -239,4 +239,4 @@ html:
.PHONY: apidoc
apidoc:
$(JSDOC) -d docs/html/api src/converse-disco.js
$(JSDOC) -d docs/html/api src/*.js

View File

@ -301,16 +301,6 @@
* @namespace
*/
'identities': {
/**
* Clears all previously registered identities.
* @function
*
* @example
* _converse.api.disco.own.identities.clear();
*/
clear () {
plugin._identities = []
},
/**
* Lets you add new identities for this client (i.e. instance of Converse.js)
* @function
@ -334,6 +324,16 @@
}
plugin._identities.push({category: category, type: type, name: name, lang: lang});
},
/**
* Clears all previously registered identities.
* @function
*
* @example
* _converse.api.disco.own.identities.clear();
*/
clear () {
plugin._identities = []
},
/**
* Returns all of the identities registered for this client
* (i.e. instance of Converse.js).
@ -346,17 +346,44 @@
return plugin._identities;
}
},
/**
* The "features" grouping
* @namespace
*/
'features': {
/**
* Lets you register new disco features for this client (i.e. instance of Converse.js)
* @function
*
* @param {String} name - e.g. http://jabber.org/protocol/caps
*
* @example
* _converse.api.disco.own.features.add("http://jabber.org/protocol/caps");
*/
add (name) {
for (var i=0; i<plugin._features.length; i++) {
if (plugin._features[i] == name) { return false; }
}
plugin._features.push(name);
},
/**
* Clears all previously registered features.
* @function
*
* @example
* _converse.api.disco.own.features.clear();
*/
clear () {
plugin._features = []
},
/**
* Returns all of the features registered for this client
* (i.e. instance of Converse.js).
* @function
*
* @example
* const features = _converse.api.disco.own.features.get();
*/
get () {
return plugin._features;
}