Bladeren bron

style(remotecontrol): Fix JSDoc for RemoteControlEvent

j8
hristoterezov 8 jaren geleden
bovenliggende
commit
b22e3ee253

+ 1
- 12
modules/API/API.js Bestand weergeven

218
 
218
 
219
     /**
219
     /**
220
      * Sends remote control event.
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
     sendRemoteControlEvent(event) {
223
     sendRemoteControlEvent(event) {
235
         sendMessage({method: "remote-control-event", params: event});
224
         sendMessage({method: "remote-control-event", params: event});

+ 3
- 1
modules/keycode/keycode.js Bestand weergeven

1
 /**
1
 /**
2
  * Enumerates the supported keys.
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
 export const KEYS = {
7
 export const KEYS = {
6
     BACKSPACE: "backspace" ,
8
     BACKSPACE: "backspace" ,

+ 5
- 2
modules/remotecontrol/Controller.js Bestand weergeven

126
      * Handles the reply of the permissions request.
126
      * Handles the reply of the permissions request.
127
      * @param {JitsiParticipant} participant the participant that has sent the
127
      * @param {JitsiParticipant} participant the participant that has sent the
128
      * reply
128
      * reply
129
-     * @param {object} event the remote control event.
129
+     * @param {RemoteControlEvent} event the remote control event.
130
      */
130
      */
131
     _handleReply(participant, event) {
131
     _handleReply(participant, event) {
132
         const remoteControlEvent = event.event;
132
         const remoteControlEvent = event.event;
159
      * Handles remote control stopped.
159
      * Handles remote control stopped.
160
      * @param {JitsiParticipant} participant the participant that has sent the
160
      * @param {JitsiParticipant} participant the participant that has sent the
161
      * event
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
     _handleRemoteControlStoppedEvent(participant, event) {
167
     _handleRemoteControlStoppedEvent(participant, event) {
165
         if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE
168
         if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE

+ 4
- 4
modules/remotecontrol/Receiver.js Bestand weergeven

94
      * type remote control. Sends "remote-control-event" events to the API
94
      * type remote control. Sends "remote-control-event" events to the API
95
      * module.
95
      * module.
96
      * @param {JitsiParticipant} participant the controller participant
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
     _onRemoteControlEvent(participant, event) {
102
     _onRemoteControlEvent(participant, event) {
103
         if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE) {
103
         if(this.enabled && event.type === REMOTE_CONTROL_EVENT_TYPE) {

+ 1
- 8
modules/remotecontrol/RemoteControl.js Bestand weergeven

43
     /**
43
     /**
44
      * Handles remote control events from the API module. Currently only events
44
      * Handles remote control events from the API module. Currently only events
45
      * with type = EVENT_TYPES.supported or EVENT_TYPES.permissions
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
     onRemoteControlAPIEvent(event) {
48
     onRemoteControlAPIEvent(event) {
56
         switch(event.type) {
49
         switch(event.type) {

+ 1
- 1
modules/remotecontrol/RemoteControlParticipant.js Bestand weergeven

21
 
21
 
22
     /**
22
     /**
23
      * Sends remote control event to other participant trough data channel.
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
      * @param {Function} onDataChannelFail handler for data channel failure.
25
      * @param {Function} onDataChannelFail handler for data channel failure.
26
      */
26
      */
27
     _sendRemoteControlEvent(to, event, onDataChannelFail = () => {}) {
27
     _sendRemoteControlEvent(to, event, onDataChannelFail = () => {}) {

+ 33
- 0
service/remotecontrol/Constants.js Bestand weergeven

6
 
6
 
7
 /**
7
 /**
8
  * Types of remote-control-event events.
8
  * Types of remote-control-event events.
9
+  * @readonly
10
+  * @enum {string}
9
  */
11
  */
10
 export const EVENT_TYPES = {
12
 export const EVENT_TYPES = {
11
     mousemove: "mousemove",
13
     mousemove: "mousemove",
22
 
24
 
23
 /**
25
 /**
24
  * Actions for the remote control permission events.
26
  * Actions for the remote control permission events.
27
+ * @readonly
28
+ * @enum {string}
25
  */
29
  */
26
 export const PERMISSIONS_ACTIONS = {
30
 export const PERMISSIONS_ACTIONS = {
27
     request: "request",
31
     request: "request",
34
  * The type of remote control events sent trough the API module.
38
  * The type of remote control events sent trough the API module.
35
  */
39
  */
36
 export const REMOTE_CONTROL_EVENT_TYPE = "remote-control-event";
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
+ */

Laden…
Annuleren
Opslaan