mirror of
https://github.com/rhysd/Mstdn.git
synced 2024-11-28 20:24:10 +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,
|
||||
});
|
||||
|
||||
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) {
|
||||
// Insert item before 'Help'
|
||||
menu.insert(menu.items.length - 1, item);
|
||||
|
@ -34,7 +34,9 @@ export default class Window {
|
||||
public browser: Electron.BrowserWindow,
|
||||
public state: any /*XXX: ElectronWindowState.WindowState */,
|
||||
public account: Account,
|
||||
/* tslint:disable:no-shadowed-variable */
|
||||
public menubar: Menubar.MenubarApp | null,
|
||||
/* tslint:enable:no-shadowed-variable */
|
||||
) {
|
||||
if (!IS_DARWIN) {
|
||||
// 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:release": "npm run build:ts && npm run build:bundle:release",
|
||||
"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",
|
||||
"debug": "NODE_ENV=development electron .",
|
||||
"start": "NODE_ENV=production electron .",
|
||||
@ -38,14 +38,14 @@
|
||||
"homepage": "https://github.com/rhysd/Mstdn#readme",
|
||||
"devDependencies": {
|
||||
"@types/electron-window-state": "^2.0.29",
|
||||
"@types/loglevel": "^1.4.29",
|
||||
"@types/loglevel": "^1.4.30",
|
||||
"@types/mousetrap": "^1.5.34",
|
||||
"@types/node": "^8.0.0",
|
||||
"@types/node": "^8.0.26",
|
||||
"browserify": "^14.4.0",
|
||||
"electron-packager": "^8.7.1",
|
||||
"npm-run-all": "^4.0.2",
|
||||
"tslint": "^5.4.3",
|
||||
"typescript": "^2.3.4"
|
||||
"electron-packager": "^9.0.0",
|
||||
"npm-run-all": "^4.1.1",
|
||||
"tslint": "^5.7.0",
|
||||
"typescript": "^2.4.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"electron": "^1.7.5",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as path from 'path';
|
||||
import {join} from 'path';
|
||||
import {remote} from 'electron';
|
||||
import * as Mousetrap from 'mousetrap';
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
const script = path.join(dataDir, action);
|
||||
const script = join(dataDir, action);
|
||||
|
||||
let plugin: (c: Config, a: Account) => void;
|
||||
try {
|
||||
|
40
typings/menubar.d.ts
vendored
40
typings/menubar.d.ts
vendored
@ -1,25 +1,25 @@
|
||||
declare namespace Menubar {
|
||||
type Position
|
||||
= "trayLeft"
|
||||
| "trayBottomLeft"
|
||||
| "trayRight"
|
||||
| "trayBottomRight"
|
||||
| "trayCenter"
|
||||
| "trayBottomCenter"
|
||||
| "topLeft"
|
||||
| "topRight"
|
||||
| "bottomLeft"
|
||||
| "bottomRight"
|
||||
| "topCenter"
|
||||
| "bottomCenter"
|
||||
| "center";
|
||||
= 'trayLeft'
|
||||
| 'trayBottomLeft'
|
||||
| 'trayRight'
|
||||
| 'trayBottomRight'
|
||||
| 'trayCenter'
|
||||
| 'trayBottomCenter'
|
||||
| 'topLeft'
|
||||
| 'topRight'
|
||||
| 'bottomLeft'
|
||||
| 'bottomRight'
|
||||
| 'topCenter'
|
||||
| 'bottomCenter'
|
||||
| 'center';
|
||||
type TrayBounds
|
||||
= "trayLeft"
|
||||
| "trayBottomLeft"
|
||||
| "trayRight"
|
||||
| "trayBottomRight"
|
||||
| "trayCenter"
|
||||
| "trayBottomCenter";
|
||||
= 'trayLeft'
|
||||
| 'trayBottomLeft'
|
||||
| 'trayRight'
|
||||
| 'trayBottomRight'
|
||||
| 'trayCenter'
|
||||
| 'trayBottomCenter';
|
||||
interface ElectronPositioner {
|
||||
move(pos: Position): void;
|
||||
calculate(pos: Position, bounds?: TrayBounds): Electron.Point;
|
||||
@ -55,7 +55,7 @@ declare namespace Menubar {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "menubar" {
|
||||
declare module 'menubar' {
|
||||
const ctor: (opts?: Menubar.MenubarOptions) => Menubar.MenubarApp;
|
||||
export = ctor;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user