docs: add type reference links in Menu and MenuItem API documentation (#49525)

* docs: add type reference links in Menu and MenuItem API documentation

Co-authored-by: Sourav Bera <sbera987654321@gmail.com>

* docs: revert type links in Menu return types to fix parser

Co-authored-by: Sourav Bera <sbera987654321@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Sourav Bera <sbera987654321@gmail.com>
This commit is contained in:
trop[bot]
2026-01-26 14:28:04 +01:00
committed by GitHub
parent 1b7073ad6a
commit db6b22a8e5
2 changed files with 6 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ See [`Menu`](menu.md) for examples.
* `options` Object
* `click` Function (optional) - Will be called with
`click(menuItem, window, event)` when the menu item is clicked.
* `menuItem` MenuItem
* `menuItem` [MenuItem](menu-item.md)
* `window` [BaseWindow](base-window.md) | undefined - This will not be defined if no window is open.
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `role` string (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `toggleSpellChecker`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `showSubstitutions`, `toggleSmartQuotes`, `toggleSmartDashes`, `toggleTextReplacement`, `startSpeaking`, `stopSpeaking`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `shareMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `showAllTabs`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
@@ -91,7 +91,7 @@ It can be called with `menuItem.click(event, focusedWindow, focusedWebContents)`
#### `menuItem.submenu`
A `Menu` (optional) containing the menu
A [`Menu`](menu.md) (optional) containing the menu
item's submenu, if present.
#### `menuItem.type`
@@ -171,4 +171,4 @@ A `number` indicating an item's sequential unique id.
#### `menuItem.menu`
A `Menu` that the item is a part of.
A [`Menu`](menu.md) that the item is a part of.

View File

@@ -23,7 +23,7 @@ The `Menu` class has the following static methods:
#### `Menu.setApplicationMenu(menu)`
- `menu` Menu | null
- `menu` [Menu](menu.md) | null
Sets `menu` as the application menu on macOS. On Windows and Linux, the
`menu` will be set as each window's top menu.
@@ -65,9 +65,9 @@ for more information on macOS' native actions.
#### `Menu.buildFromTemplate(template)`
- `template` (MenuItemConstructorOptions | MenuItem)[]
- `template` (MenuItemConstructorOptions | [MenuItem](menu-item.md))[]
Returns `Menu`
Returns [`Menu`](menu.md)
Generally, the `template` is an array of `options` for constructing a
[MenuItem](menu-item.md). The usage can be referenced above.