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

add jsdocs

This commit is contained in:
Bruno Windels
2019-06-26 15:48:39 +02:00
parent da116e6077
commit 4f044de79e
2 changed files with 20 additions and 1 deletions

View File

@@ -438,7 +438,16 @@ MatrixBaseApis.prototype.createRoom = function(options, callback) {
callback, "POST", "/createRoom", undefined, options,
);
};
/**
* Fetches relations for a given event
* @param {string} roomId the room of the event
* @param {string} eventId the id of the event
* @param {string} relationType the rel_type of the relations requested
* @param {string} eventType the event type of the relations requested
* @param {Object} opts options with optional values for the request.
* @param {Object} opts.from the pagination token returned from a previous request as `next_batch` to return following relations.
* @return {Object} the response, with chunk and next_batch.
*/
MatrixBaseApis.prototype.fetchRelations =
async function(roomId, eventId, relationType, eventType, opts) {
const queryParams = {};

View File

@@ -3965,6 +3965,16 @@ MatrixClient.prototype.getCanResetTimelineCallback = function() {
return this._canResetTimelineCallback;
};
/**
* Returns relations for a given event
* @param {string} roomId the room of the event
* @param {string} eventId the id of the event
* @param {string} relationType the rel_type of the relations requested
* @param {string} eventType the event type of the relations requested
* @param {Object} opts options with optional values for the request.
* @param {Object} opts.from the pagination token returned from a previous request as `nextBatch` to return following relations.
* @return {Object} an object with `events` as `MatrixEvent[]` and optionally `nextBatch` if more relations are available.
*/
MatrixClient.prototype.relations =
async function(roomId, eventId, relationType, eventType, opts = {}) {
const result = await this.fetchRelations(