|
|
@@ -1,5 +1,6 @@
|
|
|
import { Injectable } from '@angular/core'
|
|
|
import { App, IpcRenderer, Shell, Dialog, Clipboard, GlobalShortcut, Screen, Remote, AutoUpdater, TouchBar, BrowserWindow, Menu, MenuItem, NativeImage, MessageBoxOptions } from 'electron'
|
|
|
+import * as remote from '@electron/remote'
|
|
|
|
|
|
export interface MessageBoxResponse {
|
|
|
response: number
|
|
|
@@ -17,30 +18,31 @@ export class ElectronService {
|
|
|
nativeImage: typeof NativeImage
|
|
|
screen: Screen
|
|
|
remote: Remote
|
|
|
+ process: any
|
|
|
autoUpdater: AutoUpdater
|
|
|
TouchBar: typeof TouchBar
|
|
|
BrowserWindow: typeof BrowserWindow
|
|
|
Menu: typeof Menu
|
|
|
MenuItem: typeof MenuItem
|
|
|
- private electron: any
|
|
|
|
|
|
/** @hidden */
|
|
|
private constructor () {
|
|
|
- this.electron = require('electron')
|
|
|
- this.remote = this.electron.remote
|
|
|
- this.app = this.remote.app
|
|
|
- this.screen = this.remote.screen
|
|
|
- this.dialog = this.remote.dialog
|
|
|
- this.shell = this.electron.shell
|
|
|
- this.clipboard = this.electron.clipboard
|
|
|
- this.ipcRenderer = this.electron.ipcRenderer
|
|
|
- this.globalShortcut = this.remote.globalShortcut
|
|
|
- this.nativeImage = this.remote.nativeImage
|
|
|
- this.autoUpdater = this.remote.autoUpdater
|
|
|
- this.TouchBar = this.remote.TouchBar
|
|
|
- this.BrowserWindow = this.remote.BrowserWindow
|
|
|
- this.Menu = this.remote.Menu
|
|
|
- this.MenuItem = this.remote.MenuItem
|
|
|
+ const electron = require('electron')
|
|
|
+ this.shell = electron.shell
|
|
|
+ this.clipboard = electron.clipboard
|
|
|
+ this.ipcRenderer = electron.ipcRenderer
|
|
|
+
|
|
|
+ this.process = remote.process
|
|
|
+ this.app = remote.app
|
|
|
+ this.screen = remote.screen
|
|
|
+ this.dialog = remote.dialog
|
|
|
+ this.globalShortcut = remote.globalShortcut
|
|
|
+ this.nativeImage = remote.nativeImage
|
|
|
+ this.autoUpdater = remote.autoUpdater
|
|
|
+ this.TouchBar = remote.TouchBar
|
|
|
+ this.BrowserWindow = remote.BrowserWindow
|
|
|
+ this.Menu = remote.Menu
|
|
|
+ this.MenuItem = remote.MenuItem
|
|
|
}
|
|
|
|
|
|
async showMessageBox (
|