Change return type

This commit is contained in:
RMidhunSuresh 2021-11-25 12:33:12 +05:30
parent a31860dc5f
commit 346e95c33c
3 changed files with 3 additions and 3 deletions

View file

@ -19,5 +19,5 @@ import type {HomeServerApi} from "../net/HomeServerApi.js";
export interface ILoginMethod {
homeserver: string;
login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Response["body"]>;
login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Record<string, any>>;
}

View file

@ -29,7 +29,7 @@ export class PasswordLoginMethod implements ILoginMethod {
this.homeserver = homeserver;
}
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Response["body"]> {
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Record<string, any>> {
return await hsApi.passwordLogin(this._username, this._password, deviceName, {log}).response();
}
}

View file

@ -28,7 +28,7 @@ export class TokenLoginMethod implements ILoginMethod {
this._loginToken = loginToken;
}
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Response["body"]> {
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Record<string, any>> {
return await hsApi.tokenLogin(this._loginToken, makeTxnId(), deviceName, {log}).response();
}
}