diff --git a/src/client.js b/src/client.js
index 06cb9966..91316acc 100644
--- a/src/client.js
+++ b/src/client.js
@@ -1,7 +1,3 @@
-/*
- * WAMS code to be executed in the client browser.
- */
-
/**
* This file defines the entry point for the client side of a WAMS application.
*
@@ -12,6 +8,7 @@
* style = "max-height: 200px;"
* >
*
+ * @ignore
* @module client
*/
diff --git a/src/client/ClientController.js b/src/client/ClientController.js
index 9a0dab85..5da59578 100644
--- a/src/client/ClientController.js
+++ b/src/client/ClientController.js
@@ -16,6 +16,7 @@ const symbols = Object.freeze({
* messages based on user interaction with the canvas and receives messages from
* the server detailing changes to post to the view.
*
+ * @private
* @memberof module:client
*
* @param {HTMLCanvasElement} canvas - The underlying CanvasElement object, (not
diff --git a/src/client/ClientElement.js b/src/client/ClientElement.js
index 2afb187b..888222d5 100644
--- a/src/client/ClientElement.js
+++ b/src/client/ClientElement.js
@@ -5,8 +5,9 @@ const { Point2D, WamsElement } = require('../shared.js');
/**
* The ClientElement class exposes the draw() funcitonality of wams elements.
*
- * @extends module:shared.WamsElement
+ * @private
* @memberof module:client
+ * @extends module:shared.WamsElement
*
* @param {module:shared.WamsElement} data - The data from the server describing this item.
*/
diff --git a/src/client/ClientImage.js b/src/client/ClientImage.js
index 6c66ebe1..94d570cf 100644
--- a/src/client/ClientImage.js
+++ b/src/client/ClientImage.js
@@ -35,8 +35,9 @@ function createImage(src) {
/**
* The ClientImage class exposes the draw() funcitonality of wams items.
*
- * @extends module:shared.WamsImage
+ * @private
* @memberof module:client
+ * @extends module:shared.WamsImage
*
* @param {module:shared.Item} data - The data from the server describing this item.
*/
diff --git a/src/client/ClientItem.js b/src/client/ClientItem.js
index b8aa15fb..c8e665ea 100644
--- a/src/client/ClientItem.js
+++ b/src/client/ClientItem.js
@@ -6,8 +6,9 @@ const { CanvasSequence } = require('canvas-sequencer');
/**
* The ClientItem class exposes the draw() funcitonality of wams items.
*
- * @extends module:shared.CanvasItem
+ * @private
* @memberof module:client
+ * @extends module:shared.CanvasItem
*
* @param {module:shared.CanvasItem} data - The data from the server describing this item.
*/
diff --git a/src/client/ClientModel.js b/src/client/ClientModel.js
index 7c0578a6..3071b483 100644
--- a/src/client/ClientModel.js
+++ b/src/client/ClientModel.js
@@ -12,6 +12,7 @@ const REQUIRED_DATA = Object.freeze(['viewId', 'items', 'views']);
* The ClientModel is a client-side copy of those aspects of the model that are
* necessary for rendering the view for the user.
*
+ * @private
* @memberof module:client
*/
class ClientModel {
diff --git a/src/client/ClientView.js b/src/client/ClientView.js
index 2488cca0..79e42b9c 100644
--- a/src/client/ClientView.js
+++ b/src/client/ClientView.js
@@ -26,8 +26,9 @@ const DEFAULT_CONFIG = Object.freeze({
* track of its own position, scale, and orientation, as well as those values
* for all items and all other views (which will be represented with outlines).
*
- * @extends module:shared.View
+ * @private
* @memberof module:client
+ * @extends module:shared.View
*
* @param {CanvasRenderingContext2D} context - The canvas context in which to
* render the model.
diff --git a/src/client/ShadowView.js b/src/client/ShadowView.js
index 1ac8314b..78d5212e 100644
--- a/src/client/ShadowView.js
+++ b/src/client/ShadowView.js
@@ -19,8 +19,9 @@ const symbols = Object.freeze({
* The ShadowView class exposes a simple draw() function which renders a shadowy
* outline of the view onto the canvas.
*
- * @extends module:shared.View
+ * @private
* @memberof module:client
+ * @extends module:shared.View
*
* @param {module:shared.View} values - server-provided data describing this
* view.
diff --git a/src/mixins.js b/src/mixins.js
index f2ce2633..0094b26e 100644
--- a/src/mixins.js
+++ b/src/mixins.js
@@ -1,5 +1,6 @@
/**
- * Mixins used by the WAMS project.
+ * Mixins used by the WAMS project. These provide much of the functionality for
+ * manipulating items and views.
*
*
*
*
* - * @see For a rundown on the mixin pattern I use: {@link + * @see For a rundown on the mixin pattern used: {@link * http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/}. - * Note that I actually like the base syntax, and prefer not to add another - * dependency by requiring the module implemented by the author of that article. * + * @private * @module mixins */ diff --git a/src/mixins/Hittable.js b/src/mixins/Hittable.js index caf528db..886719f1 100644 --- a/src/mixins/Hittable.js +++ b/src/mixins/Hittable.js @@ -38,6 +38,7 @@ const Interactable = require('./Interactable.js'); * The purpose of the Hittable mixin is simply to provide functionality for * interacting with the 'hitbox' property. * + * @private * @memberof module:mixins * * @mixin diff --git a/src/mixins/Identifiable.js b/src/mixins/Identifiable.js index d9626d05..a5baa8d3 100644 --- a/src/mixins/Identifiable.js +++ b/src/mixins/Identifiable.js @@ -7,6 +7,7 @@ const STAMPER = new IdStamper(); * Labels each instantiated object with a unique, immutable ID. All classes that * use this mixin will share the same pool of IDs. * + * @private * @memberof module:mixins * * @mixin diff --git a/src/mixins/Interactable.js b/src/mixins/Interactable.js index 3b6225d0..c4f2fb4d 100644 --- a/src/mixins/Interactable.js +++ b/src/mixins/Interactable.js @@ -8,6 +8,7 @@ const Transformable2D = require('./Transformable2D.js'); * This mixin combines the Transformable2D, Lockable, and Publishable mixins to * produce an object that can be interacted with by a WAMS application. * + * @private * @memberof module:mixins * * @mixin diff --git a/src/mixins/Lockable.js b/src/mixins/Lockable.js index 9b279994..97d042f4 100644 --- a/src/mixins/Lockable.js +++ b/src/mixins/Lockable.js @@ -7,6 +7,7 @@ const holder = Symbol.for('holder'); * The Lockable mixin allows a class to enable itself to be locked and unlocked, * with the default being unlocked. * + * @private * @memberof module:mixins * * @mixin diff --git a/src/mixins/Locker.js b/src/mixins/Locker.js index 6249de83..3d07da61 100644 --- a/src/mixins/Locker.js +++ b/src/mixins/Locker.js @@ -5,6 +5,7 @@ const lockedItem = Symbol('lockedItem'); /** * The Locker mixin allows a class to obtain and release a lock on an item. * + * @private * @memberof module:mixins * * @mixin diff --git a/src/mixins/Publishable.js b/src/mixins/Publishable.js index 490bbf5a..d6df1222 100644 --- a/src/mixins/Publishable.js +++ b/src/mixins/Publishable.js @@ -15,6 +15,7 @@ const symbols = Object.freeze({ * is ensure that the publication will not be sent until all transformations * relating to an event have been applied. * + * @private * @memberof module:mixins * * @mixin diff --git a/src/mixins/Transformable2D.js b/src/mixins/Transformable2D.js index 7c494a9e..81afea01 100644 --- a/src/mixins/Transformable2D.js +++ b/src/mixins/Transformable2D.js @@ -6,6 +6,7 @@ const { Point2D } = require('../shared.js'); * This mixin provides 2D transformation operations for classes with 'x', 'y', * 'scale' and 'rotation' properties. * + * @private * @memberof module:mixins * * @mixin diff --git a/src/predefined/layouts.js b/src/predefined/layouts.js index c47db2b0..e687e89e 100644 --- a/src/predefined/layouts.js +++ b/src/predefined/layouts.js @@ -73,6 +73,12 @@ class TableLayout { device.rotateBy(-constants.ROTATE_90); } + /** + * Apply the layout to a newly connected view and its device. + * + * @param {module:server.ServerView} view + * @param {module:server.Device} device + */ layout(view, device) { const index = view.index > 0 ? (view.index % 4) + 1 : 0; console.log('INDEX', index); @@ -128,6 +134,12 @@ class LineLayout { this.deviceRights = []; } + /** + * Apply the layout to a newly connected view and its device. + * + * @param {module:server.ServerView} view + * @param {module:server.Device} device + */ layout(view, device) { if (this.views.length > 0) { // Challenge with the layout is to position the new view correctly in the @@ -157,6 +169,7 @@ class LineLayout { } /** + * @private * @deprecated * @param {number} overlap * @returns {TableLayout} @@ -168,6 +181,7 @@ function table(overlap) { } /** + * @private * @deprecated * @param {number} overlap * @returns {LineLayout} diff --git a/src/server.js b/src/server.js index f1fca387..52b0bfa5 100644 --- a/src/server.js +++ b/src/server.js @@ -8,6 +8,7 @@ * style = "max-height: 260px;" * > * + * @private * @module server */ diff --git a/src/server/Device.js b/src/server/Device.js index bb678808..99456d90 100644 --- a/src/server/Device.js +++ b/src/server/Device.js @@ -7,6 +7,7 @@ const { Transformable2D } = require('../mixins.js'); * A Device keeps track of the physical position of a device connected to an * application. * + * @private * @memberof module:server * @extends module:shared.View * @mixes module:mixins.Transformable2D diff --git a/src/server/GestureController.js b/src/server/GestureController.js index b62065e1..cc3ff051 100644 --- a/src/server/GestureController.js +++ b/src/server/GestureController.js @@ -6,6 +6,7 @@ const { Region, Pan, Rotate, Pinch, Swipe, Swivel, Tap } = require('westures/ind * The GestureController is in charge of processing server-side gestures for the * purpose of enabling multi-device gestures. * + * @private * @memberof module:server * * @param {module:server.MessageHandler} messageHandler - For responding to diff --git a/src/server/MessageHandler.js b/src/server/MessageHandler.js index 14b54f04..714ed079 100644 --- a/src/server/MessageHandler.js +++ b/src/server/MessageHandler.js @@ -4,6 +4,7 @@ * The MessageHandler logs listeners that are attached by the user and receives * messages from clients, which it then uses to call the appropriate listener. * + * @private * @memberof module:server * * @param {module:server.Application} application - The WAMS application for diff --git a/src/server/ServerController.js b/src/server/ServerController.js index c5885389..9e0bd6eb 100644 --- a/src/server/ServerController.js +++ b/src/server/ServerController.js @@ -13,6 +13,7 @@ const symbols = Object.freeze({ * A ServerController maintains a socket.io connection between a client and the * server. It tracks a view associated with the client. * + * @private * @memberof module:server * * @param {number} index - The index of this ServerController in the workspace, diff --git a/src/server/Switchboard.js b/src/server/Switchboard.js index 699b664a..44fa2806 100644 --- a/src/server/Switchboard.js +++ b/src/server/Switchboard.js @@ -49,6 +49,7 @@ function logConnection(id, status) { * server establishment, and establishing connections when new clients connect * to the server. * + * @private * @memberof module:server * * @param {module:server.Application} application - The WAMS application for diff --git a/src/server/ViewSpace.js b/src/server/ViewSpace.js index a5c42ba7..878ff024 100644 --- a/src/server/ViewSpace.js +++ b/src/server/ViewSpace.js @@ -7,6 +7,7 @@ const ServerView = require('./ServerView'); /** * The ViewSpace keeps track of views and view groups. * + * @private * @memberof module:server * * @param {module:server.MessageHandler} messageHandler - The message handler for diff --git a/src/server/WorkSpace.js b/src/server/WorkSpace.js index 6ad94fb2..0cfbf72e 100644 --- a/src/server/WorkSpace.js +++ b/src/server/WorkSpace.js @@ -10,6 +10,7 @@ const ServerItem = require('./ServerItem.js'); * The WorkSpace keeps track of items, and can handle events on those items * which allow them to be interacted with. * + * @private * @memberof module:server * * @param {Namespace} namespace - Socket.io namespace for publishing changes. diff --git a/src/shared.js b/src/shared.js index a185592e..45e22930 100644 --- a/src/shared.js +++ b/src/shared.js @@ -9,6 +9,7 @@ * style = "max-height: 250px;" * > * + * @private * @module shared */ diff --git a/src/shared/IdStamper.js b/src/shared/IdStamper.js index cbbf6ef2..ef1d26ac 100644 --- a/src/shared/IdStamper.js +++ b/src/shared/IdStamper.js @@ -35,6 +35,7 @@ function getUniqueId(previous) { * IdStamper.cloneId(danger, obj.id); // Will work. 'danger' & 'obj' are * // now both using the same Id. * + * @private * @memberof module:shared */ class IdStamper { diff --git a/src/shared/Message.js b/src/shared/Message.js index 500982c6..792ed156 100644 --- a/src/shared/Message.js +++ b/src/shared/Message.js @@ -3,6 +3,7 @@ /** * Enum of the various message types. * + * @private * @name Message * @enum {string} * @readonly diff --git a/src/shared/bases.js b/src/shared/bases.js index dee7c7d1..aace1fa6 100644 --- a/src/shared/bases.js +++ b/src/shared/bases.js @@ -4,7 +4,7 @@ * This Item class provides a common interface between the client and the server * by which the Items can interact safely. * - * @class Item + * @private * @memberof module:shared * @param {Object} values - User-supplied data detailing the item. */ @@ -89,6 +89,15 @@ class Item { } } +/** + * This CanvasItem class provides a common interface between the client and the + * server by which items that are defined by sequences of canvas instructions + * can be rendered safely. + * + * @private + * @memberof module:shared + * @param {Object} values - User-supplied data detailing the item. + */ class CanvasItem extends Item { constructor(values = {}) { super({ @@ -124,7 +133,7 @@ class CanvasItem extends Item { * This RectangularItem class provides a common interface between the client and * the server by which the RectangularItems can interact safely. * - * @class RectangularItem + * @private * @extends module:shared.Item * @memberof module:shared * @param {Object} values - User-supplied data detailing the item. @@ -172,7 +181,7 @@ class RectangularItem extends Item { * This WamsElement class provides a common interface between the client and the * server by which the elements interact safely. * - * @class WamsElement + * @private * @extends module:shared.RectangularItem * @memberof module:shared * @param {Object} values - User-supplied data detailing the item. @@ -232,7 +241,7 @@ class WamsElement extends RectangularItem { * This WamsImage class provides a common interface between the client and the * server by which the images can interact safely. * - * @class WamsImage + * @private * @extends module:shared.RectangularItem * @memberof module:shared * @param {Object} values - User-supplied data detailing the item. @@ -274,7 +283,7 @@ class WamsImage extends RectangularItem { * This View class provides a common interface between the client and * the server by which the Views can interact safely. * - * @class View + * @private * @memberof module:shared * @extends module:shared.RectangularItem * @param {Object} values - User-supplied data detailing the item. diff --git a/src/shared/utilities.js b/src/shared/utilities.js index e56f8bdf..671cbf5f 100644 --- a/src/shared/utilities.js +++ b/src/shared/utilities.js @@ -1,13 +1,13 @@ 'use strict'; /** - * @namespace utilities * @memberof module:shared */ /** * Plain, simple NOP definition. If there's a faster NOP, redefine it here. * + * @private * @memberof module:shared.utilities */ const NOP = () => {}; @@ -15,6 +15,7 @@ const NOP = () => {}; /** * Removes the given item from the given array, according to its Id. * + * @private * @memberof module:shared.utilities * * @param {Object[]} array - The array to modify.