Documentation updates for node-red and runtime modules

This commit is contained in:
Nick O'Leary
2018-11-30 23:01:09 +00:00
parent bc02c9573c
commit 0b5e4f2dd7
19 changed files with 256 additions and 190 deletions

View File

@@ -15,7 +15,8 @@
**/
/**
* @namespace RED.comms
* This is the comms subsystem of the runtime.
* @mixin @node-red/runtime_comms
*/
/**
@@ -89,7 +90,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {CommsConnection} opts.client - the client connection
* @return {Promise<Object>} - resolves when complete
* @memberof RED.comms
* @memberof @node-red/runtime_comms
*/
addConnection: function(opts) {
connections.push(opts.client);
@@ -102,7 +103,7 @@ var api = module.exports = {
* @param {User} opts.user - the user calling the api
* @param {CommsConnection} opts.client - the client connection
* @return {Promise<Object>} - resolves when complete
* @memberof RED.comms
* @memberof @node-red/runtime_comms
*/
removeConnection: function(opts) {
for (var i=0;i<connections.length;i++) {
@@ -123,7 +124,7 @@ var api = module.exports = {
* @param {CommsConnection} opts.client - the client connection
* @param {String} opts.topic - the topic to subscribe to
* @return {Promise<Object>} - resolves when complete
* @memberof RED.comms
* @memberof @node-red/runtime_comms
*/
subscribe: function(opts) {
var re = new RegExp("^"+opts.topic.replace(/([\[\]\?\(\)\\\\$\^\*\.|])/g,"\\$1").replace(/\+/g,"[^/]+").replace(/\/#$/,"(\/.*)?")+"$");
@@ -142,7 +143,7 @@ var api = module.exports = {
* @param {CommsConnection} opts.client - the client connection
* @param {String} opts.topic - the topic to unsubscribe from
* @return {Promise<Object>} - resolves when complete
* @memberof RED.comms
* @memberof @node-red/runtime_comms
*/
unsubscribe: function(opts) {}
};