1
0
mirror of https://github.com/rhysd/Mstdn.git synced 2025-02-01 05:52:11 +01:00

update Electron to v1.7.5 (use official type definitions)

This commit is contained in:
rhysd 2017-08-30 12:33:49 +09:00
parent 1a7745345b
commit 33c3b4df5f
6 changed files with 15 additions and 10 deletions

View File

@ -19,7 +19,7 @@ export default class AccountSwitcher extends EventEmitter {
constructor(accounts: Account[]) {
super();
const submenu = [] as Electron.MenuItemOptions[];
const submenu = [] as Electron.MenuItemConstructorOptions[];
for (const account of accounts.filter(a => a.name !== '')) {
let name = account.name;

View File

@ -2,7 +2,7 @@ import * as path from 'path';
import {Menu, shell, app} from 'electron';
export default function defaultMenu() {
const template: Electron.MenuItemOptions[] = [
const template: Electron.MenuItemConstructorOptions[] = [
{
label: 'Edit',
submenu: [
@ -138,7 +138,7 @@ export default function defaultMenu() {
]
});
(template[1].submenu as Electron.MenuItemOptions[]).push(
(template[1].submenu as Electron.MenuItemConstructorOptions[]).push(
{
type: 'separator'
},

View File

@ -37,8 +37,7 @@
},
"homepage": "https://github.com/rhysd/Mstdn#readme",
"devDependencies": {
"@types/electron": "~1.4.37",
"@types/electron-window-state": "^2.0.28",
"@types/electron-window-state": "^2.0.29",
"@types/loglevel": "^1.4.29",
"@types/mousetrap": "^1.5.34",
"@types/node": "^8.0.0",
@ -49,9 +48,9 @@
"typescript": "^2.3.4"
},
"dependencies": {
"electron": "1.6.8",
"electron-window-state": "^4.1.1",
"electron": "^1.7.5",
"electron-context-menu": "^0.9.1",
"electron-window-state": "^4.1.1",
"loglevel": "^1.4.1",
"menubar": "github:rhysd/menubar#mstdn",
"mousetrap": "^1.6.1"

View File

@ -2,7 +2,7 @@ import {ipcRenderer as ipc} from 'electron';
import log from './log';
export function on(channel: IpcChannelFromMain, callback: (...args: any[]) => void) {
ipc.on(channel, (_, ...args: any[]) => {
ipc.on(channel, (_: any, ...args: any[]) => {
log.info('IPC: Received from:', channel, args);
callback(...args);
});

View File

@ -1,6 +1,6 @@
declare namespace ElectronContextMenu {
interface Options {
window?: Electron.BrowserWindow | Electron.WebViewElement;
window?: Electron.BrowserWindow | Electron.WebviewTag;
showInspectElement?: boolean;
labels?: {
cut: string;

View File

@ -35,17 +35,23 @@ declare namespace Menubar {
showWindow(): void;
hideWindow(): void;
}
interface MenubarOptions extends Electron.BrowserWindowOptions {
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;
}
}