mirror of
https://github.com/rhysd/Mstdn.git
synced 2025-02-19 22:54:16 +01:00
update dependencies and fix lint errors
This commit is contained in:
parent
33c3b4df5f
commit
496cacb8c8
@ -49,7 +49,8 @@ export default class AccountSwitcher extends EventEmitter {
|
|||||||
submenu,
|
submenu,
|
||||||
});
|
});
|
||||||
|
|
||||||
const menu = Menu.getApplicationMenu();
|
// Note: Electron's type definitions don't support nullable types yet.
|
||||||
|
const menu = Menu.getApplicationMenu() as Electron.Menu | null;
|
||||||
if (menu !== null) {
|
if (menu !== null) {
|
||||||
// Insert item before 'Help'
|
// Insert item before 'Help'
|
||||||
menu.insert(menu.items.length - 1, item);
|
menu.insert(menu.items.length - 1, item);
|
||||||
|
@ -34,7 +34,9 @@ export default class Window {
|
|||||||
public browser: Electron.BrowserWindow,
|
public browser: Electron.BrowserWindow,
|
||||||
public state: any /*XXX: ElectronWindowState.WindowState */,
|
public state: any /*XXX: ElectronWindowState.WindowState */,
|
||||||
public account: Account,
|
public account: Account,
|
||||||
|
/* tslint:disable:no-shadowed-variable */
|
||||||
public menubar: Menubar.MenubarApp | null,
|
public menubar: Menubar.MenubarApp | null,
|
||||||
|
/* tslint:enable:no-shadowed-variable */
|
||||||
) {
|
) {
|
||||||
if (!IS_DARWIN) {
|
if (!IS_DARWIN) {
|
||||||
// Users can still access menu bar with pressing Alt key.
|
// Users can still access menu bar with pressing Alt key.
|
||||||
|
14
package.json
14
package.json
@ -14,7 +14,7 @@
|
|||||||
"build:bundle:release": "NODE_ENV=production browserify -x electron renderer/index.js -o renderer/preload.js",
|
"build:bundle:release": "NODE_ENV=production browserify -x electron renderer/index.js -o renderer/preload.js",
|
||||||
"build:release": "npm run build:ts && npm run build:bundle:release",
|
"build:release": "npm run build:ts && npm run build:bundle:release",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"lint": "tslint --project tsconfig.json --type-check $(git ls-files | grep -E \"\\.ts$\")",
|
"lint": "tslint --project tsconfig.json --type-check",
|
||||||
"watch": "guard --watchdir main renderer typings",
|
"watch": "guard --watchdir main renderer typings",
|
||||||
"debug": "NODE_ENV=development electron .",
|
"debug": "NODE_ENV=development electron .",
|
||||||
"start": "NODE_ENV=production electron .",
|
"start": "NODE_ENV=production electron .",
|
||||||
@ -38,14 +38,14 @@
|
|||||||
"homepage": "https://github.com/rhysd/Mstdn#readme",
|
"homepage": "https://github.com/rhysd/Mstdn#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/electron-window-state": "^2.0.29",
|
"@types/electron-window-state": "^2.0.29",
|
||||||
"@types/loglevel": "^1.4.29",
|
"@types/loglevel": "^1.4.30",
|
||||||
"@types/mousetrap": "^1.5.34",
|
"@types/mousetrap": "^1.5.34",
|
||||||
"@types/node": "^8.0.0",
|
"@types/node": "^8.0.26",
|
||||||
"browserify": "^14.4.0",
|
"browserify": "^14.4.0",
|
||||||
"electron-packager": "^8.7.1",
|
"electron-packager": "^9.0.0",
|
||||||
"npm-run-all": "^4.0.2",
|
"npm-run-all": "^4.1.1",
|
||||||
"tslint": "^5.4.3",
|
"tslint": "^5.7.0",
|
||||||
"typescript": "^2.3.4"
|
"typescript": "^2.4.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron": "^1.7.5",
|
"electron": "^1.7.5",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as path from 'path';
|
import {join} from 'path';
|
||||||
import {remote} from 'electron';
|
import {remote} from 'electron';
|
||||||
import * as Mousetrap from 'mousetrap';
|
import * as Mousetrap from 'mousetrap';
|
||||||
import * as Ipc from './ipc';
|
import * as Ipc from './ipc';
|
||||||
@ -71,7 +71,7 @@ export default function setupKeymaps(
|
|||||||
log.info('Loading external script is limited because Chromium sandbox is enabled. Disable shortcut:', action);
|
log.info('Loading external script is limited because Chromium sandbox is enabled. Disable shortcut:', action);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const script = path.join(dataDir, action);
|
const script = join(dataDir, action);
|
||||||
|
|
||||||
let plugin: (c: Config, a: Account) => void;
|
let plugin: (c: Config, a: Account) => void;
|
||||||
try {
|
try {
|
||||||
|
112
typings/menubar.d.ts
vendored
112
typings/menubar.d.ts
vendored
@ -1,61 +1,61 @@
|
|||||||
declare namespace Menubar {
|
declare namespace Menubar {
|
||||||
type Position
|
type Position
|
||||||
= "trayLeft"
|
= 'trayLeft'
|
||||||
| "trayBottomLeft"
|
| 'trayBottomLeft'
|
||||||
| "trayRight"
|
| 'trayRight'
|
||||||
| "trayBottomRight"
|
| 'trayBottomRight'
|
||||||
| "trayCenter"
|
| 'trayCenter'
|
||||||
| "trayBottomCenter"
|
| 'trayBottomCenter'
|
||||||
| "topLeft"
|
| 'topLeft'
|
||||||
| "topRight"
|
| 'topRight'
|
||||||
| "bottomLeft"
|
| 'bottomLeft'
|
||||||
| "bottomRight"
|
| 'bottomRight'
|
||||||
| "topCenter"
|
| 'topCenter'
|
||||||
| "bottomCenter"
|
| 'bottomCenter'
|
||||||
| "center";
|
| 'center';
|
||||||
type TrayBounds
|
type TrayBounds
|
||||||
= "trayLeft"
|
= 'trayLeft'
|
||||||
| "trayBottomLeft"
|
| 'trayBottomLeft'
|
||||||
| "trayRight"
|
| 'trayRight'
|
||||||
| "trayBottomRight"
|
| 'trayBottomRight'
|
||||||
| "trayCenter"
|
| 'trayCenter'
|
||||||
| "trayBottomCenter";
|
| 'trayBottomCenter';
|
||||||
interface ElectronPositioner {
|
interface ElectronPositioner {
|
||||||
move(pos: Position): void;
|
move(pos: Position): void;
|
||||||
calculate(pos: Position, bounds?: TrayBounds): Electron.Point;
|
calculate(pos: Position, bounds?: TrayBounds): Electron.Point;
|
||||||
}
|
}
|
||||||
class MenubarApp extends NodeJS.EventEmitter {
|
class MenubarApp extends NodeJS.EventEmitter {
|
||||||
app: Electron.App;
|
app: Electron.App;
|
||||||
window: Electron.BrowserWindow;
|
window: Electron.BrowserWindow;
|
||||||
tray: Electron.Tray;
|
tray: Electron.Tray;
|
||||||
positioner: ElectronPositioner;
|
positioner: ElectronPositioner;
|
||||||
|
|
||||||
setOption(opt: string, value: any): void;
|
setOption(opt: string, value: any): void;
|
||||||
getOption(opt: string): any;
|
getOption(opt: string): any;
|
||||||
showWindow(): void;
|
showWindow(): void;
|
||||||
hideWindow(): void;
|
hideWindow(): void;
|
||||||
}
|
}
|
||||||
interface MenubarOptions extends Electron.BrowserWindowConstructorOptions {
|
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;
|
icon?: string;
|
||||||
width?: number;
|
width?: number;
|
||||||
height?: number;
|
height?: number;
|
||||||
show?: boolean;
|
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;
|
autoHideMenuBar?: boolean;
|
||||||
webPreferences?: Electron.WebPreferences;
|
webPreferences?: Electron.WebPreferences;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "menubar" {
|
declare module 'menubar' {
|
||||||
const ctor: (opts?: Menubar.MenubarOptions) => Menubar.MenubarApp;
|
const ctor: (opts?: Menubar.MenubarOptions) => Menubar.MenubarApp;
|
||||||
export = ctor;
|
export = ctor;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user