/** * Indicates the Json types, incldue `undefind` cause of * Sometimes we allow some typing property is optional. */ export type Json = undefined | null | boolean | number | string | Json[] | { [prop: string]: Json; }; /** * 返回登陆成功的结果信息, 用户信息+acessToken */ export type FabricLoginCallbackData = { /** * 当前动作为用户主动取消登陆流程. 如果不传则为正常逻辑. */ action?: "cancelled"; /** * 当前携带的用户信息 */ userInfo: T; /** * 如果取消登陆, 返回的accessToken就等于空字符串 */ accessToken: string; }; export type AuthLogin = () => Promise>; export type AuthLogout = () => void; /** * Auth API * @interface */ export type FabricAuthApi = { /** * 无论当前未登录/已经登陆都不启动登陆界面, 但是返回已存在的`授权`数据 */ tryLogin: AuthLogin; /** * 如果当前未登录: 则强制启动登陆面板执行完登陆流程, 返回调用端`授权`数据; 如果已登陆, 则直接返回`授权`不启动登陆面板. */ forceLogin: AuthLogin; /** * 同步接口, 注销用户信息, 注销用户已有的授权信息 */ logout: AuthLogout; }; export declare const fabricAuth: FabricAuthApi; export {};