interface DeviceInfo { appName: string; appVersion: string; deviceId: string; scheme: string; duid?: string; ssid?: string; uuid?: string; network?: string; sysModel?: string; sysVersion?: string; extraData: Record; } interface UserInfo { token: string; userId: string; userName: string; } interface ShareConfig { miniprogram: [ { miniprogramType: 0 | 1 | 2; path: string; title: string; des: string; userName: string; hdImageData: string; iconUrl: string; iconBase64String: string; iconName: string; } ]; copy: { iconUrl: string; iconName: string; url: string; }; } declare enum OpenWebViewEnum { Append = "Append", Replace = "Replace", Single = "Single" } declare enum WebViewTypeEnum { WebView = "WebKit", WKWebview = "WKWebview", UIWebview = "UIWebview", Browser = "Browser", WeChatMPWebView = "WxMiniProgramWebView", Unsupported = "Unsupported" } declare enum OrientationEnum { Landscape = "Landscape", Portrait = "Portrait" } interface WebViewErrorInfo { errorCode: string; errorMsg: string; } interface WebViewState { active: boolean; orientation: OrientationEnum; minimized: boolean; } type WebViewEventMap = { 'error'(error: Error | WebViewErrorInfo): void; 'webViewStateChange': (webViewState: WebViewState) => void; }; type EventMap = { [name: string]: (...args: any[]) => void | boolean; }; declare class Subscribe { hasListener(name: keyof T): boolean; on(name: K, callback: (...args: Parameters) => ReturnType, once?: boolean): () => void; once(name: K, callback: (...args: Parameters) => ReturnType): () => void; off(name?: K, callback?: (...args: Parameters) => ReturnType): void; emit(name: K, ...data: Parameters): boolean; } interface StaticData extends DeviceInfo { userInfo?: UserInfo; [key: string]: unknown; } type JSBridgeReturnType = [T | null, Error | null]; interface JSBridgeProtocol extends Subscribe { webViewType: WebViewTypeEnum; ready(): Promise>; callAndBackfeed(schemeUrl: string): Promise>; callAndListen(schemeUrl: string, callback: (data: T) => void): Promise void)>>; loadProgress(progress: number): Promise>; closeLoading(): Promise>; getDeviceInfo(): Promise>; getStaticData(): Promise>; getWebViewState(): Promise>; setLeftTopBackButton(enable: boolean): Promise>; login(): Promise>; logout(): Promise>; getUserInfo(): Promise>; openWebView(url: string, way: OpenWebViewEnum): Promise>; closeWebView(): Promise>; getBangsHeight(): Promise>; setOrientation(orientation: OrientationEnum): Promise>; keepScreenLight(enable: boolean): Promise>; shock(duration?: number): Promise>; minimize(): Promise>; saveImage2Album(base64: string): Promise>; detectMicro(): Promise>; actionShare(shareConfig: Partial): Promise>; preload(urls: string[]): Promise>; createCacheProxyUrl(urls: string | string[]): string[]; invokeNativeApi?

