From 02a406b82163f2c06c525ecab148812582660ffc Mon Sep 17 00:00:00 2001 From: rhysd Date: Mon, 8 May 2017 02:13:56 +0900 Subject: [PATCH] update dependencies --- main/index.ts | 3 ++- package.json | 8 ++++---- typings/electron-context-menu.d.ts | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 typings/electron-context-menu.d.ts diff --git a/main/index.ts b/main/index.ts index 43d49e4..81b6803 100644 --- a/main/index.ts +++ b/main/index.ts @@ -1,4 +1,5 @@ import {app, dialog} from 'electron'; +import * as contextMenu from 'electron-context-menu'; import log from './log'; import startApp from './app'; import loadConfig from './config'; @@ -7,7 +8,7 @@ import loadConfig from './config'; // loading this application. We need to disable the callback. app.removeAllListeners(); -require('electron-context-menu')({}); +contextMenu(); const appReady = new Promise(resolve => app.once('ready', resolve)); diff --git a/package.json b/package.json index 52116bf..f545d7a 100644 --- a/package.json +++ b/package.json @@ -42,12 +42,12 @@ "@types/loglevel": "^1.4.29", "@types/menubar": "^5.1.3", "@types/mousetrap": "^1.5.33", - "@types/node": "^7.0.13", + "@types/node": "^7.0.18", "browserify": "^14.3.0", - "electron-packager": "^8.6.0", + "electron-packager": "^8.7.0", "npm-run-all": "^4.0.2", - "tslint": "^5.1.0", - "typescript": "^2.2.2" + "tslint": "^5.2.0", + "typescript": "^2.3.2" }, "dependencies": { "electron": "^1.6.8-beta", diff --git a/typings/electron-context-menu.d.ts b/typings/electron-context-menu.d.ts new file mode 100644 index 0000000..74455fc --- /dev/null +++ b/typings/electron-context-menu.d.ts @@ -0,0 +1,21 @@ +declare namespace ElectronContextMenu { + interface Options { + window?: Electron.BrowserWindow | Electron.WebViewElement; + prepend?: (params: any, win: Electron.BrowserWindow) => Electron.MenuItem[]; + append?: (...args: any[]) => any; + showInspectElement?: boolean; + labels?: { + cut: string; + copy: string; + paste: string; + save: string; + copyLink: string; + inspect: string; + }; + shouldShowMenu?: (event: Event, params: any) => boolean; + } +} +declare module 'electron-context-menu' { + const create: (options?: ElectronContextMenu.Options) => void; + export = create; +}