import { Injectable } from '@angular/core'; import { ipcRenderer } from 'electron'; import { NativeService } from '@ucap-webmessenger/native'; import { Channel } from '../types/channel.type'; export class ElectronNativeService implements NativeService { showNotify( roomSeq: number, title: string, contents: string, image: string, useSound: boolean ): void { ipcRenderer.send( Channel.showNotify, roomSeq, title, contents, image, useSound ); } checkForUpdates(): Promise { return new Promise((resolve, reject) => { try { resolve(ipcRenderer.sendSync(Channel.checkForUpdates)); } catch (error) { reject(error); } }); } showImageViewer(): void { ipcRenderer.send(Channel.showImageViewer); } saveFile(blob: Blob): void { ipcRenderer.send(Channel.saveFile, blob); } constructor() {} }