mirror of
https://github.com/rhysd/Mstdn.git
synced 2025-01-21 20:52:11 +01:00
update dependencies and avoid Electron's official type definitions
This commit is contained in:
parent
150b42bcfb
commit
1a7745345b
@ -115,7 +115,7 @@ export default class Window {
|
|||||||
this.browser.removeAllListeners();
|
this.browser.removeAllListeners();
|
||||||
if (this.menubar) {
|
if (this.menubar) {
|
||||||
// Note:
|
// Note:
|
||||||
// menubar.windowClear() won't be called because all listners were removed
|
// menubar.windowClear() won't be called because all listeners were removed
|
||||||
delete this.menubar.window;
|
delete this.menubar.window;
|
||||||
}
|
}
|
||||||
this.browser.close();
|
this.browser.close();
|
||||||
|
19
package.json
19
package.json
@ -37,22 +37,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/rhysd/Mstdn#readme",
|
"homepage": "https://github.com/rhysd/Mstdn#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/electron": "^1.4.37",
|
"@types/electron": "~1.4.37",
|
||||||
"@types/electron-window-state": "^2.0.28",
|
"@types/electron-window-state": "^2.0.28",
|
||||||
"@types/loglevel": "^1.4.29",
|
"@types/loglevel": "^1.4.29",
|
||||||
"@types/menubar": "^5.1.3",
|
"@types/mousetrap": "^1.5.34",
|
||||||
"@types/mousetrap": "^1.5.33",
|
"@types/node": "^8.0.0",
|
||||||
"@types/node": "^7.0.18",
|
"browserify": "^14.4.0",
|
||||||
"browserify": "^14.3.0",
|
"electron-packager": "^8.7.1",
|
||||||
"electron-packager": "^8.7.0",
|
|
||||||
"npm-run-all": "^4.0.2",
|
"npm-run-all": "^4.0.2",
|
||||||
"tslint": "^5.2.0",
|
"tslint": "^5.4.3",
|
||||||
"typescript": "^2.3.2"
|
"typescript": "^2.3.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron": "^1.6.8-beta",
|
"electron": "1.6.8",
|
||||||
"electron-window-state": "^4.1.1",
|
"electron-window-state": "^4.1.1",
|
||||||
"electron-context-menu": "^0.9.0",
|
"electron-context-menu": "^0.9.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"
|
||||||
|
55
typings/menubar.d.ts
vendored
Normal file
55
typings/menubar.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
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.BrowserWindowOptions {
|
||||||
|
dir?: string;
|
||||||
|
index?: string;
|
||||||
|
tooltip?: string;
|
||||||
|
tray?: Electron.Tray;
|
||||||
|
preloadWindow?: boolean;
|
||||||
|
alwaysOnTop?: boolean;
|
||||||
|
showOnAllWorkspaces?: boolean;
|
||||||
|
windowPosition?: Position;
|
||||||
|
showDockIcon?: boolean;
|
||||||
|
showOnRightClick?: boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "menubar" {
|
||||||
|
const ctor: (opts?: Menubar.MenubarOptions) => Menubar.MenubarApp;
|
||||||
|
export = ctor;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user