Class HuaweiBridgeClient

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).

Constructors

Methods

  • Call a native method via JS Bridge.

    Parameters

    • method: BridgeMethod

      Method name (must match BridgeMethod)

    • Optional params: Record<string, any>

      Optional parameters object

    Returns Promise<any>

    Promise that resolves with native response result

  • Check whether the Huawei bridge is available (injected by native).

    Returns boolean