Skip to content

Commit

Permalink
Appease jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Aug 18, 2021
1 parent 29e942b commit 78bb1ab
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 45 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matrix-bot-sdk",
"version": "0.5.19",
"version": "develop",
"description": "TypeScript/JavaScript SDK for Matrix bots and appservices",
"repository": {
"type": "git",
Expand Down Expand Up @@ -78,11 +78,11 @@
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/eslint-plugin-tslint": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"better-docs": "^2.3.0",
"better-docs": "^2.3.2",
"eslint": "^7.6.0",
"expect": "^26.2.0",
"get-port": "^5.1.1",
"jsdoc": "^3.6.5",
"jsdoc": "^3.6.7",
"matrix-mock-request": "^1.2.3",
"mocha": "^8.1.1",
"simple-mock": "^0.8.0",
Expand Down
5 changes: 3 additions & 2 deletions src/MatrixClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
import { requiresCrypto } from "./e2ee/decorators";
import { ICryptoStorageProvider } from "./storage/ICryptoStorageProvider";
import { EncryptedRoomEvent } from "./models/events/EncryptedRoomEvent";
import { IWhoAmI } from "./models/Account";

const SYNC_BACKOFF_MIN_MS = 5000;
const SYNC_BACKOFF_MAX_MS = 15000;
Expand Down Expand Up @@ -535,9 +536,9 @@ export class MatrixClient extends EventEmitter {

/**
* Gets the user's information from the server directly.
* @returns {Promise<{user_id: string, device_id?: string}>} The "who am I" response.
* @returns {Promise<IWhoAmI>} The "who am I" response.
*/
public getWhoAmI(): Promise<{user_id: string, device_id?: string}> {
public getWhoAmI(): Promise<IWhoAmI> {
return this.doRequest("GET", "/_matrix/client/r0/account/whoami");
}

Expand Down
6 changes: 3 additions & 3 deletions src/SynapseAdminApis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export interface SynapseUser {
/**
* A set of 3PIDs for the user.
*/
threepids?: [{
threepids?: {
medium: string;
address: string;
}];
}[];

/**
* The avatar URL (usually MXC URI) for the user, if set.
Expand Down Expand Up @@ -270,7 +270,7 @@ export class SynapseAdminApis {
/**
* Gets a list of state events in a room.
* @param {string} roomId The room ID to get state for.
* @returns {Promise<*[]>} Resolves to the room's state events.
* @returns {Promise<any[]>} Resolves to the room's state events.
*/
public async getRoomState(roomId: string): Promise<any[]> {
const r = await this.client.doRequest("GET", `/_synapse/admin/v1/rooms/${encodeURIComponent(roomId)}/state`);
Expand Down
26 changes: 13 additions & 13 deletions src/UnstableApis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class UnstableApis {
* Kicks a user from a group.
* @param {string} groupId The group ID to kick the user from.
* @param {string} userId The user ID to kick from the group.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async kickUserFromGroup(groupId: string, userId: string): Promise<any> {
return this.client.doRequest("PUT", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/admin/users/remove/${encodeURIComponent(userId)}`, null, {});
Expand All @@ -84,7 +84,7 @@ export class UnstableApis {
* Updates a group's profile
* @param {string} groupId The group ID to update.
* @param {GroupProfile} profile The profile to update the group with.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async setGroupProfile(groupId: string, profile: GroupProfile): Promise<any> {
return this.client.doRequest("POST", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/profile`, null, profile);
Expand All @@ -95,7 +95,7 @@ export class UnstableApis {
* require an invite (invite).
* @param {string} groupId The group ID to set the policy for.
* @param {"open" | "invite"} policy The policy to set.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async setGroupJoinPolicy(groupId: string, policy: "open" | "invite"): Promise<any> {
return this.client.doRequest("PUT", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/settings/m.join_policy`, null, {
Expand All @@ -110,7 +110,7 @@ export class UnstableApis {
* @param {string} groupId The group ID to add the room to.
* @param {string} roomId The room ID to add to the group.
* @param {boolean} isPublic Whether this group-room association is visible to non-members. Optional. Defaults to true.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async addRoomToGroup(groupId: string, roomId: string, isPublic = true): Promise<any> {
return this.client.doRequest("PUT", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/admin/rooms/${encodeURIComponent(roomId)}`, null, {
Expand All @@ -123,7 +123,7 @@ export class UnstableApis {
* @param {string} groupId The group ID of the room to update.
* @param {string} roomId The room ID of the room to update.
* @param {boolean} isPublic Whether this group-room association is visible to non-members.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async updateGroupRoomVisibility(groupId: string, roomId: string, isPublic: boolean): Promise<any> {
return this.client.doRequest("PUT", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/admin/rooms/${encodeURIComponent(roomId)}/config/m.visibility`, null, {
Expand All @@ -135,7 +135,7 @@ export class UnstableApis {
* Removes a room from a group.
* @param {string} groupId The group ID to remove the room from.
* @param {string} roomId The room ID to remove from the group.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async removeRoomFromGroup(groupId: string, roomId: string): Promise<any> {
return this.client.doRequest("DELETE", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/admin/rooms/${encodeURIComponent(roomId)}`);
Expand All @@ -153,7 +153,7 @@ export class UnstableApis {
/**
* Gets the users in a group.
* @param {string} groupId The group ID of which to get the users.
* @return {Promise<*[]>} Resolves to an array of all the users in the group.
* @return {Promise<any[]>} Resolves to an array of all the users in the group.
*/
public async getGroupUsers(groupId: string): Promise<any[]> {
const response = await this.client.doRequest("GET", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/users`);
Expand All @@ -163,7 +163,7 @@ export class UnstableApis {
/**
* Gets the invited users of a group.
* @param {string} groupId The group ID of which to get the invited users.
* @return {Promise<*[]>} Resolves to an array of all the users invited to the group.
* @return {Promise<any[]>} Resolves to an array of all the users invited to the group.
*/
public async getGroupInvitedUsers(groupId: string): Promise<any[]> {
const response = await this.client.doRequest("GET", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/invited_users`);
Expand All @@ -173,7 +173,7 @@ export class UnstableApis {
/**
* Gets the rooms of a group.
* @param {string} groupId The group ID of which to get all the rooms.
* @return {Promise<*[]>} Resolves to an array of all the rooms of the group.
* @return {Promise<any[]>} Resolves to an array of all the rooms of the group.
*/
public async getGroupRooms(groupId: string): Promise<any[]> {
const response = await this.client.doRequest("GET", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/rooms`);
Expand All @@ -183,7 +183,7 @@ export class UnstableApis {
/**
* Accepts an invite to a group.
* @param {string} groupId The group ID of which to accept the invite of.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async acceptGroupInvite(groupId: string): Promise<any> {
return this.client.doRequest("PUT", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/self/accept_invite`, null, {});
Expand All @@ -192,7 +192,7 @@ export class UnstableApis {
/**
* Joins a group.
* @param {string} groupId The group ID to join.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async joinGroup(groupId: string): Promise<any> {
return this.client.doRequest("PUT", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/self/join`, null, {});
Expand All @@ -201,7 +201,7 @@ export class UnstableApis {
/**
* Leaves a group.
* @param {string} groupId The group ID of the group to leave.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async leaveGroup(groupId: string): Promise<any> {
return this.client.doRequest("PUT", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/self/leave`, null, {});
Expand All @@ -211,7 +211,7 @@ export class UnstableApis {
* Sets the publicity of a group.
* @param {string} groupId The group ID to set the publicity of.
* @param {boolean} publicise If the group should be publicised.
* @return {Promise<*>} Resolves when completed.
* @return {Promise<any>} Resolves when completed.
*/
public async setGroupPublicity(groupId: string, publicise: boolean): Promise<any> {
return this.client.doRequest("PUT", `/_matrix/client/unstable/groups/${encodeURIComponent(groupId)}/self/update_publicity`, null, {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export * from "./models/Spaces";
export * from "./models/IdentityServerModels";
export * from "./models/Crypto";
export * from "./models/MSC2176";
export * from "./models/Account";

// Event models
export * from "./models/events/EventKind";
Expand Down
8 changes: 8 additions & 0 deletions src/models/Account.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Response to a `/whoami` request.
* @category Models
*/
export interface IWhoAmI {
user_id: string;
device_id?: string;
}
48 changes: 24 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,10 @@ bcrypt-pbkdf@^1.0.0:
dependencies:
tweetnacl "^0.14.3"

better-docs@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/better-docs/-/better-docs-2.3.0.tgz#69bc2daafdef92e76bfb4c3092eb71243abf9724"
integrity sha512-s+lvppWKGs9CU3r9bxnKAGbsW/rzSEeaEtVZE9qc+14098MiWy4pAAsXtTifkzgUnvDfWhnmPXZEc+fCAA0cBA==
better-docs@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/better-docs/-/better-docs-2.3.2.tgz#0de059301c49669a4350409d8c235868cf8bcbf7"
integrity sha512-VlbXQgEftaynJSaPa853XB5WqTlPoQQr2TnxIkKi6OsyJJxF42Ke+9SIES/hqTe58aaBnuoDGrIzOso8RdNx6Q==
dependencies:
brace "^0.11.1"
react-ace "^6.5.0"
Expand Down Expand Up @@ -973,12 +973,12 @@ caseless@~0.12.0:
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=

catharsis@^0.8.11:
version "0.8.11"
resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.8.11.tgz#d0eb3d2b82b7da7a3ce2efb1a7b00becc6643468"
integrity sha512-a+xUyMV7hD1BrDQA/3iPV7oc+6W26BgVJO05PGEoatMyIuPScQKsde6i3YorWX1qs+AZjnJ18NqdKoCtKiNh1g==
catharsis@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.9.0.tgz#40382a168be0e6da308c277d3a2b3eb40c7d2121"
integrity sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==
dependencies:
lodash "^4.17.14"
lodash "^4.17.15"

center-align@^0.1.1:
version "0.1.3"
Expand Down Expand Up @@ -2701,25 +2701,25 @@ jsbn@~0.1.0:
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=

jsdoc@^3.6.5:
version "3.6.5"
resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.6.5.tgz#e004372ca6f2dcdf19b3d2ebcd7c725528485502"
integrity sha512-SbY+i9ONuxSK35cgVHaI8O9senTE4CDYAmGSDJ5l3+sfe62Ff4gy96osy6OW84t4K4A8iGnMrlRrsSItSNp3RQ==
jsdoc@^3.6.7:
version "3.6.7"
resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.6.7.tgz#00431e376bed7f9de4716c6f15caa80e64492b89"
integrity sha512-sxKt7h0vzCd+3Y81Ey2qinupL6DpRSZJclS04ugHDNmRUXGzqicMJ6iwayhSA0S0DwwX30c5ozyUthr1QKF6uw==
dependencies:
"@babel/parser" "^7.9.4"
bluebird "^3.7.2"
catharsis "^0.8.11"
catharsis "^0.9.0"
escape-string-regexp "^2.0.0"
js2xmlparser "^4.0.1"
klaw "^3.0.0"
markdown-it "^10.0.0"
markdown-it-anchor "^5.2.7"
marked "^0.8.2"
marked "^2.0.3"
mkdirp "^1.0.4"
requizzle "^0.2.3"
strip-json-comments "^3.1.0"
taffydb "2.6.2"
underscore "~1.10.2"
underscore "~1.13.1"

jsesc@^2.5.1:
version "2.5.2"
Expand Down Expand Up @@ -2942,10 +2942,10 @@ markdown-it@^10.0.0:
mdurl "^1.0.1"
uc.micro "^1.0.5"

marked@^0.8.2:
version "0.8.2"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.8.2.tgz#4faad28d26ede351a7a1aaa5fec67915c869e355"
integrity sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==
marked@^2.0.3:
version "2.1.3"
resolved "https://registry.yarnpkg.com/marked/-/marked-2.1.3.tgz#bd017cef6431724fd4b27e0657f5ceb14bff3753"
integrity sha512-/Q+7MGzaETqifOMWYEA7HVMaZb4XbcRfaOzcSsHZEith83KGlvaSG33u0SKu89Mj5h+T8V2hM+8O45Qc5XTgwA==

matrix-mock-request@^1.2.3:
version "1.2.3"
Expand Down Expand Up @@ -4659,10 +4659,10 @@ underscore@^1.9.1:
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961"
integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==

underscore@~1.10.2:
version "1.10.2"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.10.2.tgz#73d6aa3668f3188e4adb0f1943bd12cfd7efaaaf"
integrity sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==
underscore@~1.13.1:
version "1.13.1"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.1.tgz#0c1c6bd2df54b6b69f2314066d65b6cde6fcf9d1"
integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==

union-value@^1.0.0:
version "1.0.1"
Expand Down

0 comments on commit 78bb1ab

Please sign in to comment.