import { IUserInfo } from '../types'; import { judgePasswordFreeLogin } from './tcb'; export interface ISignInParams { /** * @deprecated * 用户授权访问手机号后拿到的 cloudID */ phoneCloudID?: string; userType?: string; force?: boolean; providerId?: string; } /** * 注册用户 * 参数为 使用 wx.getUserInfo 获取到到用户信息 * 如需手机号, 需额外提供 phoneCloudID(使用 wx.getUserProfile 获取) */ declare function signIn(params: ISignInParams): Promise; /** 退出登录 */ declare function signOut(): Promise; /** 获取用户信息, 若用户未注册(或信息过期), 则返回 null */ declare function getUserInfo(force?: boolean): Promise; /** * h5跳转地址带上微信小程序openid生成的授权登录token,用于小程序openid授权登录 * @param src h5跳转地址 * @returns */ declare function getUrlWithOpenidToken(src: string): Promise; /** * 小程序openId静默登录 */ declare function openIdLoginInWxApp(): Promise; /** * 小程序unionId静默登录 */ declare function unionIdLoginInWxApp(): Promise; /** * 修改用户信息 * @param param0.userName 用户名 * @param param0.nickName 昵称 * @param param0.avatarUrl 头像 * @param param0.description 描述 * @returns */ declare function modifyCurrentUser({ nickName, userName, avatarUrl, description }?: { nickName?: string | undefined; userName?: string | undefined; avatarUrl?: string | undefined; description?: string | undefined; }): Promise<{}>; declare const _default: { signIn: typeof signIn; signOut: typeof signOut; getUserInfo: typeof getUserInfo; setCurrentUserInfo(data?: Record): void; readonly currentUser: IUserInfo; getUrlWithOpenidToken: typeof getUrlWithOpenidToken; openIdLoginInWxApp: typeof openIdLoginInWxApp; unionIdLoginInWxApp: typeof unionIdLoginInWxApp; modifyCurrentUser: typeof modifyCurrentUser; judgePasswordFreeLogin: typeof judgePasswordFreeLogin; }; export default _default;