WearEngineHostApiImpl.ets 1.19 KB
import { Result, WearEngineHostApi, WearDeviceInfo, WatchTransformTheme } from '../pigeon/WearEngineApi';

/**
 * WearEngine host implementation for HarmonyOS.
 *
 * Currently a stub – replace with HarmonyOS distributed communication /
 * BLE / HiWear ArkTS API calls once integration is ready.
 */
export class WearEngineHostApiImpl extends WearEngineHostApi {
  addWatchSurface(result: Result<boolean>): void {
    result.success(false);
  }

  syncWatchTheme(theme: WatchTransformTheme, result: Result<boolean>): void {
    result.success(false);
  }

  removeBackground(originImagePath: string, result: Result<string>): void {
    result.error(new Error('Background removal is not implemented on HarmonyOS.'));
  }

  hasInstalledWatchSurface(result: Result<boolean>): void {
    result.success(false);
  }
  hasAvailableDevices(): boolean {
    return false;
  }

  checkConnectedDevice(result: Result<WearDeviceInfo>): void {
    result.success(new WearDeviceInfo());
  }

  registerMessageReceiver(): boolean {
    return false;
  }

  sendTextMessage(_message: string): boolean {
    return false;
  }

  sendWatchSyncPayload(jsonPayload: string): boolean {
    return this.sendTextMessage(jsonPayload);
  }


}