diff --git a/package.json b/package.json index 6943127..4daef57 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "devDependencies": { "@types/electron-window-state": "^2.0.29", "@types/loglevel": "^1.4.30", + "@types/menubar": "^5.1.4", "@types/mousetrap": "^1.5.34", "@types/node": "^8.0.26", "browserify": "^14.4.0", diff --git a/tsconfig.json b/tsconfig.json index 98a0cae..5130458 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "noUnusedParameters": true, "noEmitOnError": true, "strictNullChecks": true, - "target": "es2015", + "target": "es2016", "sourceMap": true }, "include": [ diff --git a/typings/electron-context-menu.d.ts b/typings/electron-context-menu.d.ts index 0457c71..8fc2f24 100644 --- a/typings/electron-context-menu.d.ts +++ b/typings/electron-context-menu.d.ts @@ -3,12 +3,12 @@ declare namespace ElectronContextMenu { window?: Electron.BrowserWindow | Electron.WebviewTag; showInspectElement?: boolean; labels?: { - cut: string; - copy: string; - paste: string; - save: string; - copyLink: string; - inspect: string; + cut?: string; + copy?: string; + paste?: string; + save?: string; + copyLink?: string; + inspect?: string; }; append?(...args: any[]): any; prepend?(params: any, win: Electron.BrowserWindow): Electron.MenuItem[]; diff --git a/typings/menubar.d.ts b/typings/menubar.d.ts deleted file mode 100644 index f8f642c..0000000 --- a/typings/menubar.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -declare namespace Menubar { - type Position - = 'trayLeft' - | 'trayBottomLeft' - | 'trayRight' - | 'trayBottomRight' - | 'trayCenter' - | 'trayBottomCenter' - | 'topLeft' - | 'topRight' - | 'bottomLeft' - | 'bottomRight' - | 'topCenter' - | 'bottomCenter' - | 'center'; - type TrayBounds - = 'trayLeft' - | 'trayBottomLeft' - | 'trayRight' - | 'trayBottomRight' - | 'trayCenter' - | 'trayBottomCenter'; - interface ElectronPositioner { - move(pos: Position): void; - calculate(pos: Position, bounds?: TrayBounds): Electron.Point; - } - class MenubarApp extends NodeJS.EventEmitter { - app: Electron.App; - window: Electron.BrowserWindow; - tray: Electron.Tray; - positioner: ElectronPositioner; - - setOption(opt: string, value: any): void; - getOption(opt: string): any; - showWindow(): void; - hideWindow(): void; - } - interface MenubarOptions extends Electron.BrowserWindowConstructorOptions { - dir?: string; - index?: string; - tooltip?: string; - tray?: Electron.Tray; - icon?: string; - width?: number; - height?: number; - show?: boolean; - preloadWindow?: boolean; - alwaysOnTop?: boolean; - showOnAllWorkspaces?: boolean; - windowPosition?: Position; - showDockIcon?: boolean; - showOnRightClick?: boolean; - autoHideMenuBar?: boolean; - webPreferences?: Electron.WebPreferences; - } -} - -declare module 'menubar' { - const ctor: (opts?: Menubar.MenubarOptions) => Menubar.MenubarApp; - export = ctor; -}