Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

style(remotecontrol): Fix JSDoc for RemoteControlEvent

hristoterezovb22e3ee25379
diff --git a/modules/API/API.js b/modules/API/API.js
index fd53ed6950..5fb7423b58 100644
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -218,18 +218,7 @@ class API {
/**
* Sends remote control event.
- * @param {object} event the remote control event. The remote control event
- * has one mandatory property - type which is string from EVENT_TYPES enum
- * defined in /service/remotecontrol/constants. Depending on the event type
- * the event can have other properties or not.
- * mousemove - will also have {int} properties x and y
- * mousedown, mouseup and mousedblclick - will have {int} property button
- * with values - 1(left), 2(middle) or 3 (right)
- * mousescroll - will have {int} property y
- * keydown and keyup - will have {string} property key and array of strings
- * property modifiers.
- * stop - won't have any other properties
- * permissions - will have {PERMISSIONS_ACTIONS} property action.
+ * @param {RemoteControlEvent} event the remote control event.
*/
sendRemoteControlEvent(event) {
sendMessage({method: "remote-control-event", params: event});
diff --git a/modules/keycode/keycode.js b/modules/keycode/keycode.js
index b6f5c8d711..2bbc2debc3 100644
--- a/modules/keycode/keycode.js
+++ b/modules/keycode/keycode.js
@@ -1,6 +1,8 @@
/**
* Enumerates the supported keys.
- * NOTE: The maps represents actual keys on the keyboard not chars.
+ * NOTE: The maps represents actual keys on the keyboard not chars.
+ * @readonly
+ * @enum {string}
*/
export const KEYS = {
BACKSPACE: "backspace" ,
diff --git a/modules/remotecontrol/Controller.js b/modules/remotecontrol/Controller.js
index 4f4ebcb8d5..ad4521a96c 100644
--- a/modules/remotecontrol/Controller.js
+++ b/modules/remotecontrol/Controller.js
@@ -126,7 +126,7 @@ export default class Controller extends RemoteControlParticipant {
* Handles the reply of the permissions request.
* @param {JitsiParticipant} participant the participant that has sent the
* reply
- * @param {object} event the remote control event.
+ * @param {RemoteControlEvent} event the remote control event.
*/
_handleReply(participant, event) {
const remoteControlEvent = event.event;
@@ -159,7 +159,10 @@ export default class Controller extends RemoteControlParticipant {
* Handles remote control stopped.
* @param {JitsiParticipant} participant the participant that has sent the
* event
- * @param {object} event the the remote control event.
+ * @param {Object} event EndpointMessage event from the data channels.
+ * @property {string} type property. The function process only events of
+ * type REMOTE_CONTROL_EVENT_TYPE
+ * @property {RemoteControlEvent} event - the remote control event.
*/
_handleRemoteControlStoppedEvent(participant, event) {
if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE
diff --git a/modules/remotecontrol/Receiver.js b/modules/remotecontrol/Receiver.js
index ea55bca801..2ffdc5afd4 100644
--- a/modules/remotecontrol/Receiver.js
+++ b/modules/remotecontrol/Receiver.js
@@ -94,10 +94,10 @@ export default class Receiver extends RemoteControlParticipant {
* type remote control. Sends "remote-control-event" events to the API
* module.
* @param {JitsiParticipant} participant the controller participant
- * @param {Object} event EndpointMessage event from the data channels. It
- * has {string} type property. The function process only events of type
- * REMOTE_CONTROL_EVENT_TYPE which will have event property(the remote
- * control event)
+ * @param {Object} event EndpointMessage event from the data channels.
+ * @property {string} type property. The function process only events of
+ * type REMOTE_CONTROL_EVENT_TYPE
+ * @property {RemoteControlEvent} event - the remote control event.
*/
_onRemoteControlEvent(participant, event) {
if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE) {
diff --git a/modules/remotecontrol/RemoteControl.js b/modules/remotecontrol/RemoteControl.js
index f97b52754f..86f1f51e50 100644
--- a/modules/remotecontrol/RemoteControl.js
+++ b/modules/remotecontrol/RemoteControl.js
@@ -43,14 +43,7 @@ class RemoteControl {
/**
* Handles remote control events from the API module. Currently only events
* with type = EVENT_TYPES.supported or EVENT_TYPES.permissions
- * @param {object} event the remote control event. The remote control event
- * has one mandatory property - type which is string from EVENT_TYPES enum
- * defined in /service/remotecontrol/constants. If the event type is
- * "supported" it won't have any other properties. If the event type is
- * "permissions" the method will expect also the following properties:
- * {string} userId - the user id of the participant that made the request
- * for permissions
- * {PERMISSIONS_ACTIONS} action the action related to the event.
+ * @param {RemoteControlEvent} event the remote control event.
*/
onRemoteControlAPIEvent(event) {
switch(event.type) {
diff --git a/modules/remotecontrol/RemoteControlParticipant.js b/modules/remotecontrol/RemoteControlParticipant.js
index b74f73fad8..0f283ba9ff 100644
--- a/modules/remotecontrol/RemoteControlParticipant.js
+++ b/modules/remotecontrol/RemoteControlParticipant.js
@@ -21,7 +21,7 @@ export default class RemoteControlParticipant {
/**
* Sends remote control event to other participant trough data channel.
- * @param {Object} event the remote control event.
+ * @param {RemoteControlEvent} event the remote control event.
* @param {Function} onDataChannelFail handler for data channel failure.
*/
_sendRemoteControlEvent(to, event, onDataChannelFail = () => {}) {
diff --git a/service/remotecontrol/Constants.js b/service/remotecontrol/Constants.js
index afc8cc15e4..c856185ac8 100644
--- a/service/remotecontrol/Constants.js
+++ b/service/remotecontrol/Constants.js
@@ -6,6 +6,8 @@ export const DISCO_REMOTE_CONTROL_FEATURE
/**
* Types of remote-control-event events.
+ * @readonly
+ * @enum {string}
*/
export const EVENT_TYPES = {
mousemove: "mousemove",
@@ -22,6 +24,8 @@ export const EVENT_TYPES = {
/**
* Actions for the remote control permission events.
+ * @readonly
+ * @enum {string}
*/
export const PERMISSIONS_ACTIONS = {
request: "request",
@@ -34,3 +38,32 @@ export const PERMISSIONS_ACTIONS = {
* The type of remote control events sent trough the API module.
*/
export const REMOTE_CONTROL_EVENT_TYPE = "remote-control-event";
+
+/**
+ * The remote control event.
+ * @typedef {object} RemoteControlEvent
+ * @property {EVENT_TYPES} type - the type of the event
+ * @property {int} x - avaibale for type === mousemove only. The new x
+ * coordinate of the mouse
+ * @property {int} y - For mousemove type - the new y
+ * coordinate of the mouse and for mousescroll - represents the vertical
+ * scrolling diff value
+ * @property {int} button - 1(left), 2(middle) or 3 (right). Supported by
+ * mousedown, mouseup and mousedblclick types.
+ * @property {KEYS} key - Represents the key related to the event. Supported by
+ * keydown and keyup types.
+ * @property {KEYS[]} modifiers - Represents the modifier related to the event.
+ * Supported by keydown and keyup types.
+ * @property {PERMISSIONS_ACTIONS} action - Supported by type === permissions.
+ * Represents the action related to the permissions event.
+ *
+ * Optional properties. Supported for permissions event for action === request:
+ * @property {string} userId - The user id of the participant that has sent the
+ * request.
+ * @property {string} userJID - The full JID in the MUC of the user that has
+ * sent the request.
+ * @property {string} displayName - the displayName of the participant that has
+ * sent the request.
+ * @property {boolean} screenSharing - true if the SS is started for the local
+ * participant and false if not.
+ */