1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

chore: remove custom promise, use es6 standard

Signed-off-by: Jack Works <jackworks@protonmail.com>
This commit is contained in:
Jack Works
2020-01-22 11:00:15 +08:00
committed by Travis Ralston
parent 7c79e7e836
commit 468fb2cc41
11 changed files with 190 additions and 201 deletions

View File

@@ -172,7 +172,7 @@ MatrixBaseApis.prototype.makeTxnId = function() {
* Check whether a username is available prior to registration. An error response * Check whether a username is available prior to registration. An error response
* indicates an invalid/unavailable username. * indicates an invalid/unavailable username.
* @param {string} username The username to check the availability of. * @param {string} username The username to check the availability of.
* @return {module:client.Promise} Resolves: to `true`. * @return {Promise} Resolves: to `true`.
*/ */
MatrixBaseApis.prototype.isUsernameAvailable = function(username) { MatrixBaseApis.prototype.isUsernameAvailable = function(username) {
return this._http.authedRequest( return this._http.authedRequest(
@@ -193,7 +193,7 @@ MatrixBaseApis.prototype.isUsernameAvailable = function(username) {
* @param {string} guestAccessToken * @param {string} guestAccessToken
* @param {string} inhibitLogin * @param {string} inhibitLogin
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.register = function( MatrixBaseApis.prototype.register = function(
@@ -258,7 +258,7 @@ MatrixBaseApis.prototype.register = function(
* @param {Object=} opts Registration options * @param {Object=} opts Registration options
* @param {Object} opts.body JSON HTTP body to provide. * @param {Object} opts.body JSON HTTP body to provide.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.registerGuest = function(opts, callback) { MatrixBaseApis.prototype.registerGuest = function(opts, callback) {
@@ -271,7 +271,7 @@ MatrixBaseApis.prototype.registerGuest = function(opts, callback) {
* @param {Object} data parameters for registration request * @param {Object} data parameters for registration request
* @param {string=} kind type of user to register. may be "guest" * @param {string=} kind type of user to register. may be "guest"
* @param {module:client.callback=} callback * @param {module:client.callback=} callback
* @return {module:client.Promise} Resolves: to the /register response * @return {Promise} Resolves: to the /register response
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.registerRequest = function(data, kind, callback) { MatrixBaseApis.prototype.registerRequest = function(data, kind, callback) {
@@ -287,7 +287,7 @@ MatrixBaseApis.prototype.registerRequest = function(data, kind, callback) {
/** /**
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.loginFlows = function(callback) { MatrixBaseApis.prototype.loginFlows = function(callback) {
@@ -298,7 +298,7 @@ MatrixBaseApis.prototype.loginFlows = function(callback) {
* @param {string} loginType * @param {string} loginType
* @param {Object} data * @param {Object} data
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.login = function(loginType, data, callback) { MatrixBaseApis.prototype.login = function(loginType, data, callback) {
@@ -329,7 +329,7 @@ MatrixBaseApis.prototype.login = function(loginType, data, callback) {
* @param {string} user * @param {string} user
* @param {string} password * @param {string} password
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.loginWithPassword = function(user, password, callback) { MatrixBaseApis.prototype.loginWithPassword = function(user, password, callback) {
@@ -342,7 +342,7 @@ MatrixBaseApis.prototype.loginWithPassword = function(user, password, callback)
/** /**
* @param {string} relayState URL Callback after SAML2 Authentication * @param {string} relayState URL Callback after SAML2 Authentication
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.loginWithSAML2 = function(relayState, callback) { MatrixBaseApis.prototype.loginWithSAML2 = function(relayState, callback) {
@@ -379,7 +379,7 @@ MatrixBaseApis.prototype.getSsoLoginUrl = function(redirectUrl, loginType) {
/** /**
* @param {string} token Login token previously received from homeserver * @param {string} token Login token previously received from homeserver
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.loginWithToken = function(token, callback) { MatrixBaseApis.prototype.loginWithToken = function(token, callback) {
@@ -396,7 +396,7 @@ MatrixBaseApis.prototype.loginWithToken = function(token, callback) {
* it is up to the caller to either reset or destroy the MatrixClient after * it is up to the caller to either reset or destroy the MatrixClient after
* this method succeeds. * this method succeeds.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: On success, the empty object * @return {Promise} Resolves: On success, the empty object
*/ */
MatrixBaseApis.prototype.logout = function(callback) { MatrixBaseApis.prototype.logout = function(callback) {
return this._http.authedRequest( return this._http.authedRequest(
@@ -414,7 +414,7 @@ MatrixBaseApis.prototype.logout = function(callback) {
* @param {boolean} erase Optional. If set, send as `erase` attribute in the * @param {boolean} erase Optional. If set, send as `erase` attribute in the
* JSON request body, indicating whether the account should be erased. Defaults * JSON request body, indicating whether the account should be erased. Defaults
* to false. * to false.
* @return {module:client.Promise} Resolves: On success, the empty object * @return {Promise} Resolves: On success, the empty object
*/ */
MatrixBaseApis.prototype.deactivateAccount = function(auth, erase) { MatrixBaseApis.prototype.deactivateAccount = function(auth, erase) {
if (typeof(erase) === 'function') { if (typeof(erase) === 'function') {
@@ -467,7 +467,7 @@ MatrixBaseApis.prototype.getFallbackAuthUrl = function(loginType, authSessionId)
* @param {string} options.name The name to give this room. * @param {string} options.name The name to give this room.
* @param {string} options.topic The topic to give this room. * @param {string} options.topic The topic to give this room.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: <code>{room_id: {string}, * @return {Promise} Resolves: <code>{room_id: {string},
* room_alias: {string(opt)}}</code> * room_alias: {string(opt)}}</code>
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
@@ -512,7 +512,7 @@ MatrixBaseApis.prototype.fetchRelations =
/** /**
* @param {string} roomId * @param {string} roomId
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.roomState = function(roomId, callback) { MatrixBaseApis.prototype.roomState = function(roomId, callback) {
@@ -545,7 +545,7 @@ MatrixBaseApis.prototype.fetchRoomEvent = function(roomId, eventId, callback) {
* @param {string} excludeMembership the membership type to exclude from the response * @param {string} excludeMembership the membership type to exclude from the response
* @param {string} atEventId the id of the event for which moment in the timeline the members should be returned for * @param {string} atEventId the id of the event for which moment in the timeline the members should be returned for
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: dictionary of userid to profile information * @return {Promise} Resolves: dictionary of userid to profile information
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.members = MatrixBaseApis.prototype.members =
@@ -572,7 +572,7 @@ function(roomId, includeMembership, excludeMembership, atEventId, callback) {
* Upgrades a room to a new protocol version * Upgrades a room to a new protocol version
* @param {string} roomId * @param {string} roomId
* @param {string} newVersion The target version to upgrade to * @param {string} newVersion The target version to upgrade to
* @return {module:client.Promise} Resolves: Object with key 'replacement_room' * @return {Promise} Resolves: Object with key 'replacement_room'
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.upgradeRoom = function(roomId, newVersion) { MatrixBaseApis.prototype.upgradeRoom = function(roomId, newVersion) {
@@ -585,7 +585,7 @@ MatrixBaseApis.prototype.upgradeRoom = function(roomId, newVersion) {
/** /**
* @param {string} groupId * @param {string} groupId
* @return {module:client.Promise} Resolves: Group summary object * @return {Promise} Resolves: Group summary object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getGroupSummary = function(groupId) { MatrixBaseApis.prototype.getGroupSummary = function(groupId) {
@@ -595,7 +595,7 @@ MatrixBaseApis.prototype.getGroupSummary = function(groupId) {
/** /**
* @param {string} groupId * @param {string} groupId
* @return {module:client.Promise} Resolves: Group profile object * @return {Promise} Resolves: Group profile object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getGroupProfile = function(groupId) { MatrixBaseApis.prototype.getGroupProfile = function(groupId) {
@@ -610,7 +610,7 @@ MatrixBaseApis.prototype.getGroupProfile = function(groupId) {
* @param {string=} profile.avatar_url MXC avatar URL * @param {string=} profile.avatar_url MXC avatar URL
* @param {string=} profile.short_description A short description of the room * @param {string=} profile.short_description A short description of the room
* @param {string=} profile.long_description A longer HTML description of the room * @param {string=} profile.long_description A longer HTML description of the room
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setGroupProfile = function(groupId, profile) { MatrixBaseApis.prototype.setGroupProfile = function(groupId, profile) {
@@ -626,7 +626,7 @@ MatrixBaseApis.prototype.setGroupProfile = function(groupId, profile) {
* least a 'type' field which is 'open' if anyone can join the group * least a 'type' field which is 'open' if anyone can join the group
* the group without prior approval, or 'invite' if an invite is * the group without prior approval, or 'invite' if an invite is
* required to join. * required to join.
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setGroupJoinPolicy = function(groupId, policy) { MatrixBaseApis.prototype.setGroupJoinPolicy = function(groupId, policy) {
@@ -643,7 +643,7 @@ MatrixBaseApis.prototype.setGroupJoinPolicy = function(groupId, policy) {
/** /**
* @param {string} groupId * @param {string} groupId
* @return {module:client.Promise} Resolves: Group users list object * @return {Promise} Resolves: Group users list object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getGroupUsers = function(groupId) { MatrixBaseApis.prototype.getGroupUsers = function(groupId) {
@@ -653,7 +653,7 @@ MatrixBaseApis.prototype.getGroupUsers = function(groupId) {
/** /**
* @param {string} groupId * @param {string} groupId
* @return {module:client.Promise} Resolves: Group users list object * @return {Promise} Resolves: Group users list object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getGroupInvitedUsers = function(groupId) { MatrixBaseApis.prototype.getGroupInvitedUsers = function(groupId) {
@@ -663,7 +663,7 @@ MatrixBaseApis.prototype.getGroupInvitedUsers = function(groupId) {
/** /**
* @param {string} groupId * @param {string} groupId
* @return {module:client.Promise} Resolves: Group rooms list object * @return {Promise} Resolves: Group rooms list object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getGroupRooms = function(groupId) { MatrixBaseApis.prototype.getGroupRooms = function(groupId) {
@@ -674,7 +674,7 @@ MatrixBaseApis.prototype.getGroupRooms = function(groupId) {
/** /**
* @param {string} groupId * @param {string} groupId
* @param {string} userId * @param {string} userId
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.inviteUserToGroup = function(groupId, userId) { MatrixBaseApis.prototype.inviteUserToGroup = function(groupId, userId) {
@@ -688,7 +688,7 @@ MatrixBaseApis.prototype.inviteUserToGroup = function(groupId, userId) {
/** /**
* @param {string} groupId * @param {string} groupId
* @param {string} userId * @param {string} userId
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.removeUserFromGroup = function(groupId, userId) { MatrixBaseApis.prototype.removeUserFromGroup = function(groupId, userId) {
@@ -703,7 +703,7 @@ MatrixBaseApis.prototype.removeUserFromGroup = function(groupId, userId) {
* @param {string} groupId * @param {string} groupId
* @param {string} userId * @param {string} userId
* @param {string} roleId Optional. * @param {string} roleId Optional.
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.addUserToGroupSummary = function(groupId, userId, roleId) { MatrixBaseApis.prototype.addUserToGroupSummary = function(groupId, userId, roleId) {
@@ -719,7 +719,7 @@ MatrixBaseApis.prototype.addUserToGroupSummary = function(groupId, userId, roleI
/** /**
* @param {string} groupId * @param {string} groupId
* @param {string} userId * @param {string} userId
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.removeUserFromGroupSummary = function(groupId, userId) { MatrixBaseApis.prototype.removeUserFromGroupSummary = function(groupId, userId) {
@@ -734,7 +734,7 @@ MatrixBaseApis.prototype.removeUserFromGroupSummary = function(groupId, userId)
* @param {string} groupId * @param {string} groupId
* @param {string} roomId * @param {string} roomId
* @param {string} categoryId Optional. * @param {string} categoryId Optional.
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.addRoomToGroupSummary = function(groupId, roomId, categoryId) { MatrixBaseApis.prototype.addRoomToGroupSummary = function(groupId, roomId, categoryId) {
@@ -750,7 +750,7 @@ MatrixBaseApis.prototype.addRoomToGroupSummary = function(groupId, roomId, categ
/** /**
* @param {string} groupId * @param {string} groupId
* @param {string} roomId * @param {string} roomId
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.removeRoomFromGroupSummary = function(groupId, roomId) { MatrixBaseApis.prototype.removeRoomFromGroupSummary = function(groupId, roomId) {
@@ -765,7 +765,7 @@ MatrixBaseApis.prototype.removeRoomFromGroupSummary = function(groupId, roomId)
* @param {string} groupId * @param {string} groupId
* @param {string} roomId * @param {string} roomId
* @param {bool} isPublic Whether the room-group association is visible to non-members * @param {bool} isPublic Whether the room-group association is visible to non-members
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.addRoomToGroup = function(groupId, roomId, isPublic) { MatrixBaseApis.prototype.addRoomToGroup = function(groupId, roomId, isPublic) {
@@ -786,7 +786,7 @@ MatrixBaseApis.prototype.addRoomToGroup = function(groupId, roomId, isPublic) {
* @param {string} groupId * @param {string} groupId
* @param {string} roomId * @param {string} roomId
* @param {bool} isPublic Whether the room-group association is visible to non-members * @param {bool} isPublic Whether the room-group association is visible to non-members
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.updateGroupRoomVisibility = function(groupId, roomId, isPublic) { MatrixBaseApis.prototype.updateGroupRoomVisibility = function(groupId, roomId, isPublic) {
@@ -806,7 +806,7 @@ MatrixBaseApis.prototype.updateGroupRoomVisibility = function(groupId, roomId, i
/** /**
* @param {string} groupId * @param {string} groupId
* @param {string} roomId * @param {string} roomId
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.removeRoomFromGroup = function(groupId, roomId) { MatrixBaseApis.prototype.removeRoomFromGroup = function(groupId, roomId) {
@@ -820,7 +820,7 @@ MatrixBaseApis.prototype.removeRoomFromGroup = function(groupId, roomId) {
/** /**
* @param {string} groupId * @param {string} groupId
* @param {Object} opts Additional options to send alongside the acceptance. * @param {Object} opts Additional options to send alongside the acceptance.
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.acceptGroupInvite = function(groupId, opts = null) { MatrixBaseApis.prototype.acceptGroupInvite = function(groupId, opts = null) {
@@ -833,7 +833,7 @@ MatrixBaseApis.prototype.acceptGroupInvite = function(groupId, opts = null) {
/** /**
* @param {string} groupId * @param {string} groupId
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.joinGroup = function(groupId) { MatrixBaseApis.prototype.joinGroup = function(groupId) {
@@ -846,7 +846,7 @@ MatrixBaseApis.prototype.joinGroup = function(groupId) {
/** /**
* @param {string} groupId * @param {string} groupId
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.leaveGroup = function(groupId) { MatrixBaseApis.prototype.leaveGroup = function(groupId) {
@@ -858,7 +858,7 @@ MatrixBaseApis.prototype.leaveGroup = function(groupId) {
}; };
/** /**
* @return {module:client.Promise} Resolves: The groups to which the user is joined * @return {Promise} Resolves: The groups to which the user is joined
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getJoinedGroups = function() { MatrixBaseApis.prototype.getJoinedGroups = function() {
@@ -870,7 +870,7 @@ MatrixBaseApis.prototype.getJoinedGroups = function() {
* @param {Object} content Request content * @param {Object} content Request content
* @param {string} content.localpart The local part of the desired group ID * @param {string} content.localpart The local part of the desired group ID
* @param {Object} content.profile Group profile object * @param {Object} content.profile Group profile object
* @return {module:client.Promise} Resolves: Object with key group_id: id of the created group * @return {Promise} Resolves: Object with key group_id: id of the created group
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.createGroup = function(content) { MatrixBaseApis.prototype.createGroup = function(content) {
@@ -882,7 +882,7 @@ MatrixBaseApis.prototype.createGroup = function(content) {
/** /**
* @param {string[]} userIds List of user IDs * @param {string[]} userIds List of user IDs
* @return {module:client.Promise} Resolves: Object as exmaple below * @return {Promise} Resolves: Object as exmaple below
* *
* { * {
* "users": { * "users": {
@@ -903,7 +903,7 @@ MatrixBaseApis.prototype.getPublicisedGroups = function(userIds) {
/** /**
* @param {string} groupId * @param {string} groupId
* @param {bool} isPublic Whether the user's membership of this group is made public * @param {bool} isPublic Whether the user's membership of this group is made public
* @return {module:client.Promise} Resolves: Empty object * @return {Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setGroupPublicity = function(groupId, isPublic) { MatrixBaseApis.prototype.setGroupPublicity = function(groupId, isPublic) {
@@ -922,7 +922,7 @@ MatrixBaseApis.prototype.setGroupPublicity = function(groupId, isPublic) {
* @param {string} eventType * @param {string} eventType
* @param {string} stateKey * @param {string} stateKey
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getStateEvent = function(roomId, eventType, stateKey, callback) { MatrixBaseApis.prototype.getStateEvent = function(roomId, eventType, stateKey, callback) {
@@ -946,7 +946,7 @@ MatrixBaseApis.prototype.getStateEvent = function(roomId, eventType, stateKey, c
* @param {Object} content * @param {Object} content
* @param {string} stateKey * @param {string} stateKey
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.sendStateEvent = function(roomId, eventType, content, stateKey, MatrixBaseApis.prototype.sendStateEvent = function(roomId, eventType, content, stateKey,
@@ -969,7 +969,7 @@ MatrixBaseApis.prototype.sendStateEvent = function(roomId, eventType, content, s
* @param {string} roomId * @param {string} roomId
* @param {Number} limit * @param {Number} limit
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.roomInitialSync = function(roomId, limit, callback) { MatrixBaseApis.prototype.roomInitialSync = function(roomId, limit, callback) {
@@ -1000,7 +1000,7 @@ MatrixBaseApis.prototype.roomInitialSync = function(roomId, limit, callback) {
* @param {object} opts Options for the read markers. * @param {object} opts Options for the read markers.
* @param {object} opts.hidden True to hide the read receipt from other users. <b>This * @param {object} opts.hidden True to hide the read receipt from other users. <b>This
* property is currently unstable and may change in the future.</b> * property is currently unstable and may change in the future.</b>
* @return {module:client.Promise} Resolves: the empty object, {}. * @return {Promise} Resolves: the empty object, {}.
*/ */
MatrixBaseApis.prototype.setRoomReadMarkersHttpRequest = MatrixBaseApis.prototype.setRoomReadMarkersHttpRequest =
function(roomId, rmEventId, rrEventId, opts) { function(roomId, rmEventId, rrEventId, opts) {
@@ -1020,7 +1020,7 @@ MatrixBaseApis.prototype.setRoomReadMarkersHttpRequest =
}; };
/** /**
* @return {module:client.Promise} Resolves: A list of the user's current rooms * @return {Promise} Resolves: A list of the user's current rooms
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getJoinedRooms = function() { MatrixBaseApis.prototype.getJoinedRooms = function() {
@@ -1031,7 +1031,7 @@ MatrixBaseApis.prototype.getJoinedRooms = function() {
/** /**
* Retrieve membership info. for a room. * Retrieve membership info. for a room.
* @param {string} roomId ID of the room to get membership for * @param {string} roomId ID of the room to get membership for
* @return {module:client.Promise} Resolves: A list of currently joined users * @return {Promise} Resolves: A list of currently joined users
* and their profile data. * and their profile data.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
@@ -1055,7 +1055,7 @@ MatrixBaseApis.prototype.getJoinedRoomMembers = function(roomId) {
* @param {object} options.filter Filter parameters * @param {object} options.filter Filter parameters
* @param {string} options.filter.generic_search_term String to search for * @param {string} options.filter.generic_search_term String to search for
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.publicRooms = function(options, callback) { MatrixBaseApis.prototype.publicRooms = function(options, callback) {
@@ -1087,7 +1087,7 @@ MatrixBaseApis.prototype.publicRooms = function(options, callback) {
* @param {string} alias The room alias to create. * @param {string} alias The room alias to create.
* @param {string} roomId The room ID to link the alias to. * @param {string} roomId The room ID to link the alias to.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO. * @return {Promise} Resolves: TODO.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.createAlias = function(alias, roomId, callback) { MatrixBaseApis.prototype.createAlias = function(alias, roomId, callback) {
@@ -1107,7 +1107,7 @@ MatrixBaseApis.prototype.createAlias = function(alias, roomId, callback) {
* and you must have sufficient access to do this operation. * and you must have sufficient access to do this operation.
* @param {string} alias The room alias to delete. * @param {string} alias The room alias to delete.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO. * @return {Promise} Resolves: TODO.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.deleteAlias = function(alias, callback) { MatrixBaseApis.prototype.deleteAlias = function(alias, callback) {
@@ -1123,7 +1123,7 @@ MatrixBaseApis.prototype.deleteAlias = function(alias, callback) {
* Get room info for the given alias. * Get room info for the given alias.
* @param {string} alias The room alias to resolve. * @param {string} alias The room alias to resolve.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: Object with room_id and servers. * @return {Promise} Resolves: Object with room_id and servers.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getRoomIdForAlias = function(alias, callback) { MatrixBaseApis.prototype.getRoomIdForAlias = function(alias, callback) {
@@ -1139,7 +1139,7 @@ MatrixBaseApis.prototype.getRoomIdForAlias = function(alias, callback) {
/** /**
* @param {string} roomAlias * @param {string} roomAlias
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.resolveRoomAlias = function(roomAlias, callback) { MatrixBaseApis.prototype.resolveRoomAlias = function(roomAlias, callback) {
@@ -1152,7 +1152,7 @@ MatrixBaseApis.prototype.resolveRoomAlias = function(roomAlias, callback) {
* Get the visibility of a room in the current HS's room directory * Get the visibility of a room in the current HS's room directory
* @param {string} roomId * @param {string} roomId
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getRoomDirectoryVisibility = MatrixBaseApis.prototype.getRoomDirectoryVisibility =
@@ -1170,7 +1170,7 @@ MatrixBaseApis.prototype.getRoomDirectoryVisibility =
* in the public directory, or "private" to make * in the public directory, or "private" to make
* it invisible. * it invisible.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setRoomDirectoryVisibility = MatrixBaseApis.prototype.setRoomDirectoryVisibility =
@@ -1193,7 +1193,7 @@ MatrixBaseApis.prototype.setRoomDirectoryVisibility =
* in the public directory, or "private" to make * in the public directory, or "private" to make
* it invisible. * it invisible.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setRoomDirectoryVisibilityAppService = MatrixBaseApis.prototype.setRoomDirectoryVisibilityAppService =
@@ -1216,7 +1216,7 @@ MatrixBaseApis.prototype.setRoomDirectoryVisibilityAppService =
* @param {string} opts.term the term with which to search. * @param {string} opts.term the term with which to search.
* @param {number} opts.limit the maximum number of results to return. The server will * @param {number} opts.limit the maximum number of results to return. The server will
* apply a limit if unspecified. * apply a limit if unspecified.
* @return {module:client.Promise} Resolves: an array of results. * @return {Promise} Resolves: an array of results.
*/ */
MatrixBaseApis.prototype.searchUserDirectory = function(opts) { MatrixBaseApis.prototype.searchUserDirectory = function(opts) {
const body = { const body = {
@@ -1272,7 +1272,7 @@ MatrixBaseApis.prototype.searchUserDirectory = function(opts) {
* data has been uploaded, with an object containing the fields `loaded` * data has been uploaded, with an object containing the fields `loaded`
* (number of bytes transferred) and `total` (total size, if known). * (number of bytes transferred) and `total` (total size, if known).
* *
* @return {module:client.Promise} Resolves to response object, as * @return {Promise} Resolves to response object, as
* determined by this.opts.onlyData, opts.rawResponse, and * determined by this.opts.onlyData, opts.rawResponse, and
* opts.onlyContentUri. Rejects with an error (usually a MatrixError). * opts.onlyContentUri. Rejects with an error (usually a MatrixError).
*/ */
@@ -1282,7 +1282,7 @@ MatrixBaseApis.prototype.uploadContent = function(file, opts) {
/** /**
* Cancel a file upload in progress * Cancel a file upload in progress
* @param {module:client.Promise} promise The promise returned from uploadContent * @param {Promise} promise The promise returned from uploadContent
* @return {boolean} true if canceled, otherwise false * @return {boolean} true if canceled, otherwise false
*/ */
MatrixBaseApis.prototype.cancelUpload = function(promise) { MatrixBaseApis.prototype.cancelUpload = function(promise) {
@@ -1310,7 +1310,7 @@ MatrixBaseApis.prototype.getCurrentUploads = function() {
* @param {string} info The kind of info to retrieve (e.g. 'displayname', * @param {string} info The kind of info to retrieve (e.g. 'displayname',
* 'avatar_url'). * 'avatar_url').
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getProfileInfo = function(userId, info, callback) { MatrixBaseApis.prototype.getProfileInfo = function(userId, info, callback) {
@@ -1332,7 +1332,7 @@ MatrixBaseApis.prototype.getProfileInfo = function(userId, info, callback) {
/** /**
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getThreePids = function(callback) { MatrixBaseApis.prototype.getThreePids = function(callback) {
@@ -1352,7 +1352,7 @@ MatrixBaseApis.prototype.getThreePids = function(callback) {
* @param {Object} creds * @param {Object} creds
* @param {boolean} bind * @param {boolean} bind
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: on success * @return {Promise} Resolves: on success
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.addThreePid = function(creds, bind, callback) { MatrixBaseApis.prototype.addThreePid = function(creds, bind, callback) {
@@ -1375,7 +1375,7 @@ MatrixBaseApis.prototype.addThreePid = function(creds, bind, callback) {
* *
* @param {Object} data A object with 3PID validation data from having called * @param {Object} data A object with 3PID validation data from having called
* `account/3pid/<medium>/requestToken` on the homeserver. * `account/3pid/<medium>/requestToken` on the homeserver.
* @return {module:client.Promise} Resolves: on success * @return {Promise} Resolves: on success
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.addThreePidOnly = async function(data) { MatrixBaseApis.prototype.addThreePidOnly = async function(data) {
@@ -1398,7 +1398,7 @@ MatrixBaseApis.prototype.addThreePidOnly = async function(data) {
* @param {Object} data A object with 3PID validation data from having called * @param {Object} data A object with 3PID validation data from having called
* `validate/<medium>/requestToken` on the identity server. It should also * `validate/<medium>/requestToken` on the identity server. It should also
* contain `id_server` and `id_access_token` fields as well. * contain `id_server` and `id_access_token` fields as well.
* @return {module:client.Promise} Resolves: on success * @return {Promise} Resolves: on success
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.bindThreePid = async function(data) { MatrixBaseApis.prototype.bindThreePid = async function(data) {
@@ -1418,7 +1418,7 @@ MatrixBaseApis.prototype.bindThreePid = async function(data) {
* @param {string} medium The threepid medium (eg. 'email') * @param {string} medium The threepid medium (eg. 'email')
* @param {string} address The threepid address (eg. 'bob@example.com') * @param {string} address The threepid address (eg. 'bob@example.com')
* this must be as returned by getThreePids. * this must be as returned by getThreePids.
* @return {module:client.Promise} Resolves: on success * @return {Promise} Resolves: on success
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.unbindThreePid = async function(medium, address) { MatrixBaseApis.prototype.unbindThreePid = async function(medium, address) {
@@ -1439,7 +1439,7 @@ MatrixBaseApis.prototype.unbindThreePid = async function(medium, address) {
* @param {string} medium The threepid medium (eg. 'email') * @param {string} medium The threepid medium (eg. 'email')
* @param {string} address The threepid address (eg. 'bob@example.com') * @param {string} address The threepid address (eg. 'bob@example.com')
* this must be as returned by getThreePids. * this must be as returned by getThreePids.
* @return {module:client.Promise} Resolves: The server response on success * @return {Promise} Resolves: The server response on success
* (generally the empty JSON object) * (generally the empty JSON object)
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
@@ -1457,7 +1457,7 @@ MatrixBaseApis.prototype.deleteThreePid = function(medium, address) {
* @param {Object} authDict * @param {Object} authDict
* @param {string} newPassword The new desired password. * @param {string} newPassword The new desired password.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setPassword = function(authDict, newPassword, callback) { MatrixBaseApis.prototype.setPassword = function(authDict, newPassword, callback) {
@@ -1478,7 +1478,7 @@ MatrixBaseApis.prototype.setPassword = function(authDict, newPassword, callback)
/** /**
* Gets all devices recorded for the logged-in user * Gets all devices recorded for the logged-in user
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getDevices = function() { MatrixBaseApis.prototype.getDevices = function() {
@@ -1492,7 +1492,7 @@ MatrixBaseApis.prototype.getDevices = function() {
* *
* @param {string} device_id device to update * @param {string} device_id device to update
* @param {Object} body body of request * @param {Object} body body of request
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setDeviceDetails = function(device_id, body) { MatrixBaseApis.prototype.setDeviceDetails = function(device_id, body) {
@@ -1508,7 +1508,7 @@ MatrixBaseApis.prototype.setDeviceDetails = function(device_id, body) {
* *
* @param {string} device_id device to delete * @param {string} device_id device to delete
* @param {object} auth Optional. Auth data to supply for User-Interactive auth. * @param {object} auth Optional. Auth data to supply for User-Interactive auth.
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.deleteDevice = function(device_id, auth) { MatrixBaseApis.prototype.deleteDevice = function(device_id, auth) {
@@ -1530,7 +1530,7 @@ MatrixBaseApis.prototype.deleteDevice = function(device_id, auth) {
* *
* @param {string[]} devices IDs of the devices to delete * @param {string[]} devices IDs of the devices to delete
* @param {object} auth Optional. Auth data to supply for User-Interactive auth. * @param {object} auth Optional. Auth data to supply for User-Interactive auth.
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.deleteMultipleDevices = function(devices, auth) { MatrixBaseApis.prototype.deleteMultipleDevices = function(devices, auth) {
@@ -1552,7 +1552,7 @@ MatrixBaseApis.prototype.deleteMultipleDevices = function(devices, auth) {
* Gets all pushers registered for the logged-in user * Gets all pushers registered for the logged-in user
* *
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: Array of objects representing pushers * @return {Promise} Resolves: Array of objects representing pushers
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getPushers = function(callback) { MatrixBaseApis.prototype.getPushers = function(callback) {
@@ -1567,7 +1567,7 @@ MatrixBaseApis.prototype.getPushers = function(callback) {
* *
* @param {Object} pusher Object representing a pusher * @param {Object} pusher Object representing a pusher
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: Empty json object on success * @return {Promise} Resolves: Empty json object on success
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setPusher = function(pusher, callback) { MatrixBaseApis.prototype.setPusher = function(pusher, callback) {
@@ -1579,7 +1579,7 @@ MatrixBaseApis.prototype.setPusher = function(pusher, callback) {
/** /**
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getPushRules = function(callback) { MatrixBaseApis.prototype.getPushRules = function(callback) {
@@ -1594,7 +1594,7 @@ MatrixBaseApis.prototype.getPushRules = function(callback) {
* @param {string} ruleId * @param {string} ruleId
* @param {Object} body * @param {Object} body
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.addPushRule = function(scope, kind, ruleId, body, callback) { MatrixBaseApis.prototype.addPushRule = function(scope, kind, ruleId, body, callback) {
@@ -1613,7 +1613,7 @@ MatrixBaseApis.prototype.addPushRule = function(scope, kind, ruleId, body, callb
* @param {string} kind * @param {string} kind
* @param {string} ruleId * @param {string} ruleId
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.deletePushRule = function(scope, kind, ruleId, callback) { MatrixBaseApis.prototype.deletePushRule = function(scope, kind, ruleId, callback) {
@@ -1632,7 +1632,7 @@ MatrixBaseApis.prototype.deletePushRule = function(scope, kind, ruleId, callback
* @param {string} ruleId * @param {string} ruleId
* @param {boolean} enabled * @param {boolean} enabled
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setPushRuleEnabled = function(scope, kind, MatrixBaseApis.prototype.setPushRuleEnabled = function(scope, kind,
@@ -1653,7 +1653,7 @@ MatrixBaseApis.prototype.setPushRuleEnabled = function(scope, kind,
* @param {string} ruleId * @param {string} ruleId
* @param {array} actions * @param {array} actions
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.setPushRuleActions = function(scope, kind, MatrixBaseApis.prototype.setPushRuleActions = function(scope, kind,
@@ -1677,7 +1677,7 @@ MatrixBaseApis.prototype.setPushRuleActions = function(scope, kind,
* @param {string} opts.next_batch the batch token to pass in the query string * @param {string} opts.next_batch the batch token to pass in the query string
* @param {Object} opts.body the JSON object to pass to the request body. * @param {Object} opts.body the JSON object to pass to the request body.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.search = function(opts, callback) { MatrixBaseApis.prototype.search = function(opts, callback) {
@@ -1703,7 +1703,7 @@ MatrixBaseApis.prototype.search = function(opts, callback) {
* *
* @param {module:client.callback=} callback * @param {module:client.callback=} callback
* *
* @return {module:client.Promise} Resolves: result object. Rejects: with * @return {Promise} Resolves: result object. Rejects: with
* an error response ({@link module:http-api.MatrixError}). * an error response ({@link module:http-api.MatrixError}).
*/ */
MatrixBaseApis.prototype.uploadKeysRequest = function(content, opts, callback) { MatrixBaseApis.prototype.uploadKeysRequest = function(content, opts, callback) {
@@ -1729,7 +1729,7 @@ MatrixBaseApis.prototype.uploadKeySignatures = function(content) {
* @param {string=} opts.token sync token to pass in the query request, to help * @param {string=} opts.token sync token to pass in the query request, to help
* the HS give the most recent results * the HS give the most recent results
* *
* @return {module:client.Promise} Resolves: result object. Rejects: with * @return {Promise} Resolves: result object. Rejects: with
* an error response ({@link module:http-api.MatrixError}). * an error response ({@link module:http-api.MatrixError}).
*/ */
MatrixBaseApis.prototype.downloadKeysForUsers = function(userIds, opts) { MatrixBaseApis.prototype.downloadKeysForUsers = function(userIds, opts) {
@@ -1761,7 +1761,7 @@ MatrixBaseApis.prototype.downloadKeysForUsers = function(userIds, opts) {
* *
* @param {string} [key_algorithm = signed_curve25519] desired key type * @param {string} [key_algorithm = signed_curve25519] desired key type
* *
* @return {module:client.Promise} Resolves: result object. Rejects: with * @return {Promise} Resolves: result object. Rejects: with
* an error response ({@link module:http-api.MatrixError}). * an error response ({@link module:http-api.MatrixError}).
*/ */
MatrixBaseApis.prototype.claimOneTimeKeys = function(devices, key_algorithm) { MatrixBaseApis.prototype.claimOneTimeKeys = function(devices, key_algorithm) {
@@ -1790,7 +1790,7 @@ MatrixBaseApis.prototype.claimOneTimeKeys = function(devices, key_algorithm) {
* @param {string} oldToken * @param {string} oldToken
* @param {string} newToken * @param {string} newToken
* *
* @return {module:client.Promise} Resolves: result object. Rejects: with * @return {Promise} Resolves: result object. Rejects: with
* an error response ({@link module:http-api.MatrixError}). * an error response ({@link module:http-api.MatrixError}).
*/ */
MatrixBaseApis.prototype.getKeyChanges = function(oldToken, newToken) { MatrixBaseApis.prototype.getKeyChanges = function(oldToken, newToken) {
@@ -1825,7 +1825,7 @@ MatrixBaseApis.prototype.uploadDeviceSigningKeys = function(auth, keys) {
* general) was added as part of the v2 API version. * general) was added as part of the v2 API version.
* *
* @param {object} hsOpenIdToken * @param {object} hsOpenIdToken
* @return {module:client.Promise} Resolves: with object containing an Identity * @return {Promise} Resolves: with object containing an Identity
* Server access token. * Server access token.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
@@ -1861,7 +1861,7 @@ MatrixBaseApis.prototype.registerWithIdentityServer = function(hsOpenIdToken) {
* @param {string} identityAccessToken The `access_token` field of the identity * @param {string} identityAccessToken The `access_token` field of the identity
* server `/account/register` response (see {@link registerWithIdentityServer}). * server `/account/register` response (see {@link registerWithIdentityServer}).
* *
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
* @throws Error if no identity server is set * @throws Error if no identity server is set
*/ */
@@ -1927,7 +1927,7 @@ MatrixBaseApis.prototype.requestEmailToken = async function(
* @param {string} identityAccessToken The `access_token` field of the Identity * @param {string} identityAccessToken The `access_token` field of the Identity
* Server `/account/register` response (see {@link registerWithIdentityServer}). * Server `/account/register` response (see {@link registerWithIdentityServer}).
* *
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
* @throws Error if no identity server is set * @throws Error if no identity server is set
*/ */
@@ -1987,7 +1987,7 @@ MatrixBaseApis.prototype.requestMsisdnToken = async function(
* @param {string} identityAccessToken The `access_token` field of the Identity * @param {string} identityAccessToken The `access_token` field of the Identity
* Server `/account/register` response (see {@link registerWithIdentityServer}). * Server `/account/register` response (see {@link registerWithIdentityServer}).
* *
* @return {module:client.Promise} Resolves: Object, currently with no parameters. * @return {Promise} Resolves: Object, currently with no parameters.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
* @throws Error if No ID server is set * @throws Error if No ID server is set
*/ */
@@ -2038,7 +2038,7 @@ MatrixBaseApis.prototype.submitMsisdnToken = async function(
* This must be the same value submitted in the requestToken call. * This must be the same value submitted in the requestToken call.
* @param {string} msisdnToken The MSISDN token, as enetered by the user. * @param {string} msisdnToken The MSISDN token, as enetered by the user.
* *
* @return {module:client.Promise} Resolves: Object, currently with no parameters. * @return {Promise} Resolves: Object, currently with no parameters.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.submitMsisdnTokenOtherUrl = function( MatrixBaseApis.prototype.submitMsisdnTokenOtherUrl = function(
@@ -2164,7 +2164,7 @@ MatrixBaseApis.prototype.identityHashedLookup = async function(
* @param {string} identityAccessToken The `access_token` field of the Identity * @param {string} identityAccessToken The `access_token` field of the Identity
* Server `/account/register` response (see {@link registerWithIdentityServer}). * Server `/account/register` response (see {@link registerWithIdentityServer}).
* *
* @return {module:client.Promise} Resolves: A threepid mapping * @return {Promise} Resolves: A threepid mapping
* object or the empty object if no mapping * object or the empty object if no mapping
* exists * exists
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
@@ -2232,7 +2232,7 @@ MatrixBaseApis.prototype.lookupThreePid = async function(
* @param {string} identityAccessToken The `access_token` field of the Identity * @param {string} identityAccessToken The `access_token` field of the Identity
* Server `/account/register` response (see {@link registerWithIdentityServer}). * Server `/account/register` response (see {@link registerWithIdentityServer}).
* *
* @return {module:client.Promise} Resolves: Lookup results from IS. * @return {Promise} Resolves: Lookup results from IS.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.bulkLookupThreePids = async function( MatrixBaseApis.prototype.bulkLookupThreePids = async function(
@@ -2289,7 +2289,7 @@ MatrixBaseApis.prototype.bulkLookupThreePids = async function(
* @param {string} identityAccessToken The `access_token` field of the Identity * @param {string} identityAccessToken The `access_token` field of the Identity
* Server `/account/register` response (see {@link registerWithIdentityServer}). * Server `/account/register` response (see {@link registerWithIdentityServer}).
* *
* @return {module:client.Promise} Resolves: an object with account info. * @return {Promise} Resolves: an object with account info.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.getIdentityAccount = function( MatrixBaseApis.prototype.getIdentityAccount = function(
@@ -2312,7 +2312,7 @@ MatrixBaseApis.prototype.getIdentityAccount = function(
* content to send. Map from user_id to device_id to content object. * content to send. Map from user_id to device_id to content object.
* @param {string=} txnId transaction id. One will be made up if not * @param {string=} txnId transaction id. One will be made up if not
* supplied. * supplied.
* @return {module:client.Promise} Resolves to the result object * @return {Promise} Resolves to the result object
*/ */
MatrixBaseApis.prototype.sendToDevice = function( MatrixBaseApis.prototype.sendToDevice = function(
eventType, contentMap, txnId, eventType, contentMap, txnId,
@@ -2341,7 +2341,7 @@ MatrixBaseApis.prototype.sendToDevice = function(
/** /**
* Get the third party protocols that can be reached using * Get the third party protocols that can be reached using
* this HS * this HS
* @return {module:client.Promise} Resolves to the result object * @return {Promise} Resolves to the result object
*/ */
MatrixBaseApis.prototype.getThirdpartyProtocols = function() { MatrixBaseApis.prototype.getThirdpartyProtocols = function() {
return this._http.authedRequest( return this._http.authedRequest(
@@ -2363,7 +2363,7 @@ MatrixBaseApis.prototype.getThirdpartyProtocols = function() {
* @param {string} protocol The protocol given in getThirdpartyProtocols() * @param {string} protocol The protocol given in getThirdpartyProtocols()
* @param {object} params Protocol-specific parameters, as given in the * @param {object} params Protocol-specific parameters, as given in the
* response to getThirdpartyProtocols() * response to getThirdpartyProtocols()
* @return {module:client.Promise} Resolves to the result object * @return {Promise} Resolves to the result object
*/ */
MatrixBaseApis.prototype.getThirdpartyLocation = function(protocol, params) { MatrixBaseApis.prototype.getThirdpartyLocation = function(protocol, params) {
const path = utils.encodeUri("/thirdparty/location/$protocol", { const path = utils.encodeUri("/thirdparty/location/$protocol", {
@@ -2379,7 +2379,7 @@ MatrixBaseApis.prototype.getThirdpartyLocation = function(protocol, params) {
* @param {string} protocol The protocol given in getThirdpartyProtocols() * @param {string} protocol The protocol given in getThirdpartyProtocols()
* @param {object} params Protocol-specific parameters, as given in the * @param {object} params Protocol-specific parameters, as given in the
* response to getThirdpartyProtocols() * response to getThirdpartyProtocols()
* @return {module:client.Promise} Resolves to the result object * @return {Promise} Resolves to the result object
*/ */
MatrixBaseApis.prototype.getThirdpartyUser = function(protocol, params) { MatrixBaseApis.prototype.getThirdpartyUser = function(protocol, params) {
const path = utils.encodeUri("/thirdparty/user/$protocol", { const path = utils.encodeUri("/thirdparty/user/$protocol", {
@@ -2414,7 +2414,7 @@ MatrixBaseApis.prototype.agreeToTerms = function(
* @param {string} eventId The event to report. * @param {string} eventId The event to report.
* @param {number} score The score to rate this content as where -100 is most offensive and 0 is inoffensive. * @param {number} score The score to rate this content as where -100 is most offensive and 0 is inoffensive.
* @param {string} reason The reason the content is being reported. May be blank. * @param {string} reason The reason the content is being reported. May be blank.
* @returns {module:client.Promise} Resolves to an empty object if successful * @returns {Promise} Resolves to an empty object if successful
*/ */
MatrixBaseApis.prototype.reportEvent = function(roomId, eventId, score, reason) { MatrixBaseApis.prototype.reportEvent = function(roomId, eventId, score, reason) {
const path = utils.encodeUri("/rooms/$roomId/report/$eventId", { const path = utils.encodeUri("/rooms/$roomId/report/$eventId", {

View File

@@ -570,7 +570,7 @@ MatrixClient.prototype.setNotifTimelineSet = function(notifTimelineSet) {
* Gets the capabilities of the homeserver. Always returns an object of * Gets the capabilities of the homeserver. Always returns an object of
* capability keys and their options, which may be empty. * capability keys and their options, which may be empty.
* @param {boolean} fresh True to ignore any cached values. * @param {boolean} fresh True to ignore any cached values.
* @return {module:client.Promise} Resolves to the capabilities of the homeserver * @return {Promise} Resolves to the capabilities of the homeserver
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.getCapabilities = function(fresh=false) { MatrixClient.prototype.getCapabilities = function(fresh=false) {
@@ -1320,7 +1320,7 @@ MatrixClient.prototype.forceDiscardSession = function(roomId) {
* *
* This should be encrypted before returning it to the user. * This should be encrypted before returning it to the user.
* *
* @return {module:client.Promise} a promise which resolves to a list of * @return {Promise} a promise which resolves to a list of
* session export objects * session export objects
*/ */
MatrixClient.prototype.exportRoomKeys = function() { MatrixClient.prototype.exportRoomKeys = function() {
@@ -1335,7 +1335,7 @@ MatrixClient.prototype.exportRoomKeys = function() {
* *
* @param {Object[]} keys a list of session export objects * @param {Object[]} keys a list of session export objects
* *
* @return {module:client.Promise} a promise which resolves when the keys * @return {Promise} a promise which resolves when the keys
* have been imported * have been imported
*/ */
MatrixClient.prototype.importRoomKeys = function(keys) { MatrixClient.prototype.importRoomKeys = function(keys) {
@@ -1600,7 +1600,7 @@ MatrixClient.prototype._makeKeyBackupPath = function(roomId, sessionId, version)
* @param {string} sessionId ID of the session that the keys are for Optional. * @param {string} sessionId ID of the session that the keys are for Optional.
* @param {integer} version backup version Optional. * @param {integer} version backup version Optional.
* @param {object} data Object keys to send * @param {object} data Object keys to send
* @return {module:client.Promise} a promise that will resolve when the keys * @return {Promise} a promise that will resolve when the keys
* are uploaded * are uploaded
*/ */
MatrixClient.prototype.sendKeyBackup = function(roomId, sessionId, version, data) { MatrixClient.prototype.sendKeyBackup = function(roomId, sessionId, version, data) {
@@ -1826,7 +1826,7 @@ MatrixClient.prototype.getGroups = function() {
/** /**
* Get the config for the media repository. * Get the config for the media repository.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves with an object containing the config. * @return {Promise} Resolves with an object containing the config.
*/ */
MatrixClient.prototype.getMediaConfig = function(callback) { MatrixClient.prototype.getMediaConfig = function(callback) {
return this._http.authedRequest( return this._http.authedRequest(
@@ -1916,7 +1916,7 @@ MatrixClient.prototype.getUsers = function() {
* @param {string} eventType The event type * @param {string} eventType The event type
* @param {Object} contents the contents object for the event * @param {Object} contents the contents object for the event
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setAccountData = function(eventType, contents, callback) { MatrixClient.prototype.setAccountData = function(eventType, contents, callback) {
@@ -1943,7 +1943,7 @@ MatrixClient.prototype.getAccountData = function(eventType) {
* gets account data directly from the homeserver if the local store is not * gets account data directly from the homeserver if the local store is not
* ready, which can be useful very early in startup before the initial sync. * ready, which can be useful very early in startup before the initial sync.
* @param {string} eventType The event type * @param {string} eventType The event type
* @return {module:client.Promise} Resolves: The contents of the given account * @return {Promise} Resolves: The contents of the given account
* data event. * data event.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
@@ -1980,7 +1980,7 @@ MatrixClient.prototype.getIgnoredUsers = function() {
* Sets the users that the current user should ignore. * Sets the users that the current user should ignore.
* @param {string[]} userIds the user IDs to ignore * @param {string[]} userIds the user IDs to ignore
* @param {module:client.callback} [callback] Optional. * @param {module:client.callback} [callback] Optional.
* @return {module:client.Promise} Resolves: Account data event * @return {Promise} Resolves: Account data event
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setIgnoredUsers = function(userIds, callback) { MatrixClient.prototype.setIgnoredUsers = function(userIds, callback) {
@@ -2013,7 +2013,7 @@ MatrixClient.prototype.isUserIgnored = function(userId) {
* @param {string[]} opts.viaServers The server names to try and join through in * @param {string[]} opts.viaServers The server names to try and join through in
* addition to those that are automatically chosen. * addition to those that are automatically chosen.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: Room object. * @return {Promise} Resolves: Room object.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.joinRoom = function(roomIdOrAlias, opts, callback) { MatrixClient.prototype.joinRoom = function(roomIdOrAlias, opts, callback) {
@@ -2081,7 +2081,7 @@ MatrixClient.prototype.joinRoom = function(roomIdOrAlias, opts, callback) {
* @param {MatrixEvent} event The event to resend. * @param {MatrixEvent} event The event to resend.
* @param {Room} room Optional. The room the event is in. Will update the * @param {Room} room Optional. The room the event is in. Will update the
* timeline entry if provided. * timeline entry if provided.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.resendEvent = function(event, room) { MatrixClient.prototype.resendEvent = function(event, room) {
@@ -2115,7 +2115,7 @@ MatrixClient.prototype.cancelPendingEvent = function(event) {
* @param {string} roomId * @param {string} roomId
* @param {string} name * @param {string} name
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setRoomName = function(roomId, name, callback) { MatrixClient.prototype.setRoomName = function(roomId, name, callback) {
@@ -2127,7 +2127,7 @@ MatrixClient.prototype.setRoomName = function(roomId, name, callback) {
* @param {string} roomId * @param {string} roomId
* @param {string} topic * @param {string} topic
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setRoomTopic = function(roomId, topic, callback) { MatrixClient.prototype.setRoomTopic = function(roomId, topic, callback) {
@@ -2138,7 +2138,7 @@ MatrixClient.prototype.setRoomTopic = function(roomId, topic, callback) {
/** /**
* @param {string} roomId * @param {string} roomId
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.getRoomTags = function(roomId, callback) { MatrixClient.prototype.getRoomTags = function(roomId, callback) {
@@ -2156,7 +2156,7 @@ MatrixClient.prototype.getRoomTags = function(roomId, callback) {
* @param {string} tagName name of room tag to be set * @param {string} tagName name of room tag to be set
* @param {object} metadata associated with that tag to be stored * @param {object} metadata associated with that tag to be stored
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setRoomTag = function(roomId, tagName, metadata, callback) { MatrixClient.prototype.setRoomTag = function(roomId, tagName, metadata, callback) {
@@ -2174,7 +2174,7 @@ MatrixClient.prototype.setRoomTag = function(roomId, tagName, metadata, callback
* @param {string} roomId * @param {string} roomId
* @param {string} tagName name of room tag to be removed * @param {string} tagName name of room tag to be removed
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.deleteRoomTag = function(roomId, tagName, callback) { MatrixClient.prototype.deleteRoomTag = function(roomId, tagName, callback) {
@@ -2193,7 +2193,7 @@ MatrixClient.prototype.deleteRoomTag = function(roomId, tagName, callback) {
* @param {string} eventType event type to be set * @param {string} eventType event type to be set
* @param {object} content event content * @param {object} content event content
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setRoomAccountData = function(roomId, eventType, MatrixClient.prototype.setRoomAccountData = function(roomId, eventType,
@@ -2215,7 +2215,7 @@ MatrixClient.prototype.setRoomAccountData = function(roomId, eventType,
* @param {Number} powerLevel * @param {Number} powerLevel
* @param {MatrixEvent} event * @param {MatrixEvent} event
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setPowerLevel = function(roomId, userId, powerLevel, MatrixClient.prototype.setPowerLevel = function(roomId, userId, powerLevel,
@@ -2243,7 +2243,7 @@ MatrixClient.prototype.setPowerLevel = function(roomId, userId, powerLevel,
* @param {Object} content * @param {Object} content
* @param {string} txnId Optional. * @param {string} txnId Optional.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendEvent = function(roomId, eventType, content, txnId, MatrixClient.prototype.sendEvent = function(roomId, eventType, content, txnId,
@@ -2258,7 +2258,7 @@ MatrixClient.prototype.sendEvent = function(roomId, eventType, content, txnId,
* @param {object} eventObject An object with the partial structure of an event, to which event_id, user_id, room_id and origin_server_ts will be added. * @param {object} eventObject An object with the partial structure of an event, to which event_id, user_id, room_id and origin_server_ts will be added.
* @param {string} txnId the txnId. * @param {string} txnId the txnId.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype._sendCompleteEvent = function(roomId, eventObject, txnId, MatrixClient.prototype._sendCompleteEvent = function(roomId, eventObject, txnId,
@@ -2398,7 +2398,7 @@ function _sendEvent(client, room, event, callback) {
* @param {module:models/room?} room destination room. Null if the destination * @param {module:models/room?} room destination room. Null if the destination
* is not a room we have seen over the sync pipe. * is not a room we have seen over the sync pipe.
* *
* @return {module:client.Promise?} Promise which resolves when the event has been * @return {Promise?} Promise which resolves when the event has been
* encrypted, or null if nothing was needed * encrypted, or null if nothing was needed
*/ */
@@ -2507,7 +2507,7 @@ function _sendEventHttpRequest(client, event) {
* @param {string} [txnId] transaction id. One will be made up if not * @param {string} [txnId] transaction id. One will be made up if not
* supplied. * supplied.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.redactEvent = function(roomId, eventId, txnId, callback) { MatrixClient.prototype.redactEvent = function(roomId, eventId, txnId, callback) {
@@ -2523,7 +2523,7 @@ MatrixClient.prototype.redactEvent = function(roomId, eventId, txnId, callback)
* @param {Object} content * @param {Object} content
* @param {string} txnId Optional. * @param {string} txnId Optional.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendMessage = function(roomId, content, txnId, callback) { MatrixClient.prototype.sendMessage = function(roomId, content, txnId, callback) {
@@ -2540,7 +2540,7 @@ MatrixClient.prototype.sendMessage = function(roomId, content, txnId, callback)
* @param {string} body * @param {string} body
* @param {string} txnId Optional. * @param {string} txnId Optional.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendTextMessage = function(roomId, body, txnId, callback) { MatrixClient.prototype.sendTextMessage = function(roomId, body, txnId, callback) {
@@ -2553,7 +2553,7 @@ MatrixClient.prototype.sendTextMessage = function(roomId, body, txnId, callback)
* @param {string} body * @param {string} body
* @param {string} txnId Optional. * @param {string} txnId Optional.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendNotice = function(roomId, body, txnId, callback) { MatrixClient.prototype.sendNotice = function(roomId, body, txnId, callback) {
@@ -2566,7 +2566,7 @@ MatrixClient.prototype.sendNotice = function(roomId, body, txnId, callback) {
* @param {string} body * @param {string} body
* @param {string} txnId Optional. * @param {string} txnId Optional.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendEmoteMessage = function(roomId, body, txnId, callback) { MatrixClient.prototype.sendEmoteMessage = function(roomId, body, txnId, callback) {
@@ -2580,7 +2580,7 @@ MatrixClient.prototype.sendEmoteMessage = function(roomId, body, txnId, callback
* @param {Object} info * @param {Object} info
* @param {string} text * @param {string} text
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendImageMessage = function(roomId, url, info, text, callback) { MatrixClient.prototype.sendImageMessage = function(roomId, url, info, text, callback) {
@@ -2605,7 +2605,7 @@ MatrixClient.prototype.sendImageMessage = function(roomId, url, info, text, call
* @param {Object} info * @param {Object} info
* @param {string} text * @param {string} text
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendStickerMessage = function(roomId, url, info, text, callback) { MatrixClient.prototype.sendStickerMessage = function(roomId, url, info, text, callback) {
@@ -2630,7 +2630,7 @@ MatrixClient.prototype.sendStickerMessage = function(roomId, url, info, text, ca
* @param {string} body * @param {string} body
* @param {string} htmlBody * @param {string} htmlBody
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendHtmlMessage = function(roomId, body, htmlBody, callback) { MatrixClient.prototype.sendHtmlMessage = function(roomId, body, htmlBody, callback) {
@@ -2643,7 +2643,7 @@ MatrixClient.prototype.sendHtmlMessage = function(roomId, body, htmlBody, callba
* @param {string} body * @param {string} body
* @param {string} htmlBody * @param {string} htmlBody
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendHtmlNotice = function(roomId, body, htmlBody, callback) { MatrixClient.prototype.sendHtmlNotice = function(roomId, body, htmlBody, callback) {
@@ -2656,7 +2656,7 @@ MatrixClient.prototype.sendHtmlNotice = function(roomId, body, htmlBody, callbac
* @param {string} body * @param {string} body
* @param {string} htmlBody * @param {string} htmlBody
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendHtmlEmote = function(roomId, body, htmlBody, callback) { MatrixClient.prototype.sendHtmlEmote = function(roomId, body, htmlBody, callback) {
@@ -2670,7 +2670,7 @@ MatrixClient.prototype.sendHtmlEmote = function(roomId, body, htmlBody, callback
* @param {string} receiptType The kind of receipt e.g. "m.read" * @param {string} receiptType The kind of receipt e.g. "m.read"
* @param {object} opts Additional content to send alongside the receipt. * @param {object} opts Additional content to send alongside the receipt.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendReceipt = function(event, receiptType, opts, callback) { MatrixClient.prototype.sendReceipt = function(event, receiptType, opts, callback) {
@@ -2707,7 +2707,7 @@ MatrixClient.prototype.sendReceipt = function(event, receiptType, opts, callback
* other users and homeservers. Default false (send to everyone). <b>This * other users and homeservers. Default false (send to everyone). <b>This
* property is unstable and may change in the future.</b> * property is unstable and may change in the future.</b>
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendReadReceipt = async function(event, opts, callback) { MatrixClient.prototype.sendReadReceipt = async function(event, opts, callback) {
@@ -2743,7 +2743,7 @@ MatrixClient.prototype.sendReadReceipt = async function(event, opts, callback) {
* @param {object} opts Options for the read markers * @param {object} opts Options for the read markers
* @param {object} opts.hidden True to hide the receipt from other users and homeservers. * @param {object} opts.hidden True to hide the receipt from other users and homeservers.
* <b>This property is unstable and may change in the future.</b> * <b>This property is unstable and may change in the future.</b>
* @return {module:client.Promise} Resolves: the empty object, {}. * @return {Promise} Resolves: the empty object, {}.
*/ */
MatrixClient.prototype.setRoomReadMarkers = async function( MatrixClient.prototype.setRoomReadMarkers = async function(
roomId, rmEventId, rrEvent, opts, roomId, rmEventId, rrEvent, opts,
@@ -2779,7 +2779,7 @@ MatrixClient.prototype.setRoomReadMarkers = async function(
* recent one preceding this timestamp if available, or failing that the next * recent one preceding this timestamp if available, or failing that the next
* most recent available preview. * most recent available preview.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: Object of OG metadata. * @return {Promise} Resolves: Object of OG metadata.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
* May return synthesized attributes if the URL lacked OG meta. * May return synthesized attributes if the URL lacked OG meta.
*/ */
@@ -2810,7 +2810,7 @@ MatrixClient.prototype.getUrlPreview = function(url, ts, callback) {
* @param {boolean} isTyping * @param {boolean} isTyping
* @param {Number} timeoutMs * @param {Number} timeoutMs
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.sendTyping = function(roomId, isTyping, timeoutMs, callback) { MatrixClient.prototype.sendTyping = function(roomId, isTyping, timeoutMs, callback) {
@@ -2918,7 +2918,7 @@ MatrixClient.prototype.getRoomUpgradeHistory = function(roomId, verifyLinks=fals
* @param {string} roomId * @param {string} roomId
* @param {string} userId * @param {string} userId
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.invite = function(roomId, userId, callback) { MatrixClient.prototype.invite = function(roomId, userId, callback) {
@@ -2931,7 +2931,7 @@ MatrixClient.prototype.invite = function(roomId, userId, callback) {
* @param {string} roomId The room to invite the user to. * @param {string} roomId The room to invite the user to.
* @param {string} email The email address to invite. * @param {string} email The email address to invite.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.inviteByEmail = function(roomId, email, callback) { MatrixClient.prototype.inviteByEmail = function(roomId, email, callback) {
@@ -2946,7 +2946,7 @@ MatrixClient.prototype.inviteByEmail = function(roomId, email, callback) {
* @param {string} medium The medium to invite the user e.g. "email". * @param {string} medium The medium to invite the user e.g. "email".
* @param {string} address The address for the specified medium. * @param {string} address The address for the specified medium.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.inviteByThreePid = async function( MatrixClient.prototype.inviteByThreePid = async function(
@@ -2990,7 +2990,7 @@ MatrixClient.prototype.inviteByThreePid = async function(
/** /**
* @param {string} roomId * @param {string} roomId
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.leave = function(roomId, callback) { MatrixClient.prototype.leave = function(roomId, callback) {
@@ -3006,7 +3006,7 @@ MatrixClient.prototype.leave = function(roomId, callback) {
* @param {string} roomId The room ID to start leaving at * @param {string} roomId The room ID to start leaving at
* @param {boolean} includeFuture If true, the whole chain (past and future) of * @param {boolean} includeFuture If true, the whole chain (past and future) of
* upgraded rooms will be left. * upgraded rooms will be left.
* @return {module:client.Promise} Resolves when completed with an object keyed * @return {Promise} Resolves when completed with an object keyed
* by room ID and value of the error encountered when leaving or null. * by room ID and value of the error encountered when leaving or null.
*/ */
MatrixClient.prototype.leaveRoomChain = function(roomId, includeFuture=true) { MatrixClient.prototype.leaveRoomChain = function(roomId, includeFuture=true) {
@@ -3047,7 +3047,7 @@ MatrixClient.prototype.leaveRoomChain = function(roomId, includeFuture=true) {
* @param {string} userId * @param {string} userId
* @param {string} reason Optional. * @param {string} reason Optional.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.ban = function(roomId, userId, reason, callback) { MatrixClient.prototype.ban = function(roomId, userId, reason, callback) {
@@ -3060,7 +3060,7 @@ MatrixClient.prototype.ban = function(roomId, userId, reason, callback) {
* @param {boolean} deleteRoom True to delete the room from the store on success. * @param {boolean} deleteRoom True to delete the room from the store on success.
* Default: true. * Default: true.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.forget = function(roomId, deleteRoom, callback) { MatrixClient.prototype.forget = function(roomId, deleteRoom, callback) {
@@ -3084,7 +3084,7 @@ MatrixClient.prototype.forget = function(roomId, deleteRoom, callback) {
* @param {string} roomId * @param {string} roomId
* @param {string} userId * @param {string} userId
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: Object (currently empty) * @return {Promise} Resolves: Object (currently empty)
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.unban = function(roomId, userId, callback) { MatrixClient.prototype.unban = function(roomId, userId, callback) {
@@ -3109,7 +3109,7 @@ MatrixClient.prototype.unban = function(roomId, userId, callback) {
* @param {string} userId * @param {string} userId
* @param {string} reason Optional. * @param {string} reason Optional.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.kick = function(roomId, userId, reason, callback) { MatrixClient.prototype.kick = function(roomId, userId, reason, callback) {
@@ -3126,7 +3126,7 @@ MatrixClient.prototype.kick = function(roomId, userId, reason, callback) {
* @param {string} membershipValue * @param {string} membershipValue
* @param {string} reason * @param {string} reason
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
function _setMembershipState(client, roomId, userId, membershipValue, reason, function _setMembershipState(client, roomId, userId, membershipValue, reason,
@@ -3154,7 +3154,7 @@ function _setMembershipState(client, roomId, userId, membershipValue, reason,
* @param {string} membership * @param {string} membership
* @param {string} reason * @param {string} reason
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
function _membershipChange(client, roomId, userId, membership, reason, callback) { function _membershipChange(client, roomId, userId, membership, reason, callback) {
@@ -3194,7 +3194,7 @@ MatrixClient.prototype.getPushActionsForEvent = function(event) {
* @param {string} info The kind of info to set (e.g. 'avatar_url') * @param {string} info The kind of info to set (e.g. 'avatar_url')
* @param {Object} data The JSON object to set. * @param {Object} data The JSON object to set.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setProfileInfo = function(info, data, callback) { MatrixClient.prototype.setProfileInfo = function(info, data, callback) {
@@ -3210,7 +3210,7 @@ MatrixClient.prototype.setProfileInfo = function(info, data, callback) {
/** /**
* @param {string} name * @param {string} name
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setDisplayName = function(name, callback) { MatrixClient.prototype.setDisplayName = function(name, callback) {
@@ -3222,7 +3222,7 @@ MatrixClient.prototype.setDisplayName = function(name, callback) {
/** /**
* @param {string} url * @param {string} url
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setAvatarUrl = function(url, callback) { MatrixClient.prototype.setAvatarUrl = function(url, callback) {
@@ -3255,7 +3255,7 @@ MatrixClient.prototype.mxcUrlToHttp =
* Sets a new status message for the user. The message may be null/falsey * Sets a new status message for the user. The message may be null/falsey
* to clear the message. * to clear the message.
* @param {string} newMessage The new message to set. * @param {string} newMessage The new message to set.
* @return {module:client.Promise} Resolves: to nothing * @return {Promise} Resolves: to nothing
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype._unstable_setStatusMessage = function(newMessage) { MatrixClient.prototype._unstable_setStatusMessage = function(newMessage) {
@@ -3282,7 +3282,7 @@ MatrixClient.prototype._unstable_setStatusMessage = function(newMessage) {
* @param {string} opts.presence One of "online", "offline" or "unavailable" * @param {string} opts.presence One of "online", "offline" or "unavailable"
* @param {string} opts.status_msg The status message to attach. * @param {string} opts.status_msg The status message to attach.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
* @throws If 'presence' isn't a valid presence enum value. * @throws If 'presence' isn't a valid presence enum value.
*/ */
@@ -3314,7 +3314,7 @@ function _presenceList(callback, client, opts, method) {
/** /**
* Retrieve current user presence list. * Retrieve current user presence list.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.getPresenceList = function(callback) { MatrixClient.prototype.getPresenceList = function(callback) {
@@ -3325,7 +3325,7 @@ MatrixClient.prototype.getPresenceList = function(callback) {
* Add users to the current user presence list. * Add users to the current user presence list.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @param {string[]} userIds * @param {string[]} userIds
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.inviteToPresenceList = function(callback, userIds) { MatrixClient.prototype.inviteToPresenceList = function(callback, userIds) {
@@ -3337,7 +3337,7 @@ MatrixClient.prototype.inviteToPresenceList = function(callback, userIds) {
* Drop users from the current user presence list. * Drop users from the current user presence list.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @param {string[]} userIds * @param {string[]} userIds
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
**/ **/
MatrixClient.prototype.dropFromPresenceList = function(callback, userIds) { MatrixClient.prototype.dropFromPresenceList = function(callback, userIds) {
@@ -3357,7 +3357,7 @@ MatrixClient.prototype.dropFromPresenceList = function(callback, userIds) {
* @param {Integer} limit Optional. The maximum number of previous events to * @param {Integer} limit Optional. The maximum number of previous events to
* pull in. Default: 30. * pull in. Default: 30.
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: Room. If you are at the beginning * @return {Promise} Resolves: Room. If you are at the beginning
* of the timeline, <code>Room.oldState.paginationToken</code> will be * of the timeline, <code>Room.oldState.paginationToken</code> will be
* <code>null</code>. * <code>null</code>.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
@@ -3440,7 +3440,7 @@ MatrixClient.prototype.scrollback = function(room, limit, callback) {
* @param {EventTimelineSet} timelineSet The timelineSet to look for the event in * @param {EventTimelineSet} timelineSet The timelineSet to look for the event in
* @param {string} eventId The ID of the event to look for * @param {string} eventId The ID of the event to look for
* *
* @return {module:client.Promise} Resolves: * @return {Promise} Resolves:
* {@link module:models/event-timeline~EventTimeline} including the given * {@link module:models/event-timeline~EventTimeline} including the given
* event * event
*/ */
@@ -3570,7 +3570,7 @@ function(roomId, fromToken, limit, dir, timelineFilter = undefined) {
* false to go forwards * false to go forwards
* @param {number} [opts.limit = 30] number of events to request * @param {number} [opts.limit = 30] number of events to request
* *
* @return {module:client.Promise} Resolves to a boolean: false if there are no * @return {Promise} Resolves to a boolean: false if there are no
* events and we reached either end of the timeline; else true. * events and we reached either end of the timeline; else true.
*/ */
MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) { MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
@@ -3722,7 +3722,7 @@ MatrixClient.prototype.resetNotifTimelineSet = function() {
* Peek into a room and receive updates about the room. This only works if the * Peek into a room and receive updates about the room. This only works if the
* history visibility for the room is world_readable. * history visibility for the room is world_readable.
* @param {String} roomId The room to attempt to peek into. * @param {String} roomId The room to attempt to peek into.
* @return {module:client.Promise} Resolves: Room object * @return {Promise} Resolves: Room object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.peekInRoom = function(roomId) { MatrixClient.prototype.peekInRoom = function(roomId) {
@@ -3753,7 +3753,7 @@ MatrixClient.prototype.stopPeeking = function() {
* @param {boolean} opts.allowRead True to set history visibility to * @param {boolean} opts.allowRead True to set history visibility to
* be world_readable. This gives guests read access *from this point forward*. * be world_readable. This gives guests read access *from this point forward*.
* If false or not given, history visibility is not modified. * If false or not given, history visibility is not modified.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setGuestAccess = function(roomId, opts) { MatrixClient.prototype.setGuestAccess = function(roomId, opts) {
@@ -3786,7 +3786,7 @@ MatrixClient.prototype.setGuestAccess = function(roomId, opts) {
* @param {string} clientSecret As requestEmailToken * @param {string} clientSecret As requestEmailToken
* @param {number} sendAttempt As requestEmailToken * @param {number} sendAttempt As requestEmailToken
* @param {string} nextLink As requestEmailToken * @param {string} nextLink As requestEmailToken
* @return {module:client.Promise} Resolves: As requestEmailToken * @return {Promise} Resolves: As requestEmailToken
*/ */
MatrixClient.prototype.requestRegisterEmailToken = function(email, clientSecret, MatrixClient.prototype.requestRegisterEmailToken = function(email, clientSecret,
sendAttempt, nextLink) { sendAttempt, nextLink) {
@@ -3813,7 +3813,7 @@ MatrixClient.prototype.requestRegisterEmailToken = function(email, clientSecret,
* @param {string} clientSecret As requestEmailToken * @param {string} clientSecret As requestEmailToken
* @param {number} sendAttempt As requestEmailToken * @param {number} sendAttempt As requestEmailToken
* @param {string} nextLink As requestEmailToken * @param {string} nextLink As requestEmailToken
* @return {module:client.Promise} Resolves: As requestEmailToken * @return {Promise} Resolves: As requestEmailToken
*/ */
MatrixClient.prototype.requestRegisterMsisdnToken = function(phoneCountry, phoneNumber, MatrixClient.prototype.requestRegisterMsisdnToken = function(phoneCountry, phoneNumber,
clientSecret, sendAttempt, nextLink) { clientSecret, sendAttempt, nextLink) {
@@ -3844,7 +3844,7 @@ MatrixClient.prototype.requestRegisterMsisdnToken = function(phoneCountry, phone
* @param {string} clientSecret As requestEmailToken * @param {string} clientSecret As requestEmailToken
* @param {number} sendAttempt As requestEmailToken * @param {number} sendAttempt As requestEmailToken
* @param {string} nextLink As requestEmailToken * @param {string} nextLink As requestEmailToken
* @return {module:client.Promise} Resolves: As requestEmailToken * @return {Promise} Resolves: As requestEmailToken
*/ */
MatrixClient.prototype.requestAdd3pidEmailToken = function(email, clientSecret, MatrixClient.prototype.requestAdd3pidEmailToken = function(email, clientSecret,
sendAttempt, nextLink) { sendAttempt, nextLink) {
@@ -3871,7 +3871,7 @@ MatrixClient.prototype.requestAdd3pidEmailToken = function(email, clientSecret,
* @param {string} clientSecret As requestEmailToken * @param {string} clientSecret As requestEmailToken
* @param {number} sendAttempt As requestEmailToken * @param {number} sendAttempt As requestEmailToken
* @param {string} nextLink As requestEmailToken * @param {string} nextLink As requestEmailToken
* @return {module:client.Promise} Resolves: As requestEmailToken * @return {Promise} Resolves: As requestEmailToken
*/ */
MatrixClient.prototype.requestAdd3pidMsisdnToken = function(phoneCountry, phoneNumber, MatrixClient.prototype.requestAdd3pidMsisdnToken = function(phoneCountry, phoneNumber,
clientSecret, sendAttempt, nextLink) { clientSecret, sendAttempt, nextLink) {
@@ -3904,7 +3904,7 @@ MatrixClient.prototype.requestAdd3pidMsisdnToken = function(phoneCountry, phoneN
* @param {number} sendAttempt As requestEmailToken * @param {number} sendAttempt As requestEmailToken
* @param {string} nextLink As requestEmailToken * @param {string} nextLink As requestEmailToken
* @param {module:client.callback} callback Optional. As requestEmailToken * @param {module:client.callback} callback Optional. As requestEmailToken
* @return {module:client.Promise} Resolves: As requestEmailToken * @return {Promise} Resolves: As requestEmailToken
*/ */
MatrixClient.prototype.requestPasswordEmailToken = function(email, clientSecret, MatrixClient.prototype.requestPasswordEmailToken = function(email, clientSecret,
sendAttempt, nextLink) { sendAttempt, nextLink) {
@@ -3930,7 +3930,7 @@ MatrixClient.prototype.requestPasswordEmailToken = function(email, clientSecret,
* @param {string} clientSecret As requestEmailToken * @param {string} clientSecret As requestEmailToken
* @param {number} sendAttempt As requestEmailToken * @param {number} sendAttempt As requestEmailToken
* @param {string} nextLink As requestEmailToken * @param {string} nextLink As requestEmailToken
* @return {module:client.Promise} Resolves: As requestEmailToken * @return {Promise} Resolves: As requestEmailToken
*/ */
MatrixClient.prototype.requestPasswordMsisdnToken = function(phoneCountry, phoneNumber, MatrixClient.prototype.requestPasswordMsisdnToken = function(phoneCountry, phoneNumber,
clientSecret, sendAttempt, nextLink) { clientSecret, sendAttempt, nextLink) {
@@ -3952,7 +3952,7 @@ MatrixClient.prototype.requestPasswordMsisdnToken = function(phoneCountry, phone
* *
* @param {string} endpoint The endpoint to send the request to * @param {string} endpoint The endpoint to send the request to
* @param {object} params Parameters for the POST request * @param {object} params Parameters for the POST request
* @return {module:client.Promise} Resolves: As requestEmailToken * @return {Promise} Resolves: As requestEmailToken
*/ */
MatrixClient.prototype._requestTokenFromEndpoint = async function(endpoint, params) { MatrixClient.prototype._requestTokenFromEndpoint = async function(endpoint, params) {
const postParams = Object.assign({}, params); const postParams = Object.assign({}, params);
@@ -4017,7 +4017,7 @@ MatrixClient.prototype.getRoomPushRule = function(scope, roomId) {
* @param {string} scope "global" or device-specific. * @param {string} scope "global" or device-specific.
* @param {string} roomId the id of the room. * @param {string} roomId the id of the room.
* @param {string} mute the mute state. * @param {string} mute the mute state.
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.setRoomMutePushRule = function(scope, roomId, mute) { MatrixClient.prototype.setRoomMutePushRule = function(scope, roomId, mute) {
@@ -4097,7 +4097,7 @@ MatrixClient.prototype.setRoomMutePushRule = function(scope, roomId, mute) {
* @param {string=} opts.keys The keys to search on. Defaults to all keys. One * @param {string=} opts.keys The keys to search on. Defaults to all keys. One
* of "content.body", "content.name", "content.topic". * of "content.body", "content.name", "content.topic".
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.searchMessageText = function(opts, callback) { MatrixClient.prototype.searchMessageText = function(opts, callback) {
@@ -4135,7 +4135,7 @@ MatrixClient.prototype.searchMessageText = function(opts, callback) {
* @param {Object} opts * @param {Object} opts
* @param {string} opts.term the term to search for * @param {string} opts.term the term to search for
* @param {Object} opts.filter a JSON filter object to pass in the request * @param {Object} opts.filter a JSON filter object to pass in the request
* @return {module:client.Promise} Resolves: result object * @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.searchRoomEvents = function(opts) { MatrixClient.prototype.searchRoomEvents = function(opts) {
@@ -4171,7 +4171,7 @@ MatrixClient.prototype.searchRoomEvents = function(opts) {
* Take a result from an earlier searchRoomEvents call, and backfill results. * Take a result from an earlier searchRoomEvents call, and backfill results.
* *
* @param {object} searchResults the results object to be updated * @param {object} searchResults the results object to be updated
* @return {module:client.Promise} Resolves: updated result object * @return {Promise} Resolves: updated result object
* @return {Error} Rejects: with an error response. * @return {Error} Rejects: with an error response.
*/ */
MatrixClient.prototype.backPaginateRoomEventsSearch = function(searchResults) { MatrixClient.prototype.backPaginateRoomEventsSearch = function(searchResults) {
@@ -4241,7 +4241,7 @@ MatrixClient.prototype._processRoomEventsSearch = function(searchResults, respon
/** /**
* Populate the store with rooms the user has left. * Populate the store with rooms the user has left.
* @return {module:client.Promise} Resolves: TODO - Resolved when the rooms have * @return {Promise} Resolves: TODO - Resolved when the rooms have
* been added to the data store. * been added to the data store.
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
@@ -4300,7 +4300,7 @@ MatrixClient.prototype.createFilter = function(content) {
* @param {string} filterId The filter ID to retrieve * @param {string} filterId The filter ID to retrieve
* @param {boolean} allowCached True to allow cached filters to be returned. * @param {boolean} allowCached True to allow cached filters to be returned.
* Default: True. * Default: True.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.getFilter = function(userId, filterId, allowCached) { MatrixClient.prototype.getFilter = function(userId, filterId, allowCached) {
@@ -4399,7 +4399,7 @@ MatrixClient.prototype.getOrCreateFilter = function(filterName, filter) {
* Gets a bearer token from the Home Server that the user can * Gets a bearer token from the Home Server that the user can
* present to a third party in order to prove their ownership * present to a third party in order to prove their ownership
* of the Matrix account they are logged into. * of the Matrix account they are logged into.
* @return {module:client.Promise} Resolves: Token object * @return {Promise} Resolves: Token object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.getOpenIdToken = function() { MatrixClient.prototype.getOpenIdToken = function() {
@@ -4418,7 +4418,7 @@ MatrixClient.prototype.getOpenIdToken = function() {
/** /**
* @param {module:client.callback} callback Optional. * @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO * @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixClient.prototype.turnServer = function(callback) { MatrixClient.prototype.turnServer = function(callback) {
@@ -5514,14 +5514,3 @@ MatrixClient.prototype.generateClientSecret = function() {
* @param {Object} err The error value, the "rejected" value or null. * @param {Object} err The error value, the "rejected" value or null.
* @param {Object} data The data returned, the "resolved" value. * @param {Object} data The data returned, the "resolved" value.
*/ */
/**
* {@link https://github.com/kriskowal/q|A promise implementation (Q)}. Functions
* which return this will specify 2 return arguments. These arguments map to the
* "onFulfilled" and "onRejected" values of the Promise.
* @typedef {Object} Promise
* @static
* @property {Function} then promise.then(onFulfilled, onRejected, onProgress)
* @property {Function} catch promise.catch(onRejected)
* @property {Function} finally promise.finally(callback)
*/

View File

@@ -594,7 +594,7 @@ export class DeviceList extends EventEmitter {
* *
* @param {String[]} users list of userIds * @param {String[]} users list of userIds
* *
* @return {module:client.Promise} resolves when all the users listed have * @return {Promise} resolves when all the users listed have
* been updated. rejects if there was a problem updating any of the * been updated. rejects if there was a problem updating any of the
* users. * users.
*/ */
@@ -699,7 +699,7 @@ class DeviceListUpdateSerialiser {
* @param {String} syncToken sync token to pass in the query request, to * @param {String} syncToken sync token to pass in the query request, to
* help the HS give the most recent results * help the HS give the most recent results
* *
* @return {module:client.Promise} resolves when all the users listed have * @return {Promise} resolves when all the users listed have
* been updated. rejects if there was a problem updating any of the * been updated. rejects if there was a problem updating any of the
* users. * users.
*/ */

View File

@@ -70,7 +70,7 @@ export class EncryptionAlgorithm {
* @param {string} eventType * @param {string} eventType
* @param {object} plaintext event content * @param {object} plaintext event content
* *
* @return {module:client.Promise} Promise which resolves to the new event body * @return {Promise} Promise which resolves to the new event body
*/ */
/** /**

View File

@@ -186,7 +186,7 @@ utils.inherits(MegolmEncryption, EncryptionAlgorithm);
* @param {Object} devicesInRoom The devices in this room, indexed by user ID * @param {Object} devicesInRoom The devices in this room, indexed by user ID
* @param {Object} blocked The devices that are blocked, indexed by user ID * @param {Object} blocked The devices that are blocked, indexed by user ID
* *
* @return {module:client.Promise} Promise which resolves to the * @return {Promise} Promise which resolves to the
* OutboundSessionInfo when setup is complete. * OutboundSessionInfo when setup is complete.
*/ */
MegolmEncryption.prototype._ensureOutboundSession = async function( MegolmEncryption.prototype._ensureOutboundSession = async function(
@@ -497,7 +497,7 @@ MegolmEncryption.prototype._splitBlockedDevices = function(devicesByUser) {
* *
* @param {object} payload fields to include in the encrypted payload * @param {object} payload fields to include in the encrypted payload
* *
* @return {module:client.Promise} Promise which resolves once the key sharing * @return {Promise} Promise which resolves once the key sharing
* for the given userDeviceMap is generated and has been sent. * for the given userDeviceMap is generated and has been sent.
*/ */
MegolmEncryption.prototype._encryptAndSendKeysToDevices = function( MegolmEncryption.prototype._encryptAndSendKeysToDevices = function(
@@ -558,7 +558,7 @@ MegolmEncryption.prototype._encryptAndSendKeysToDevices = function(
* *
* @param {object} payload fields to include in the notification payload * @param {object} payload fields to include in the notification payload
* *
* @return {module:client.Promise} Promise which resolves once the notifications * @return {Promise} Promise which resolves once the notifications
* for the given userDeviceMap is generated and has been sent. * for the given userDeviceMap is generated and has been sent.
*/ */
MegolmEncryption.prototype._sendBlockedNotificationsToDevices = async function( MegolmEncryption.prototype._sendBlockedNotificationsToDevices = async function(
@@ -779,7 +779,7 @@ MegolmEncryption.prototype._notifyBlockedDevices = async function(
* @param {string} eventType * @param {string} eventType
* @param {object} content plaintext event content * @param {object} content plaintext event content
* *
* @return {module:client.Promise} Promise which resolves to the new event body * @return {Promise} Promise which resolves to the new event body
*/ */
MegolmEncryption.prototype.encryptMessage = async function(room, eventType, content) { MegolmEncryption.prototype.encryptMessage = async function(room, eventType, content) {
const self = this; const self = this;
@@ -866,7 +866,7 @@ MegolmEncryption.prototype._checkForUnknownDevices = function(devicesInRoom) {
* *
* @param {module:models/room} room * @param {module:models/room} room
* *
* @return {module:client.Promise} Promise which resolves to an array whose * @return {Promise} Promise which resolves to an array whose
* first element is a map from userId to deviceId to deviceInfo indicating * first element is a map from userId to deviceId to deviceInfo indicating
* the devices that messages should be encrypted to, and whose second * the devices that messages should be encrypted to, and whose second
* element is a map from userId to deviceId to data indicating the devices * element is a map from userId to deviceId to data indicating the devices

View File

@@ -54,7 +54,7 @@ utils.inherits(OlmEncryption, EncryptionAlgorithm);
* @private * @private
* @param {string[]} roomMembers list of currently-joined users in the room * @param {string[]} roomMembers list of currently-joined users in the room
* @return {module:client.Promise} Promise which resolves when setup is complete * @return {Promise} Promise which resolves when setup is complete
*/ */
OlmEncryption.prototype._ensureSession = function(roomMembers) { OlmEncryption.prototype._ensureSession = function(roomMembers) {
if (this._prepPromise) { if (this._prepPromise) {
@@ -85,7 +85,7 @@ OlmEncryption.prototype._ensureSession = function(roomMembers) {
* @param {string} eventType * @param {string} eventType
* @param {object} content plaintext event content * @param {object} content plaintext event content
* *
* @return {module:client.Promise} Promise which resolves to the new event body * @return {Promise} Promise which resolves to the new event body
*/ */
OlmEncryption.prototype.encryptMessage = async function(room, eventType, content) { OlmEncryption.prototype.encryptMessage = async function(room, eventType, content) {
// pick the list of recipients based on the membership list. // pick the list of recipients based on the membership list.

View File

@@ -1866,7 +1866,7 @@ Crypto.prototype.trackRoomDevices = function(roomId) {
* *
* @param {string[]} users list of user ids * @param {string[]} users list of user ids
* *
* @return {module:client.Promise} resolves once the sessions are complete, to * @return {Promise} resolves once the sessions are complete, to
* an Object mapping from userId to deviceId to * an Object mapping from userId to deviceId to
* {@link module:crypto~OlmSessionResult} * {@link module:crypto~OlmSessionResult}
*/ */
@@ -1929,7 +1929,7 @@ Crypto.prototype.exportRoomKeys = async function() {
* Import a list of room keys previously exported by exportRoomKeys * Import a list of room keys previously exported by exportRoomKeys
* *
* @param {Object[]} keys a list of session export objects * @param {Object[]} keys a list of session export objects
* @return {module:client.Promise} a promise which resolves once the keys have been imported * @return {Promise} a promise which resolves once the keys have been imported
*/ */
Crypto.prototype.importRoomKeys = function(keys) { Crypto.prototype.importRoomKeys = function(keys) {
return Promise.all(keys.map((key) => { return Promise.all(keys.map((key) => {
@@ -2125,7 +2125,7 @@ Crypto.prototype.flagAllGroupSessionsForBackup = async function() {
* *
* @param {module:models/room} room destination room. * @param {module:models/room} room destination room.
* *
* @return {module:client.Promise?} Promise which resolves when the event has been * @return {Promise?} Promise which resolves when the event has been
* encrypted, or null if nothing was needed * encrypted, or null if nothing was needed
*/ */
/* eslint-enable valid-jsdoc */ /* eslint-enable valid-jsdoc */

View File

@@ -126,7 +126,7 @@ export async function encryptMessageForDevice(
* @param {boolean} force If true, establish a new session even if one already exists. * @param {boolean} force If true, establish a new session even if one already exists.
* Optional. * Optional.
* *
* @return {module:client.Promise} resolves once the sessions are complete, to * @return {Promise} resolves once the sessions are complete, to
* an Object mapping from userId to deviceId to * an Object mapping from userId to deviceId to
* {@link module:crypto~OlmSessionResult} * {@link module:crypto~OlmSessionResult}
*/ */

View File

@@ -155,7 +155,7 @@ MatrixHttpApi.prototype = {
* data has been uploaded, with an object containing the fields `loaded` * data has been uploaded, with an object containing the fields `loaded`
* (number of bytes transferred) and `total` (total size, if known). * (number of bytes transferred) and `total` (total size, if known).
* *
* @return {module:client.Promise} Resolves to response object, as * @return {Promise} Resolves to response object, as
* determined by this.opts.onlyData, opts.rawResponse, and * determined by this.opts.onlyData, opts.rawResponse, and
* opts.onlyContentUri. Rejects with an error (usually a MatrixError). * opts.onlyContentUri. Rejects with an error (usually a MatrixError).
*/ */
@@ -449,7 +449,7 @@ MatrixHttpApi.prototype = {
* *
* @param {Object=} opts.headers map of additional request headers * @param {Object=} opts.headers map of additional request headers
* *
* @return {module:client.Promise} Resolves to <code>{data: {Object}, * @return {Promise} Resolves to <code>{data: {Object},
* headers: {Object}, code: {Number}}</code>. * headers: {Object}, code: {Number}}</code>.
* If <code>onlyData</code> is set, this will resolve to the <code>data</code> * If <code>onlyData</code> is set, this will resolve to the <code>data</code>
* object only. * object only.
@@ -530,7 +530,7 @@ MatrixHttpApi.prototype = {
* *
* @param {Object=} opts.headers map of additional request headers * @param {Object=} opts.headers map of additional request headers
* *
* @return {module:client.Promise} Resolves to <code>{data: {Object}, * @return {Promise} Resolves to <code>{data: {Object},
* headers: {Object}, code: {Number}}</code>. * headers: {Object}, code: {Number}}</code>.
* If <code>onlyData</code> is set, this will resolve to the <code>data</code> * If <code>onlyData</code> is set, this will resolve to the <code>data</code>
* object only. * object only.
@@ -569,7 +569,7 @@ MatrixHttpApi.prototype = {
* *
* @param {Object=} opts.headers map of additional request headers * @param {Object=} opts.headers map of additional request headers
* *
* @return {module:client.Promise} Resolves to <code>{data: {Object}, * @return {Promise} Resolves to <code>{data: {Object},
* headers: {Object}, code: {Number}}</code>. * headers: {Object}, code: {Number}}</code>.
* If <code>onlyData</code> is set, this will resolve to the <code>data</code> * If <code>onlyData</code> is set, this will resolve to the <code>data</code>
* object only. * object only.
@@ -633,7 +633,7 @@ MatrixHttpApi.prototype = {
* @param {function=} opts.bodyParser function to parse the body of the * @param {function=} opts.bodyParser function to parse the body of the
* response before passing it to the promise and callback. * response before passing it to the promise and callback.
* *
* @return {module:client.Promise} a promise which resolves to either the * @return {Promise} a promise which resolves to either the
* response object (if this.opts.onlyData is truthy), or the parsed * response object (if this.opts.onlyData is truthy), or the parsed
* body. Rejects * body. Rejects
*/ */

View File

@@ -47,14 +47,14 @@ const MSISDN_STAGE_TYPE = "m.login.msisdn";
* @param {object?} opts.authData error response from the last request. If * @param {object?} opts.authData error response from the last request. If
* null, a request will be made with no auth before starting. * null, a request will be made with no auth before starting.
* *
* @param {function(object?): module:client.Promise} opts.doRequest * @param {function(object?): Promise} opts.doRequest
* called with the new auth dict to submit the request. Also passes a * called with the new auth dict to submit the request. Also passes a
* second deprecated arg which is a flag set to true if this request * second deprecated arg which is a flag set to true if this request
* is a background request. The busyChanged callback should be used * is a background request. The busyChanged callback should be used
* instead of the backfround flag. Should return a promise which resolves * instead of the backfround flag. Should return a promise which resolves
* to the successful response or rejects with a MatrixError. * to the successful response or rejects with a MatrixError.
* *
* @param {function(bool): module:client.Promise} opts.busyChanged * @param {function(bool): Promise} opts.busyChanged
* called whenever the interactive auth logic becomes busy submitting * called whenever the interactive auth logic becomes busy submitting
* information provided by the user or finsihes. After this has been * information provided by the user or finsihes. After this has been
* called with true the UI should indicate that a request is in progress * called with true the UI should indicate that a request is in progress
@@ -132,7 +132,7 @@ InteractiveAuth.prototype = {
/** /**
* begin the authentication process. * begin the authentication process.
* *
* @return {module:client.Promise} which resolves to the response on success, * @return {Promise} which resolves to the response on success,
* or rejects with the error on failure. Rejects with NoAuthFlowFoundError if * or rejects with the error on failure. Rejects with NoAuthFlowFoundError if
* no suitable authentication flow can be found * no suitable authentication flow can be found
*/ */

View File

@@ -89,7 +89,7 @@ export function TimelineWindow(client, timelineSet, opts) {
* given event * given event
* @param {number} [initialWindowSize = 20] Size of the initial window * @param {number} [initialWindowSize = 20] Size of the initial window
* *
* @return {module:client.Promise} * @return {Promise}
*/ */
TimelineWindow.prototype.load = function(initialEventId, initialWindowSize) { TimelineWindow.prototype.load = function(initialEventId, initialWindowSize) {
const self = this; const self = this;
@@ -257,7 +257,7 @@ TimelineWindow.prototype.canPaginate = function(direction) {
* @param {number} [requestLimit = 5] limit for the number of API requests we * @param {number} [requestLimit = 5] limit for the number of API requests we
* should make. * should make.
* *
* @return {module:client.Promise} Resolves to a boolean which is true if more events * @return {Promise} Resolves to a boolean which is true if more events
* were successfully retrieved. * were successfully retrieved.
*/ */
TimelineWindow.prototype.paginate = function(direction, size, makeRequest, TimelineWindow.prototype.paginate = function(direction, size, makeRequest,