mirror of
https://github.com/rhysd/Mstdn.git
synced 2025-02-27 05:54:15 +01:00
improve type definitions
This commit is contained in:
parent
496cacb8c8
commit
f96d3fdcab
@ -39,6 +39,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/electron-window-state": "^2.0.29",
|
"@types/electron-window-state": "^2.0.29",
|
||||||
"@types/loglevel": "^1.4.30",
|
"@types/loglevel": "^1.4.30",
|
||||||
|
"@types/menubar": "^5.1.4",
|
||||||
"@types/mousetrap": "^1.5.34",
|
"@types/mousetrap": "^1.5.34",
|
||||||
"@types/node": "^8.0.26",
|
"@types/node": "^8.0.26",
|
||||||
"browserify": "^14.4.0",
|
"browserify": "^14.4.0",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"noEmitOnError": true,
|
"noEmitOnError": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"target": "es2015",
|
"target": "es2016",
|
||||||
"sourceMap": true
|
"sourceMap": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
12
typings/electron-context-menu.d.ts
vendored
12
typings/electron-context-menu.d.ts
vendored
@ -3,12 +3,12 @@ declare namespace ElectronContextMenu {
|
|||||||
window?: Electron.BrowserWindow | Electron.WebviewTag;
|
window?: Electron.BrowserWindow | Electron.WebviewTag;
|
||||||
showInspectElement?: boolean;
|
showInspectElement?: boolean;
|
||||||
labels?: {
|
labels?: {
|
||||||
cut: string;
|
cut?: string;
|
||||||
copy: string;
|
copy?: string;
|
||||||
paste: string;
|
paste?: string;
|
||||||
save: string;
|
save?: string;
|
||||||
copyLink: string;
|
copyLink?: string;
|
||||||
inspect: string;
|
inspect?: string;
|
||||||
};
|
};
|
||||||
append?(...args: any[]): any;
|
append?(...args: any[]): any;
|
||||||
prepend?(params: any, win: Electron.BrowserWindow): Electron.MenuItem[];
|
prepend?(params: any, win: Electron.BrowserWindow): Electron.MenuItem[];
|
||||||
|
61
typings/menubar.d.ts
vendored
61
typings/menubar.d.ts
vendored
@ -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;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user