import { AxiosRequestConfig } from 'axios'; import { AuthConfig, LOGIN_STATUS, UC, USER_IDENTITY } from './interface'; import { UserInfo } from './interface'; export type FinishLogin = (status: LOGIN_STATUS, userInfo: UserInfo | null, userRole: USER_IDENTITY | null, userAllRole: USER_IDENTITY[] | []) => void; export declare const ucLock: any; declare class Auth { uc: UC; isLogin: boolean; userInfo: UserInfo | null; ucLock: any; userIdentities: USER_IDENTITY[]; userRole: USER_IDENTITY | null; private static instance; constructor(config?: AuthConfig); setUC: (uc: UC) => void; getUC: () => any; static getInstance(config?: AuthConfig): Auth; ucApi: () => import("../request/interface").RequestInstance; setUserAllRole: (roles: USER_IDENTITY[]) => void; setUserRole: (role: USER_IDENTITY | null) => void; /** * 获取登录状态 * @returns {Promise} 返回登录状态,true表示已登录,false表示未登录 * 不可提供这个api给外部,因为外部无法保证调用时机 */ private getLoginState; listenLogin: (...args: any[]) => Promise; getUserInMicro: (...args: any[]) => Promise; loginByQuery: (...args: any[]) => Promise; loginByUcQuery: (query: any, { onLoginFinish }?: { onLoginFinish?: (status: LOGIN_STATUS) => void; }) => Promise; isRealUserLogin: () => Promise; /** * 请求过程中获取身份验证头部信息 * @param c 请求配置对象 * @returns 身份验证头部信息 */ getAuthHeader: (c: AxiosRequestConfig) => Promise; getUserInfo: (...args: any[]) => Promise; getUserInfoFromCache: (token: any) => Promise; throttledGetTokenAsync: (...args: any[]) => Promise; getAvatarURL(userId: string): any; setUserInfo: (userInfo: any) => void; getIndentity: (userId?: string | undefined, force?: boolean) => Promise; checkLoginState: ({ onLoginFinish }?: { onLoginFinish?: FinishLogin; }) => Promise; addUserIdentities: ({ userId, code }: { userId?: string | undefined; code: any; }) => Promise; getSdpAppId: () => any; getEnv: () => any; logout: (cb?: any) => Promise; isStudent: (curUserInfo: any, checkOrg?: boolean) => Promise; } export type AuthInstance = typeof Auth; declare const _default: typeof Auth.getInstance; export default _default;