import { BridgeCode } from './bridge-code'; /** * * @description 登录信息 */ export declare class AppLoginInfo { /** 车牌号:例如浙A999999 */ carNo?: string; /** 未知 */ role?: number; /** 手机号 */ mobile: string; /** 性别 */ sex: number; /** 电台id */ siteId: number; /** 头像地址 */ avatar: string; /** token */ token: string; /** 用户id */ userId: number; /** 用户名 */ userName?: string; } /** * * @description 获取用户登录信息.如果未登录返回null * 桥接type: 31 */ export declare const getAppLoginInfo: (params?: { success?: ((res: AppLoginInfo | null) => void) | undefined; fail?: (error: BridgeCode) => void; complete?: () => void; } | undefined) => Promise; /** * * @description 触发登录, 该函数仅触发登录, 不会返回任何结果, 可以通过 getAppLoginInfo 获取登录结果 或者 watchAppLoginSuccess 监听到登录 */ export declare const triggerAppLogin: (params?: { success?: ((res: void) => void) | undefined; fail?: (error: BridgeCode) => void; complete?: () => void; } | undefined) => Promise; /** * * @description 启动轮询检查 APP 登录状态,查询到已登录后立即触发回调并自动回收回调函数(支持主动取消监听) * @example **示例代码** ```js import { onLoopCheckAppLogin } from '@kbapp/js-bridge'; const handle = onLoopCheckAppLogin(() => { console.log('登录成功') }) // handle() 停止监听 ``` */ export declare const onLoopCheckAppLogin: (callback: (loginInfo: AppLoginInfo) => void) => () => void;