yz-native-js-sdk
Version:
provide the native function call API of yunzai mobile platform for the third party
44 lines (43 loc) • 977 B
TypeScript
interface WebViewMessage {
action: string;
callbackId?: string;
params?: any;
}
export interface AppUserInfo {
token: string;
tenantId: string;
userId: string;
username: string;
realname: string;
userCode: string;
userType: number;
deptId: string;
deptName: string;
}
export declare class WebViewAppCommService {
private callbackMap;
private callbackId;
private bridgeReady;
constructor();
/**
* 初始化监听 UniApp JSBridge 就绪
*/
private initBridgeListener;
/**
* 统一发送消息给 App
*/
postMessage<T = any>(param: WebViewMessage): Promise<T>;
/**
* 接收 App 发来的消息(全局挂载)
*/
private handleAppMessage;
/**
* 【核心方法】从 App 获取用户信息
*/
getUserInfo(): Promise<AppUserInfo>;
/**
* 退出登录
*/
logout(): void;
}
export {};