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;
|
event_id: string;
|
||||||
origin_server_ts: string;
|
origin_server_ts: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface IWhoamiResponse {
|
||||||
|
user_id: string;
|
||||||
|
device_id?: string;
|
||||||
|
}
|
||||||
/* eslint-enable camelcase */
|
/* eslint-enable camelcase */
|
||||||
|
|
||||||
// We're using this constant for methods overloading and inspect whether a variable
|
// 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 }> {
|
public async whoami(): Promise<IWhoamiResponse> {
|
||||||
// eslint-disable-line camelcase
|
|
||||||
return this.http.authedRequest(Method.Get, "/account/whoami");
|
return this.http.authedRequest(Method.Get, "/account/whoami");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user