import { Observable } from 'rxjs'; import { NativeService } from '@ucap-webmessenger/native'; import { HttpClient } from '@angular/common/http'; import { map } from 'rxjs/operators'; export class BrowserNativeService implements NativeService { showNotify( roomSeq: number, title: string, contents: string, image: string, useSound: boolean ): void {} checkForUpdates(): Observable { return new Observable(subscriber => { try { subscriber.next(false); } catch (error) { subscriber.error(error); } finally { subscriber.complete(); } }); } showImageViewer(): void {} readFile(path: string): Observable { return this.httpClient.get(path, { responseType: 'arraybuffer' }); } saveFile(path: string, buf: ArrayBuffer): Observable { return this.httpClient.post(path, buf, {}); } constructor(private httpClient: HttpClient) {} }