API documentation updates

This commit is contained in:
Nick O'Leary
2018-12-05 13:00:25 +00:00
parent ee47646cf7
commit 8e1c15419c
7 changed files with 124 additions and 62 deletions

View File

@@ -1,4 +1,4 @@
/**
/*!
* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +14,30 @@
* limitations under the License.
**/
var events = require("events");
var events = require("events");
module.exports = new events.EventEmitter();
module.exports = new events.EventEmitter();
/**
* Runtime events emitter
* @mixin @node-red/runtime_events
*/
/**
* Register an event listener for a runtime event
* @name on
* @function
* @memberof @node-red/runtime_events
* @param {String} eventName - the name of the event to listen to
* @param {Function} listener - the callback function for the event
*/
/**
* Emit an event to all of its registered listeners
* @name emit
* @function
* @memberof @node-red/runtime_events
* @param {String} eventName - the name of the event to emit
* @param {any} ...args - the arguments to pass in the event
* @return {Boolean} - whether the event had listeners or not
*/