You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Improve and consolidate typing
This commit is contained in:
@@ -109,8 +109,8 @@ export class EncryptionSetupBuilder {
|
||||
* @param {Object} content
|
||||
* @return {Promise}
|
||||
*/
|
||||
public setAccountData(type: string, content: object): Promise<void> {
|
||||
return this.accountDataClientAdapter.setAccountData(type, content);
|
||||
public async setAccountData(type: string, content: object): Promise<void> {
|
||||
await this.accountDataClientAdapter.setAccountData(type, content);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -284,7 +284,7 @@ class AccountDataClientAdapter extends EventEmitter {
|
||||
* @param {Object} content
|
||||
* @return {Promise}
|
||||
*/
|
||||
public setAccountData(type: string, content: any): Promise<void> {
|
||||
public setAccountData(type: string, content: any): Promise<{}> {
|
||||
const lastEvent = this.values.get(type);
|
||||
this.values.set(type, content);
|
||||
// ensure accountData is emitted on the next tick,
|
||||
@@ -293,6 +293,7 @@ class AccountDataClientAdapter extends EventEmitter {
|
||||
return Promise.resolve().then(() => {
|
||||
const event = new MatrixEvent({ type, content });
|
||||
this.emit("accountData", event, lastEvent);
|
||||
return {};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user