Refactor type

- Change name
- Move union type down
This commit is contained in:
RMidhunSuresh 2022-02-02 14:54:10 +05:30
parent 1d4b079d0c
commit 3a67da8830

View File

@ -20,9 +20,9 @@ import type {RegistrationDetails} from "./Registration";
import {DummyAuth} from "./stages/DummyAuth";
import {TermsAuth} from "./stages/TermsAuth";
type DerivedFromBaseRegistration = { new(hsApi: HomeServerApi, registrationData: RegistrationDetails, session: string, params?: Record<string, any>): BaseRegistrationStage } & typeof BaseRegistrationStage | undefined;
type ClassDerivedFromBaseRegistration = { new(hsApi: HomeServerApi, registrationData: RegistrationDetails, session: string, params?: Record<string, any>): BaseRegistrationStage } & typeof BaseRegistrationStage;
export function registrationStageFromType(type: string): DerivedFromBaseRegistration {
export function registrationStageFromType(type: string): ClassDerivedFromBaseRegistration | undefined{
switch (type) {
case "m.login.dummy":
return DummyAuth;