1
0
mirror of https://github.com/rhysd/Mstdn.git synced 2025-02-02 06:52:13 +01:00
Mstdn/typings/menubar.d.ts

56 lines
1.2 KiB
TypeScript

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;
}