mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Update menu + menu-item modules
This commit is contained in:
+13
-7
@@ -4,15 +4,18 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="github-electron.browser-window.d.ts" />
|
||||
/// <reference path="github-electron.event-emitter.d.ts" />
|
||||
/// <reference path="github-electron.menu-item.d.ts" />
|
||||
|
||||
declare namespace Electron {
|
||||
/**
|
||||
* The Menu class is used to create native menus that can be used as application
|
||||
* menus and context menus. Each menu consists of multiple menu items, and each
|
||||
* menu item can have a submenu.
|
||||
* menus and context menus. This module is a main process module which can be used
|
||||
* in a render process via the remote module.
|
||||
*
|
||||
* Each menu consists of multiple menu items, and each menu item can have a submenu.
|
||||
*/
|
||||
class Menu {
|
||||
class Menu extends EventEmitter {
|
||||
/**
|
||||
* Creates a new menu.
|
||||
*/
|
||||
@@ -23,9 +26,9 @@ declare namespace Electron {
|
||||
*/
|
||||
static setApplicationMenu(menu: Menu): void;
|
||||
/**
|
||||
* Sends the action to the first responder of application, this is used for
|
||||
* emulating default Cocoa menu behaviors, usually you would just use the
|
||||
* selector property of MenuItem.
|
||||
* Sends the action to the first responder of application.
|
||||
* This is used for emulating default Cocoa menu behaviors,
|
||||
* usually you would just use the role property of MenuItem.
|
||||
*
|
||||
* Note: This method is OS X only.
|
||||
*/
|
||||
@@ -43,7 +46,7 @@ declare namespace Electron {
|
||||
* @param x Horizontal coordinate where the menu will be placed.
|
||||
* @param y Vertical coordinate where the menu will be placed.
|
||||
*/
|
||||
popup(browserWindow: BrowserWindow, x?: number, y?: number): void;
|
||||
popup(browserWindow?: BrowserWindow, x?: number, y?: number): void;
|
||||
/**
|
||||
* Appends the menuItem to the menu.
|
||||
*/
|
||||
@@ -52,6 +55,9 @@ declare namespace Electron {
|
||||
* Inserts the menuItem to the pos position of the menu.
|
||||
*/
|
||||
insert(position: number, menuItem: MenuItem): void;
|
||||
/**
|
||||
* @returns an array containing the menu’s items.
|
||||
*/
|
||||
items: MenuItem[];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user