import { eSmsType } from "@/service/VerificationService"

/* eslint-disable */
export enum eAccountType {
    NULL,
    NO_REG, // 账号没注册
    REG_NOPD, // 账号已注册 为设置密码
    REG_PDSET, // 账号已注册 已设置密码
}

export enum eLoginWay {
    NULL,
    PWD, // 密码
    CODE // 验证码
}

export interface iRememberPhonePwd {
    phone: string;
    pwd: string;
}


/* 检测账户状态 */
export type tAccountStatusCheckFunc = (phone: string) => Promise<eAccountType>

/* 发送验证码 */
export type tSendSmsFunc = (phone: string, smstype?: eSmsType) => Promise<any>
/* 发送语音验证码 */
export type tSendVoiceFunc = (phone: string) => Promise<any>

/* 注册，请求成功后的后续操作需要写在本方法中，如保存token、路由转跳*/ 
export type tRegisterFunc = (phone: string, code: string) => Promise<boolean>

/* 登录 请求成功后的后续操作需要写在本方法， 如保存token、路由转跳*/
export type tLoginByCodeFunc = (phone: string, code: string) => Promise<any>
export type tLoginByPwdFunc = (phone: string, pwd: string) => Promise<any>


export interface iLoginCmpProps {
    accountStatusCheckFunc: tAccountStatusCheckFunc;
    registerFunc: tRegisterFunc;
    loginByCodeFunc: tLoginByCodeFunc;
    loginByPwdFunc: tLoginByPwdFunc;
    sendSmsFunc: tSendSmsFunc,
    sendVoiceFunc: tSendVoiceFunc,
}

