Fix documentation

Fix missing module declarations, broken lings, broken formating and
incorrect scopes in the documentation.  For modules split over several
files it appears the only viable option is to use the memberof directive
on each documented member and only declare the index file as a module.
This commit is contained in:
Hornwitser committed 2020-05-08 17:28:06 +02:00
1 parent 7a9b6592e6
commit b151dd8469
22 files changed
+318 -56

No files matched your search

+16
View File
@@ -1,3 +1,4 @@
// Connection adapters for Links
"use strict";
const events = require("events");
const WebSocket = require("ws");
@@ -6,6 +7,12 @@ const schema = require("lib/schema");
const errors = require("lib/errors");
/**
* Base connector for links
*
* @extends events.EventEmitter
* @memberof module:lib/link
*/
class WebSocketBaseConnector extends events.EventEmitter {
constructor() {
super();
@@ -112,6 +119,9 @@ class WebSocketBaseConnector extends events.EventEmitter {
/**
* Connector for master server clients
*
* @extends module:lib/link.WebSocketBaseConnector
* @memberof module:lib/link
*/
class WebSocketClientConnector extends WebSocketBaseConnector {
constructor(url, reconnectDelay) {
@@ -397,6 +407,12 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
}
}
/**
* Connector for in-memory local links
*
* @extends events.EventEmitter
* @memberof module:lib/link
*/
class VirtualConnector extends events.EventEmitter {
constructor() {
super();
+5
View File
@@ -1,3 +1,8 @@
/**
* Library for message based communication between nodes
* @module lib/link
* @author Hornwitser
*/
module.exports = {
...require('lib/link/link'),
...require('lib/link/messages'),
+4 -1
View File
@@ -1,3 +1,4 @@
// Implementation of Link class
"use strict";
const schema = require("lib/schema");
@@ -15,6 +16,8 @@ const messages = require("lib/link/messages");
/**
* Common interface for server and client connections
*
* @memberof module:lib/link
*/
class Link {
constructor(source, target, connector) {
@@ -59,7 +62,7 @@ class Link {
* Validates and invokes the handler and/or waiters for a message that has
* been received. An unhandled message is considered to be an error.
*
* @throws {InvalidMessage}
* @throws {module:lib/errors.InvalidMessage}
* if validation failed, is missing, the message is invalid, or no
* handlers/waiters were invoked to handle the message.
*/
+7
View File
@@ -1,3 +1,4 @@
// Message definitions for links
"use strict";
const schema = require("lib/schema");
const errors = require("lib/errors");
@@ -7,6 +8,8 @@ const errors = require("lib/errors");
*
* A request-response message that can be innitated by either party of the
* link.
*
* @memberof module:lib/link
*/
class Request {
@@ -353,6 +356,8 @@ messages.getMetrics = new Request({
*
* A one way message without any response or recipt confirmation that
* can be innitiated by either party of the link.
*
* @memberof module:lib/link
*/
class Event {
@@ -555,6 +560,8 @@ messages.instanceOutput = new Event({
* to the link. The handler used for the messageis looked up on the
* link instance as the concatenation of the name of the message, the
* name of message class, and 'Handler'.
*
* @memberof module:lib/link
*/
function attachAllMessages(link) {
for (let [name, message] of Object.entries(messages)) {