1
0
mirror of https://github.com/rhysd/Mstdn.git synced 2024-11-28 20:24:10 +01:00

improve type definitions

This commit is contained in:
rhysd 2017-08-30 16:15:13 +09:00
parent 496cacb8c8
commit f96d3fdcab
4 changed files with 8 additions and 68 deletions

View File

@ -39,6 +39,7 @@
"devDependencies": {
"@types/electron-window-state": "^2.0.29",
"@types/loglevel": "^1.4.30",
"@types/menubar": "^5.1.4",
"@types/mousetrap": "^1.5.34",
"@types/node": "^8.0.26",
"browserify": "^14.4.0",

View File

@ -11,7 +11,7 @@
"noUnusedParameters": true,
"noEmitOnError": true,
"strictNullChecks": true,
"target": "es2015",
"target": "es2016",
"sourceMap": true
},
"include": [

View File

@ -3,12 +3,12 @@ declare namespace ElectronContextMenu {
window?: Electron.BrowserWindow | Electron.WebviewTag;
showInspectElement?: boolean;
labels?: {
cut: string;
copy: string;
paste: string;
save: string;
copyLink: string;
inspect: string;
cut?: string;
copy?: string;
paste?: string;
save?: string;
copyLink?: string;
inspect?: string;
};
append?(...args: any[]): any;
prepend?(params: any, win: Electron.BrowserWindow): Electron.MenuItem[];

61
typings/menubar.d.ts vendored
View File

@ -1,61 +0,0 @@
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.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;
}
}
declare module 'menubar' {
const ctor: (opts?: Menubar.MenubarOptions) => Menubar.MenubarApp;
export = ctor;
}