You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-04 05:02:41 +03:00
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
This commit is contained in:
@@ -842,6 +842,11 @@ interface ITimestampToEventResponse {
|
||||
event_id: string;
|
||||
origin_server_ts: string;
|
||||
}
|
||||
|
||||
interface IWhoamiResponse {
|
||||
user_id: string;
|
||||
device_id?: string;
|
||||
}
|
||||
/* eslint-enable camelcase */
|
||||
|
||||
// We're using this constant for methods overloading and inspect whether a variable
|
||||
@@ -9375,10 +9380,9 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the user_id of the configured access token.
|
||||
* Fetches information about the user for the configured access token.
|
||||
*/
|
||||
public async whoami(): Promise<{ user_id: string }> {
|
||||
// eslint-disable-line camelcase
|
||||
public async whoami(): Promise<IWhoamiResponse> {
|
||||
return this.http.authedRequest(Method.Get, "/account/whoami");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user