@tb-app/web-view
Version:
实现webview与淘宝小程序之间的通信
22 lines (21 loc) • 607 B
TypeScript
/**
* 只能在 web-view 端调用,使用小程序端注册的功能
* @param options
* @returns
*/
declare function invoke<T = any>(options: {
type: string;
data?: any;
}): Promise<T>;
/**
* 只能在 web-view 端调用, 同一类消息可以注册多个事件回调
* @param type
* @param callback
*/
declare function listen(type: string, callback: (data?: any) => void): void;
/**
* 只能在 web-view 端调用,用于移除对应的事件监听
* @param type
*/
declare function removeListen(type: string): void;
export { invoke, listen, removeListen };