import { ModuleDesc, ModuleName, ModuleEventMap, ModuleCmdMap, CmdFun } from '../types/protocol';
import { AccountInfo, AppType, BaseAccountInfo, DebugTenant } from '../types/commonData';
import { SwitchEnvOptions, LoginOptions, LogoutOptions } from '../types/account';
export declare enum EventEnum {
    Logined = "Account.Logined",
    Logouted = "Account.Logouted",
    switchedTenant = "Account.switchedTenant",
    loginTimeout = "Account.loginTimeout",
    switchedEnv = "Account.switchedEnv"
}
export interface EventMap extends ModuleEventMap<EventEnum> {
    [EventEnum.Logined]: {
        type: '';
        params: AccountInfo;
    };
    [EventEnum.Logouted]: {
        type: '';
        params: {
            sessionExpired: boolean;
        };
    };
    [EventEnum.switchedTenant]: {
        type: '';
        params: {
            success: boolean;
            msg?: string;
            type: 'debug' | 'default';
        };
    };
    [EventEnum.loginTimeout]: {
        type: '';
        params: {};
    };
    [EventEnum.switchedEnv]: {
        type: '';
        params: {
            accountInfo: AccountInfo;
        };
    };
}
export declare enum CmdEnum {
    Login = "Account.login",
    Logout = "Account.logout",
    Info = "Account.info",
    IsLogin = "Account.isLogin",
    tenantList = "Account.tenantList",
    switchTenant = "Account.switchTenant",
    switchDebugTenant = "Account.switchDebugTenant",
    switchEnv = "Account.swtichEnv"
}
export type CmdLogin = (m: ModuleName.account, cmd: CmdEnum.Login, options: LoginOptions) => Promise<void>;
export type CmdLogout = (m: ModuleName.account, cmd: CmdEnum.Logout, options: LogoutOptions) => Promise<void>;
export type CmdInfo = (m: ModuleName.account, cmd: CmdEnum.Info, environment?: string) => AccountInfo | undefined;
export type CmdIsLogin = (m: ModuleName, cmd: CmdEnum.IsLogin, environment?: string) => boolean;
export type CmdTenantList = (m: ModuleName, cmd: CmdEnum.tenantList) => Promise<BaseAccountInfo[] | void>;
export type CmdSwitchTenant = (m: ModuleName, cmd: CmdEnum.switchTenant, account: BaseAccountInfo) => Promise<{
    result: 'success' | 'fail' | 'noneed';
    msg?: string;
}>;
export type CmdSwitchDebugTenant = (m: ModuleName, cmd: CmdEnum.switchDebugTenant, account: DebugTenant, compilePath: string, appType: AppType) => Promise<{
    result: 'success' | 'fail' | 'noneed';
    msg?: string;
}>;
export type CmdSwitchEnv = (m: ModuleName, cmd: CmdEnum.switchEnv, options: SwitchEnvOptions) => Promise<{
    accountInfo: AccountInfo;
}>;
export type Command = CmdLogin & CmdLogout & CmdInfo & CmdIsLogin & CmdTenantList & CmdSwitchTenant & CmdSwitchDebugTenant & CmdSwitchEnv;
export interface CmdMap extends ModuleCmdMap<CmdEnum> {
    [CmdEnum.Login]: CmdFun<CmdLogin>;
    [CmdEnum.Logout]: CmdFun<CmdLogout>;
    [CmdEnum.Info]: CmdFun<CmdInfo>;
    [CmdEnum.IsLogin]: CmdFun<CmdIsLogin>;
    [CmdEnum.tenantList]: CmdFun<CmdTenantList>;
    [CmdEnum.switchTenant]: CmdFun<CmdSwitchTenant>;
    [CmdEnum.switchDebugTenant]: CmdFun<CmdSwitchDebugTenant>;
    [CmdEnum.switchEnv]: CmdFun<CmdSwitchEnv>;
}
type ModuleDependencies = ModuleName.storage | ModuleName.ui | ModuleName.service | ModuleName.eventTracker | ModuleName.compile | ModuleName.static;
export declare const AccountDesc: ModuleDesc<EventMap, CmdMap, ModuleDependencies>;
export {};
