diff --git a/src/matrix/login/LoginMethod.js b/src/matrix/login/LoginMethod.ts similarity index 61% rename from src/matrix/login/LoginMethod.js rename to src/matrix/login/LoginMethod.ts index ece18871..342632a6 100644 --- a/src/matrix/login/LoginMethod.js +++ b/src/matrix/login/LoginMethod.ts @@ -14,17 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -export class LoginMethod { - constructor({homeserver}) { - this.homeserver = homeserver; - } +import type {ILogItem} from "../../logging/types"; +import type {HomeServerApi} from "../net/HomeServerApi.js"; - // eslint-disable-next-line no-unused-vars - async login(hsApi, deviceName, log) { - /* - Regardless of the login method, SessionContainer.startWithLogin() - can do SomeLoginMethod.login() - */ - throw("Not Implemented"); - } +export interface ILoginMethod { + homeserver: string; + login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Response["body"]; } diff --git a/src/matrix/login/PasswordLoginMethod.js b/src/matrix/login/PasswordLoginMethod.js index 5c90ccf8..f147f229 100644 --- a/src/matrix/login/PasswordLoginMethod.js +++ b/src/matrix/login/PasswordLoginMethod.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {LoginMethod} from "./LoginMethod.js"; +import {LoginMethod} from "./LoginMethod"; export class PasswordLoginMethod extends LoginMethod { constructor(options) { diff --git a/src/matrix/login/TokenLoginMethod.js b/src/matrix/login/TokenLoginMethod.js index e55cedcf..1c623045 100644 --- a/src/matrix/login/TokenLoginMethod.js +++ b/src/matrix/login/TokenLoginMethod.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {LoginMethod} from "./LoginMethod.js"; +import {LoginMethod} from "./LoginMethod"; import {makeTxnId} from "../common.js"; export class TokenLoginMethod extends LoginMethod {