Переглянути джерело

style(remotecontrol): Fix JSDoc for RemoteControlEvent

j8
hristoterezov 8 роки тому
джерело
коміт
b22e3ee253

+ 1
- 12
modules/API/API.js Переглянути файл

@@ -218,18 +218,7 @@ class API {
218 218
 
219 219
     /**
220 220
      * Sends remote control event.
221
-     * @param {object} event the remote control event. The remote control event
222
-     * has one mandatory property - type which is string from EVENT_TYPES enum
223
-     * defined in /service/remotecontrol/constants. Depending on the event type
224
-     * the event can have other properties or not.
225
-     * mousemove - will also have {int} properties x and y
226
-     * mousedown, mouseup and mousedblclick - will have {int} property button
227
-     * with values - 1(left), 2(middle) or 3 (right)
228
-     * mousescroll - will have {int} property y
229
-     * keydown and keyup - will have {string} property key and array of strings
230
-     * property modifiers.
231
-     * stop - won't have any other properties
232
-     * permissions - will have {PERMISSIONS_ACTIONS} property action.
221
+     * @param {RemoteControlEvent} event the remote control event. 
233 222
      */
234 223
     sendRemoteControlEvent(event) {
235 224
         sendMessage({method: "remote-control-event", params: event});

+ 3
- 1
modules/keycode/keycode.js Переглянути файл

@@ -1,6 +1,8 @@
1 1
 /**
2 2
  * Enumerates the supported keys.
3
- * NOTE: The maps represents actual keys on the keyboard not chars. 
3
+ * NOTE: The maps represents actual keys on the keyboard not chars.
4
+ * @readonly
5
+ * @enum {string}
4 6
  */
5 7
 export const KEYS = {
6 8
     BACKSPACE: "backspace" ,

+ 5
- 2
modules/remotecontrol/Controller.js Переглянути файл

@@ -126,7 +126,7 @@ export default class Controller extends RemoteControlParticipant {
126 126
      * Handles the reply of the permissions request.
127 127
      * @param {JitsiParticipant} participant the participant that has sent the
128 128
      * reply
129
-     * @param {object} event the remote control event.
129
+     * @param {RemoteControlEvent} event the remote control event.
130 130
      */
131 131
     _handleReply(participant, event) {
132 132
         const remoteControlEvent = event.event;
@@ -159,7 +159,10 @@ export default class Controller extends RemoteControlParticipant {
159 159
      * Handles remote control stopped.
160 160
      * @param {JitsiParticipant} participant the participant that has sent the
161 161
      * event
162
-     * @param {object} event the the remote control event.
162
+     * @param {Object} event EndpointMessage event from the data channels.
163
+     * @property {string} type property. The function process only events of
164
+     * type REMOTE_CONTROL_EVENT_TYPE
165
+     * @property {RemoteControlEvent} event - the remote control event.
163 166
      */
164 167
     _handleRemoteControlStoppedEvent(participant, event) {
165 168
         if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE

+ 4
- 4
modules/remotecontrol/Receiver.js Переглянути файл

@@ -94,10 +94,10 @@ export default class Receiver extends RemoteControlParticipant {
94 94
      * type remote control. Sends "remote-control-event" events to the API
95 95
      * module.
96 96
      * @param {JitsiParticipant} participant the controller participant
97
-     * @param {Object} event EndpointMessage event from the data channels. It
98
-     * has {string} type property. The function process only events of type
99
-     * REMOTE_CONTROL_EVENT_TYPE which will have event property(the remote
100
-     * control event)
97
+     * @param {Object} event EndpointMessage event from the data channels.
98
+     * @property {string} type property. The function process only events of
99
+     * type REMOTE_CONTROL_EVENT_TYPE
100
+     * @property {RemoteControlEvent} event - the remote control event.
101 101
      */
102 102
     _onRemoteControlEvent(participant, event) {
103 103
         if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE) {

+ 1
- 8
modules/remotecontrol/RemoteControl.js Переглянути файл

@@ -43,14 +43,7 @@ class RemoteControl {
43 43
     /**
44 44
      * Handles remote control events from the API module. Currently only events
45 45
      * with type = EVENT_TYPES.supported or EVENT_TYPES.permissions
46
-     * @param {object} event the remote control event. The remote control event
47
-     * has one mandatory property - type which is string from EVENT_TYPES enum
48
-     * defined in /service/remotecontrol/constants. If the event type is
49
-     * "supported" it won't have any other properties. If the event type is
50
-     * "permissions" the method will expect also the following properties:
51
-     * {string} userId - the user id of the participant that made the request
52
-     * for permissions
53
-     * {PERMISSIONS_ACTIONS} action the action related to the event.
46
+     * @param {RemoteControlEvent} event the remote control event.
54 47
      */
55 48
     onRemoteControlAPIEvent(event) {
56 49
         switch(event.type) {

+ 1
- 1
modules/remotecontrol/RemoteControlParticipant.js Переглянути файл

@@ -21,7 +21,7 @@ export default class RemoteControlParticipant {
21 21
 
22 22
     /**
23 23
      * Sends remote control event to other participant trough data channel.
24
-     * @param {Object} event the remote control event.
24
+     * @param {RemoteControlEvent} event the remote control event.
25 25
      * @param {Function} onDataChannelFail handler for data channel failure.
26 26
      */
27 27
     _sendRemoteControlEvent(to, event, onDataChannelFail = () => {}) {

+ 33
- 0
service/remotecontrol/Constants.js Переглянути файл

@@ -6,6 +6,8 @@ export const DISCO_REMOTE_CONTROL_FEATURE
6 6
 
7 7
 /**
8 8
  * Types of remote-control-event events.
9
+  * @readonly
10
+  * @enum {string}
9 11
  */
10 12
 export const EVENT_TYPES = {
11 13
     mousemove: "mousemove",
@@ -22,6 +24,8 @@ export const EVENT_TYPES = {
22 24
 
23 25
 /**
24 26
  * Actions for the remote control permission events.
27
+ * @readonly
28
+ * @enum {string}
25 29
  */
26 30
 export const PERMISSIONS_ACTIONS = {
27 31
     request: "request",
@@ -34,3 +38,32 @@ export const PERMISSIONS_ACTIONS = {
34 38
  * The type of remote control events sent trough the API module.
35 39
  */
36 40
 export const REMOTE_CONTROL_EVENT_TYPE = "remote-control-event";
41
+
42
+/**
43
+ * The remote control event.
44
+ * @typedef {object} RemoteControlEvent
45
+ * @property {EVENT_TYPES} type - the type of the event
46
+ * @property {int} x - avaibale for type === mousemove only. The new x
47
+ * coordinate of the mouse
48
+ * @property {int} y - For mousemove type - the new y
49
+ * coordinate of the mouse and for mousescroll - represents the vertical
50
+ * scrolling diff value
51
+ * @property {int} button - 1(left), 2(middle) or 3 (right). Supported by
52
+ * mousedown, mouseup and mousedblclick types.
53
+ * @property {KEYS} key - Represents the key related to the event. Supported by
54
+ * keydown and keyup types.
55
+ * @property {KEYS[]} modifiers - Represents the modifier related to the event.
56
+ * Supported by keydown and keyup types.
57
+ * @property {PERMISSIONS_ACTIONS} action - Supported by type === permissions.
58
+ * Represents the action related to the permissions event.
59
+ *
60
+ * Optional properties. Supported for permissions event for action === request:
61
+ * @property {string} userId - The user id of the participant that has sent the
62
+ * request.
63
+ * @property {string} userJID - The full JID in the MUC of the user that has
64
+ * sent the request.
65
+ * @property {string} displayName - the displayName of the participant that has
66
+ * sent the request.
67
+ * @property {boolean} screenSharing - true if the SS is started for the local
68
+ * participant and false if not.
69
+ */

Завантаження…
Відмінити
Зберегти