From 0a11404be293e264c72a0ce4c7b18d8b755dbc2c Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 12 Jan 2017 11:46:07 +0000 Subject: [PATCH] Fix legitimate JSDoc errors --- src/base-apis.js | 3 ++- src/client.js | 2 +- src/crypto/algorithms/base.js | 2 +- src/crypto/algorithms/megolm.js | 7 ++----- src/crypto/algorithms/olm.js | 2 +- src/crypto/index.js | 4 ++-- src/filter-component.js | 2 +- src/interactive-auth.js | 4 ++-- src/models/room-state.js | 10 +++++----- src/sync.js | 2 +- src/webrtc/call.js | 6 +++--- 11 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/base-apis.js b/src/base-apis.js index 36ef33aef..47c831c83 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -439,6 +439,7 @@ MatrixBaseApis.prototype.roomInitialSync = function(roomId, limit, callback) { // ========================= /** + * @param {Object} options Options for this request * @param {string} options.server The remote server to query for the room list. * Optional. If unspecified, get the local home * server's public room list. @@ -1022,7 +1023,7 @@ MatrixBaseApis.prototype.downloadKeysForUsers = function(userIds, callback) { /** * Claim one-time keys * - * @param {string[][]} devices a list of [userId, deviceId] pairs + * @param {string[]} devices a list of [userId, deviceId] pairs * * @param {string} [key_algorithm = signed_curve25519] desired key type * diff --git a/src/client.js b/src/client.js index 254bc0aa8..2e1410d0c 100644 --- a/src/client.js +++ b/src/client.js @@ -542,7 +542,7 @@ MatrixClient.prototype.getUsers = function() { /** * Set account data event for the current user. * @param {string} eventType The event type - * @param {Object} content the contents object for the event + * @param {Object} contents the contents object for the event * @param {module:client.callback} callback Optional. * @return {module:client.Promise} Resolves: TODO * @return {module:http-api.MatrixError} Rejects: with an error response. diff --git a/src/crypto/algorithms/base.js b/src/crypto/algorithms/base.js index afdc555b8..4374fde8f 100644 --- a/src/crypto/algorithms/base.js +++ b/src/crypto/algorithms/base.js @@ -130,7 +130,7 @@ module.exports.DecryptionAlgorithm = DecryptionAlgorithm; * * @method module:crypto/algorithms/base.DecryptionAlgorithm#onRoomKeyEvent * - * @param {module:models/event.MatrixEvent} event key event + * @param {module:models/event.MatrixEvent} params event key event */ DecryptionAlgorithm.prototype.onRoomKeyEvent = function(params) { // ignore by default diff --git a/src/crypto/algorithms/megolm.js b/src/crypto/algorithms/megolm.js index f7a063ca3..0a27162ce 100644 --- a/src/crypto/algorithms/megolm.js +++ b/src/crypto/algorithms/megolm.js @@ -150,7 +150,7 @@ utils.inherits(MegolmEncryption, base.EncryptionAlgorithm); /** * @private * - * @param {module:models/room} room + * @param {Object} devicesInRoom The devices in this room, indexed by user ID * * @return {module:client.Promise} Promise which resolves to the * OutboundSessionInfo when setup is complete. @@ -378,7 +378,7 @@ MegolmEncryption.prototype._shareKeyWithDevices = function(session, devicesByUse * * @param {module:models/room} room * @param {string} eventType - * @param {object} plaintext event content + * @param {object} content plaintext event content * * @return {module:client.Promise} Promise which resolves to the new event body */ @@ -475,9 +475,6 @@ utils.inherits(MegolmDecryption, base.DecryptionAlgorithm); * * @param {MatrixEvent} event * - * @return {null} The event referred to an unknown megolm session - * @return {module:crypto.DecryptionResult} decryption result - * * @throws {module:crypto/algorithms/base.DecryptionError} if there is a * problem decrypting the event */ diff --git a/src/crypto/algorithms/olm.js b/src/crypto/algorithms/olm.js index 5852aa82c..dc42d5b4c 100644 --- a/src/crypto/algorithms/olm.js +++ b/src/crypto/algorithms/olm.js @@ -79,7 +79,7 @@ OlmEncryption.prototype._ensureSession = function(roomMembers) { * * @param {module:models/room} room * @param {string} eventType - * @param {object} plaintext event content + * @param {object} content plaintext event content * * @return {module:client.Promise} Promise which resolves to the new event body */ diff --git a/src/crypto/index.js b/src/crypto/index.js index 300e8c56e..fd189d290 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -348,7 +348,7 @@ Crypto.prototype._getDevicesFromStore = function(userIds) { /** * @param {string[]} downloadUsers list of userIds * - * @return {Object a map from userId to a promise for a result for that user + * @return {Object} a map from userId to a promise for a result for that user */ Crypto.prototype._doKeyDownloadForUsers = function(downloadUsers) { var self = this; @@ -546,7 +546,7 @@ function _storeDeviceKeys(_olmDevice, userStore, deviceResult) { * * @param {string} userId the user to list keys for. * - * @return {module:crypto/deviceinfo[]?} list of devices, or null if we haven't + * @return {module:crypto/deviceinfo[]|null} list of devices, or null if we haven't * managed to get a list of devices for this user yet. */ Crypto.prototype.getStoredDevicesForUser = function(userId) { diff --git a/src/filter-component.js b/src/filter-component.js index 98f8fd7d7..47fd298da 100644 --- a/src/filter-component.js +++ b/src/filter-component.js @@ -44,7 +44,7 @@ function _matches_wildcard(actual_value, filter_value) { * 'Filters' are referred to as 'FilterCollections'. * * @constructor - * @param {Object} the definition of this filter JSON, e.g. { 'contains_url': true } + * @param {Object} filter_json the definition of this filter JSON, e.g. { 'contains_url': true } */ function FilterComponent(filter_json) { this.filter_json = filter_json; diff --git a/src/interactive-auth.js b/src/interactive-auth.js index 8ba89516b..8b6395e23 100644 --- a/src/interactive-auth.js +++ b/src/interactive-auth.js @@ -89,8 +89,8 @@ InteractiveAuth.prototype = { /** * get the server params for a given stage * - * @param {string} login type for the stage - * @return {object?} any parameters from the server for this stage + * @param {string} loginType login type for the stage + * @return {object?} any parameters from the server for this stage */ getStageParams: function(loginType) { var params = {}; diff --git a/src/models/room-state.js b/src/models/room-state.js index 32b3a924e..68ca2041a 100644 --- a/src/models/room-state.js +++ b/src/models/room-state.js @@ -253,7 +253,7 @@ RoomState.prototype.maySendMessage = function(userId) { /** * Returns true if the given user ID has permission to send a normal * event of type `eventType` into this room. - * @param {string} type The type of event to test + * @param {string} eventType The type of event to test * @param {string} userId The user ID of the user to test permission for * @return {boolean} true if the given user ID should be permitted to send * the given type of event into this room, @@ -267,8 +267,8 @@ RoomState.prototype.maySendEvent = function(eventType, userId) { /** * Returns true if the given MatrixClient has permission to send a state * event of type `stateEventType` into this room. - * @param {string} type The type of state events to test - * @param {MatrixClient} The client to test permission for + * @param {string} stateEventType The type of state events to test + * @param {MatrixClient} cli The client to test permission for * @return {boolean} true if the given client should be permitted to send * the given type of state event into this room, * according to the room's state. @@ -283,7 +283,7 @@ RoomState.prototype.mayClientSendStateEvent = function(stateEventType, cli) { /** * Returns true if the given user ID has permission to send a state * event of type `stateEventType` into this room. - * @param {string} type The type of state events to test + * @param {string} stateEventType The type of state events to test * @param {string} userId The user ID of the user to test permission for * @return {boolean} true if the given user ID should be permitted to send * the given type of state event into this room, @@ -296,7 +296,7 @@ RoomState.prototype.maySendStateEvent = function(stateEventType, userId) { /** * Returns true if the given user ID has permission to send a normal or state * event of type `eventType` into this room. - * @param {string} type The type of event to test + * @param {string} eventType The type of event to test * @param {string} userId The user ID of the user to test permission for * @param {boolean} state If true, tests if the user may send a state event of this type. Otherwise tests whether diff --git a/src/sync.js b/src/sync.js index 160a8b26d..cb3c9b1e2 100644 --- a/src/sync.js +++ b/src/sync.js @@ -1016,7 +1016,7 @@ SyncApi.prototype._resolveInvites = function(room) { * @param {Room} room * @param {MatrixEvent[]} stateEventList A list of state events. This is the state * at the *START* of the timeline list if it is supplied. - * @param {?MatrixEvent[]} timelineEventList A list of timeline events. Lower index + * @param {MatrixEvent[]} [timelineEventList] A list of timeline events. Lower index * is earlier in time. Higher index is later. */ SyncApi.prototype._processRoomEvents = function(room, stateEventList, diff --git a/src/webrtc/call.js b/src/webrtc/call.js index ab8a1d13d..772472407 100644 --- a/src/webrtc/call.js +++ b/src/webrtc/call.js @@ -153,7 +153,7 @@ MatrixCall.prototype.placeScreenSharingCall = /** * Play the given HTMLMediaElement, serialising the operation into a chain * of promises to avoid racing access to the element - * @param {Element} HTMLMediaElement element to play + * @param {Element} element HTMLMediaElement element to play * @param {string} queueId Arbitrary ID to track the chain of promises to be used */ MatrixCall.prototype.playElement = function(element, queueId) { @@ -183,7 +183,7 @@ MatrixCall.prototype.playElement = function(element, queueId) { /** * Pause the given HTMLMediaElement, serialising the operation into a chain * of promises to avoid racing access to the element - * @param {Element} HTMLMediaElement element to pause + * @param {Element} element HTMLMediaElement element to pause * @param {string} queueId Arbitrary ID to track the chain of promises to be used */ MatrixCall.prototype.pauseElement = function(element, queueId) { @@ -209,7 +209,7 @@ MatrixCall.prototype.pauseElement = function(element, queueId) { * Assign the given HTMLMediaElement by setting the .src attribute on it, * serialising the operation into a chain of promises to avoid racing access * to the element - * @param {Element} HTMLMediaElement element to pause + * @param {Element} element HTMLMediaElement element to pause * @param {string} src the src attribute value to assign to the element * @param {string} queueId Arbitrary ID to track the chain of promises to be used */