-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
12,504 additions
and
15,601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,72 @@ | ||
declare namespace Menu { | ||
/** | ||
* Import Electron types | ||
*/ | ||
type _MenuItemConstructorOptions = import('electron').MenuItemConstructorOptions; | ||
type _MenuItem = import('electron').MenuItem; | ||
type _BrowserWindow = import('electron').BrowserWindow; | ||
/** | ||
* Import Electron types | ||
*/ | ||
type _MenuItemConstructorOptions = import("electron").MenuItemConstructorOptions; | ||
type _MenuItem = import("electron").MenuItem; | ||
type _BrowserWindow = import("electron").BrowserWindow; | ||
|
||
/** | ||
* Public types | ||
*/ | ||
type NativeClick = (item: _MenuItem, window: _BrowserWindow, event: Event) => void; | ||
type CutsomClick = (item: _MenuItemConstructorOptions, window: _BrowserWindow, event: Event) => void; | ||
/** | ||
* Public types | ||
*/ | ||
type NativeClick = (item: _MenuItem, window: _BrowserWindow, event: Event) => void; | ||
type CutsomClick = (item: _MenuItemConstructorOptions, window: _BrowserWindow, event: Event) => void; | ||
|
||
type Params = ParamsId | ParamsAction | ParamsCommand; | ||
type MenuItem = Items.MenuName & Items.PluginItem & Items.Separator & Items.Submenu & Items.Menu & Items.StringKey; | ||
type Params = ParamsId | ParamsAction | ParamsCommand; | ||
type MenuItem = Items.MenuName & (Items.PluginItem | Items.Separator | Items.Submenu | Items.Menu | Items.StringKey); | ||
|
||
type MenuAction = { | ||
type: string; | ||
}; | ||
type MenuAction = { | ||
type: string; | ||
}; | ||
|
||
type PluginMenuItem = PluginMenuItemOptions & _MenuItemConstructorOptions; | ||
type PluginMenuItem = PluginMenuItemOptions & _MenuItemConstructorOptions; | ||
|
||
namespace Items { | ||
interface MenuName { | ||
type: string; | ||
key: string; | ||
string: string; | ||
plugin: string; | ||
} | ||
|
||
interface Separator { | ||
type: 'separator'; | ||
} | ||
interface Submenu { | ||
type: 'submenu' | ||
name: string; | ||
submenu: [MenuName & Separator & Submenu & Menu & PluginItem & StringKey]; | ||
} | ||
interface Menu { | ||
disabled?: boolean; | ||
type: 'run-menu-action'; | ||
menuAction: MenuAction; | ||
name: MenuName | ||
} | ||
interface PluginItem { | ||
type: 'plugin-name'; | ||
plugin: string; | ||
} | ||
interface StringKey { | ||
type: 'string-key'; | ||
string: string; | ||
} | ||
namespace Items { | ||
interface MenuName { | ||
type: string; | ||
key: string; | ||
string: string; | ||
plugin: string; | ||
} | ||
|
||
interface PluginMenuItemOptions { | ||
pluginMenuAction?: MenuAction; | ||
interface Separator { | ||
type: "separator"; | ||
} | ||
|
||
interface ParamsId { | ||
id: string; | ||
click?: NativeClick | CutsomClick | ||
interface Submenu { | ||
type: "submenu"; | ||
name: string; | ||
submenu: [MenuName & Separator & Submenu & Menu & PluginItem & StringKey]; | ||
} | ||
interface Menu { | ||
disabled?: boolean; | ||
type: "run-menu-action"; | ||
menuAction: MenuAction; | ||
name: MenuName; | ||
} | ||
interface ParamsAction { | ||
action: string; | ||
click?: NativeClick | CutsomClick | ||
interface PluginItem { | ||
type: "plugin-name"; | ||
plugin: string; | ||
} | ||
interface ParamsCommand { | ||
command: string; | ||
click?: NativeClick | CutsomClick | ||
interface StringKey { | ||
type: "string-key"; | ||
string: string; | ||
} | ||
} | ||
} | ||
|
||
interface PluginMenuItemOptions { | ||
pluginMenuAction?: MenuAction; | ||
} | ||
|
||
interface ParamsId { | ||
id: string; | ||
click?: NativeClick | CutsomClick; | ||
} | ||
interface ParamsAction { | ||
action: string; | ||
click?: NativeClick | CutsomClick; | ||
} | ||
interface ParamsCommand { | ||
command: string; | ||
click?: NativeClick | CutsomClick; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.