(method: string, data?: P): R | Promise; } interface ControllerProtocol { checkReady(timeout?: number): Promise>; getStaticData(timeout?: number): Promise>; callAndBackfeed(scheme: string): Promise>; callAndListen(scheme: string, callback: (data: T) => void): Promise void)>>; } declare class BaseController implements ControllerProtocol { checkReady(timeout?: number): Promise>; getStaticData(timeout?: number): Promise>; callAndBackfeed(scheme: string): Promise>; callAndListen(scheme: string, callback: (data: T) => void): Promise void)>>; } interface HybridBridgeLJ { getStaticData: (functionName: string) => void; callAndBackfeed: (msg: string) => void; callAndListen: (msg: string) => void; invoke?(method: string, args: P): Promise; execute?(method: string, args: P): Promise; isReady: boolean; } declare class HybridBridge implements HybridBridgeLJ { private _rsWeappBridgeMethodAdapter; private _ws; private _readyState; get isReady(): boolean; constructor(); initialize: (timeout?: number) => Promise>; private initBuiltInHandlers; private _open; private _registerLifecycleHandler; private _registerHeartbeatHandler; private _receivedMessage; private _registerReadyHandler; send: (data: string | ArrayBufferLike | Blob | ArrayBufferView) => void; waitReady: (timeout?: number) => Promise; private _parseMessage; private _registerMessageHandler; private _registerBridgeRequestHandler; getStaticData: (callbackFunctionName: string) => void; private _callAndBackfeed; callAndBackfeed: (msg: string) => void; private _callAndListen; callAndListen: (msg: string) => void; invoke(method: string, args: P): Promise; execute:

(method: string, args?: P | undefined) => Promise; private _invokeBridgeMethod; } declare class WxMiniprogramController extends BaseController { private _hybridBridge; deviceInfo?: DeviceInfo; staticData?: StaticData; initializing: boolean; get hybridBridge(): HybridBridge; private checkBridgeReady; checkReady(timeout?: number): Promise>; getStaticData(timeout?: number): Promise>; get ready(): boolean; get scheme(): string; createSchemeLink(schemeUrl: string): string; callAndBackfeed(scheme: string): Promise>; callAndListen(scheme: string, callback: (data: T) => void): Promise void)>>; invoke(method: string, data?: P): Promise; } declare abstract class JSBridgeCore extends Subscribe implements JSBridgeProtocol { webViewType: WebViewTypeEnum; abstract ready(): Promise>; abstract callAndBackfeed(schemeUrl: string): Promise>; abstract callAndListen(schemeUrl: string, callback: (data: T) => void): Promise void)>>; abstract loadProgress(progress: number): Promise>; abstract closeLoading(): Promise>; abstract getDeviceInfo(): Promise>; abstract getStaticData(): Promise>; abstract getWebViewState(): Promise>; abstract setLeftTopBackButton(enable: boolean): Promise>; abstract login(): Promise>; abstract logout(): Promise>; abstract getUserInfo(): Promise>; abstract openWebView(url: string, way: OpenWebViewEnum): Promise>; abstract closeWebView(): Promise>; abstract getBangsHeight(): Promise>; abstract setOrientation(orientation: OrientationEnum): Promise>; abstract keepScreenLight(enable: boolean): Promise>; abstract shock(duration?: number): Promise>; abstract minimize(): Promise>; abstract saveImage2Album(base64: string): Promise>; abstract detectMicro(): Promise>; abstract actionShare(shareConfig: Partial): Promise>; abstract preload(urls: string[]): Promise>; abstract createCacheProxyUrl(urls: string | string[]): string[]; } interface JSBridgeOptions { timeout?: number; wsOrigin?: string; } declare class JSBridgeMiniprogram extends JSBridgeCore { options: JSBridgeOptions & { wsOrigin?: string; }; _controller: WxMiniprogramController; webViewType: WebViewTypeEnum; constructor(options?: Partial); ready(): Promise>; callAndBackfeed(schemeUrl: string): Promise>; callAndListen(schemeUrl: string, callback: (data: T) => void): Promise void)>>; setLeftTopBackButton(enable?: boolean): Promise>; getBangsHeight(): Promise>; shock(duration?: number): Promise>; minimize(): Promise>; loadProgress(progress: number): Promise>; closeLoading(): Promise>; setOrientation(orientation: OrientationEnum): Promise>; keepScreenLight(enable: boolean): Promise>; closeWebView(): Promise>; openWebView(url: string, way: OpenWebViewEnum): Promise>; saveImage2Album(base64: string): Promise>; actionShare(shareConfig: Partial): Promise>; getDeviceInfo(): Promise>; getStaticData(): Promise>; getUserInfo(): Promise>; getWebViewState(): Promise>; login(): Promise>; logout(): Promise>; detectMicro(): Promise>; preload(urls: string[]): Promise>; createCacheProxyUrl(urls: string | string[]): string[]; invokeNativeApi(method: string, data?: P): Promise; execute(method: string, args?: any): Promise; } export { JSBridgeMiniprogram };