style(remotecontrol): Fix JSDoc for RemoteControlEvent
This commit is contained in:
parent
e693554961
commit
b22e3ee253
|
@ -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});
|
||||
|
|
|
@ -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" ,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 = () => {}) {
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue