package com.adealink.weparty.account.login.manager

import com.adealink.frame.base.Rlt
import com.adealink.frame.frame.IBaseFrame
import com.adealink.frame.network.data.Res
import com.adealink.weparty.account.login.data.AccountInfo
import com.adealink.weparty.account.login.data.LoginResult
import com.adealink.weparty.account.login.data.ThirdType
import com.adealink.weparty.module.account.ILoginListener

interface ILoginManager : IBaseFrame<ILoginListener> {
    var uid: String
    var token: String
    var isLogin: Boolean
    suspend fun login(
        authType: ThirdType,
        token: String,
        tid: Long? = null,
        codeVerifier: String? = null
    ): Rlt<Res<LoginResult>>

    suspend fun testLogin(): Rlt<Res<LoginResult>>

    fun logout(toLogin: Boolean? = true)
    fun onTokenExpire()
    fun notifyLogin()
    fun notifyLogout()

    fun deleteAccount()
    fun setIsNewRegister(isNew: Boolean)
    fun isNewRegister(): Boolean
    fun refreshToken()

    fun checkRemoteVirtualAppConfig()

    fun getLoginDeviceId(): String
    suspend fun fetchAccountInfo(): Rlt<List<AccountInfo>>

}