1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

Move event jsdoc to respective classes. Document which functions fire.

This tends to boil down into a setXEvent method which can fire if it updates
the model.
This commit is contained in:
Kegan Dougal
2015-06-11 10:54:25 +01:00
parent 58cbd3ab1b
commit 07f77c495b
4 changed files with 118 additions and 93 deletions

View File

@@ -983,7 +983,6 @@ module.exports.MatrixClient = MatrixClient;
// MatrixClient Event JSDocs
// MatrixClient Events
/**
* Fires whenever the SDK receives a new event.
* @event module:client~MatrixClient#"event"
@@ -993,6 +992,7 @@ module.exports.MatrixClient = MatrixClient;
* var sender = event.getSender();
* });
*/
/**
* Fires whenever the SDK has a problem syncing.
* @event module:client~MatrixClient#"syncError"
@@ -1003,92 +1003,6 @@ module.exports.MatrixClient = MatrixClient;
* });
*/
// Room Events
/**
* Fires whenever the timeline in a room is updated.
* @event module:client~MatrixClient#"Room.timeline"
* @param {MatrixEvent} event The matrix event which caused this event to fire.
* @param {Room} room The room whose Room.timeline was updated.
* @param {boolean} toStartOfTimeline True if this event was added to the start
* (beginning; oldest) of the timeline e.g. due to pagination.
* @example
* matrixClient.on("Room.timeline", function(event, room, toStartOfTimeline){
* if (toStartOfTimeline) {
* var messageToAppend = room.timeline[room.timeline.length - 1];
* }
* });
*/
/**
* Fires whenever the name of a room is updated.
* @event module:client~MatrixClient#"Room.name"
* @param {MatrixEvent} event The matrix event which caused this event to fire.
* This will not always be <code>m.room.name</code>, as sometimes
* <code>m.room.aliases</code> or <code>m.room.member</code> events cause the
* Room.name to be updated.
* @param {Room} room The room whose Room.name was updated.
* @example
* matrixClient.on("Room.name", function(event, room){
* var newName = room.name;
* });
*/
// RoomState Events
/**
* Fires whenever the event dictionary in room state is updated.
* @event module:client~MatrixClient#"RoomState.events"
* @param {MatrixEvent} event The matrix event which caused this event to fire.
* @param {RoomState} state The room state whose RoomState.events dictionary
* was updated.
* @example
* matrixClient.on("RoomState.events", function(event, state){
* var newStateEvent = event;
* });
*/
/**
* Fires whenever the member dictionary in room state is updated.
* @event module:client~MatrixClient#"RoomState.members"
* @param {MatrixEvent} event The matrix event which caused this event to fire.
* @param {RoomState} state The room state whose RoomState.members dictionary
* was updated.
* @param {RoomMember} member The room member that was updated.
* @example
* matrixClient.on("RoomState.members", function(event, state, member){
* var newMembershipState = member.getMembershipState();
* });
*/
// User Events
/**
* Fires whenever any user's presence changes.
* @event module:client~MatrixClient#"User.presence"
* @param {MatrixEvent} event The matrix event which caused this event to fire.
* @param {User} user The user whose User.presence changed.
* @example
* matrixClient.on("User.presence", function(event, user){
* var newPresence = user.presence;
* });
*/
/**
* Fires whenever any user's display name changes.
* @event module:client~MatrixClient#"User.displayName"
* @param {MatrixEvent} event The matrix event which caused this event to fire.
* @param {User} user The user whose User.displayName changed.
* @example
* matrixClient.on("User.displayName", function(event, user){
* var newName = user.displayName;
* });
*/
/**
* Fires whenever any user's avatar URL changes.
* @event module:client~MatrixClient#"User.avatarUrl"
* @param {MatrixEvent} event The matrix event which caused this event to fire.
* @param {User} user The user whose User.avatarUrl changed.
* @example
* matrixClient.on("User.avatarUrl", function(event, user){
* var newUrl = user.avatarUrl;
* });
*/
// EventEmitter JSDocs
/**