1
0
mirror of https://github.com/rhysd/Mstdn.git synced 2025-02-02 06:52:13 +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[]) { constructor(accounts: Account[]) {
super(); super();
const submenu = [] as Electron.MenuItemOptions[]; const submenu = [] as Electron.MenuItemConstructorOptions[];
for (const account of accounts.filter(a => a.name !== '')) { for (const account of accounts.filter(a => a.name !== '')) {
let name = account.name; let name = account.name;

View File

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

View File

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

View File

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

View File

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

View File

@ -35,17 +35,23 @@ declare namespace Menubar {
showWindow(): void; showWindow(): void;
hideWindow(): void; hideWindow(): void;
} }
interface MenubarOptions extends Electron.BrowserWindowOptions { interface MenubarOptions extends Electron.BrowserWindowConstructorOptions {
dir?: string; dir?: string;
index?: string; index?: string;
tooltip?: string; tooltip?: string;
tray?: Electron.Tray; tray?: Electron.Tray;
icon?: string;
width?: number;
height?: number;
show?: boolean;
preloadWindow?: boolean; preloadWindow?: boolean;
alwaysOnTop?: boolean; alwaysOnTop?: boolean;
showOnAllWorkspaces?: boolean; showOnAllWorkspaces?: boolean;
windowPosition?: Position; windowPosition?: Position;
showDockIcon?: boolean; showDockIcon?: boolean;
showOnRightClick?: boolean; showOnRightClick?: boolean;
autoHideMenuBar?: boolean;
webPreferences?: Electron.WebPreferences;
} }
} }