import type { BridgeMethod } from './definitions'; /** * HuaweiBridgeClient encapsulates the JS Bridge communication between * Web and HarmonyOS native. It provides a Promise-based `call()` API * that internally serializes requests and matches them with async * native responses. * * Native side injects `window.aigensHuawei` object via javaScriptProxy. * Responses come back via `window.aigensHuaweiCallback(id, result)` * and `window.aigensHuaweiError(id, error)`. */ export declare class HuaweiBridgeClient { private static _instance; private pendingCallbacks; private callbackCounter; private initialized; /** * Singleton access. The bridge client is global by nature * (one WebView = one native bridge). */ static getInstance(): HuaweiBridgeClient; /** * Register global callback handlers on window so native can * invoke them via evaluateJavaScript. * Called lazily on first `call()`. */ private ensureInitialized; /** * Check whether the Huawei bridge is available (injected by native). */ isBridgeAvailable(): boolean; /** * Call a native method via JS Bridge. * * @param method Method name (must match BridgeMethod) * @param params Optional parameters object * @returns Promise that resolves with native response result */ call(method: BridgeMethod, params?: Record): Promise; /** * Generate a unique callback ID using timestamp + counter. * Lightweight alternative to UUID for performance. */ private generateCallbackId; }