Skip to content

Commit af9525e

Browse files
authored
Add device_id to /account/whoami types (#3005)
* Add `device_id` to `/account/whoami` types https://spec.matrix.org/v1.5/client-server-api/#get_matrixclientv3accountwhoami * Appease the linter * Modernize area of code * Remove unused eslint disable comment
1 parent 1ebcac3 commit af9525e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/client.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,11 @@ interface ITimestampToEventResponse {
842842
event_id: string;
843843
origin_server_ts: string;
844844
}
845+
846+
interface IWhoamiResponse {
847+
user_id: string;
848+
device_id?: string;
849+
}
845850
/* eslint-enable camelcase */
846851

847852
// We're using this constant for methods overloading and inspect whether a variable
@@ -9375,10 +9380,9 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
93759380
}
93769381

93779382
/**
9378-
* Fetches the user_id of the configured access token.
9383+
* Fetches information about the user for the configured access token.
93799384
*/
9380-
public async whoami(): Promise<{ user_id: string }> {
9381-
// eslint-disable-line camelcase
9385+
public async whoami(): Promise<IWhoamiResponse> {
93829386
return this.http.authedRequest(Method.Get, "/account/whoami");
93839387
}
93849388

0 commit comments

Comments
 (0)