menu
Enumerations
NativeIcon
A native Icon to be used for the menu item
Platform-specific:
- Windows / Linux: Unsupported.
Enumeration Members
Add
Add: 'Add';An add item template image.
Source: menu/iconMenuItem.ts:19
Advanced
Advanced: 'Advanced';Advanced preferences toolbar icon for the preferences window.
Source: menu/iconMenuItem.ts:21
Bluetooth
Bluetooth: 'Bluetooth';A Bluetooth template image.
Source: menu/iconMenuItem.ts:23
Bookmarks
Bookmarks: 'Bookmarks';Bookmarks image suitable for a template.
Source: menu/iconMenuItem.ts:25
Caution
Caution: 'Caution';A caution image.
Source: menu/iconMenuItem.ts:27
ColorPanel
ColorPanel: 'ColorPanel';A color panel toolbar icon.
Source: menu/iconMenuItem.ts:29
ColumnView
ColumnView: 'ColumnView';A column view mode template image.
Source: menu/iconMenuItem.ts:31
Computer
Computer: 'Computer';A computer icon.
Source: menu/iconMenuItem.ts:33
EnterFullScreen
EnterFullScreen: 'EnterFullScreen';An enter full-screen mode template image.
Source: menu/iconMenuItem.ts:35
Everyone
Everyone: 'Everyone';Permissions for all users.
Source: menu/iconMenuItem.ts:37
ExitFullScreen
ExitFullScreen: 'ExitFullScreen';An exit full-screen mode template image.
Source: menu/iconMenuItem.ts:39
FlowView
FlowView: 'FlowView';A cover flow view mode template image.
Source: menu/iconMenuItem.ts:41
Folder
Folder: 'Folder';A folder image.
Source: menu/iconMenuItem.ts:43
FolderBurnable
FolderBurnable: 'FolderBurnable';A burnable folder icon.
Source: menu/iconMenuItem.ts:45
FolderSmart
FolderSmart: 'FolderSmart';A smart folder icon.
Source: menu/iconMenuItem.ts:47
FollowLinkFreestanding
FollowLinkFreestanding: 'FollowLinkFreestanding';A link template image.
Source: menu/iconMenuItem.ts:49
FontPanel
FontPanel: 'FontPanel';A font panel toolbar icon.
Source: menu/iconMenuItem.ts:51
GoLeft
GoLeft: 'GoLeft';A go back template image.
Source: menu/iconMenuItem.ts:53
GoRight
GoRight: 'GoRight';A go forward template image.
Source: menu/iconMenuItem.ts:55
Home
Home: 'Home';Home image suitable for a template.
Source: menu/iconMenuItem.ts:57
IChatTheater
IChatTheater: 'IChatTheater';An iChat Theater template image.
Source: menu/iconMenuItem.ts:59
IconView
IconView: 'IconView';An icon view mode template image.
Source: menu/iconMenuItem.ts:61
Info
Info: 'Info';An information toolbar icon.
Source: menu/iconMenuItem.ts:63
InvalidDataFreestanding
InvalidDataFreestanding: 'InvalidDataFreestanding';A template image used to denote invalid data.
Source: menu/iconMenuItem.ts:65
LeftFacingTriangle
LeftFacingTriangle: 'LeftFacingTriangle';A generic left-facing triangle template image.
Source: menu/iconMenuItem.ts:67
ListView
ListView: 'ListView';A list view mode template image.
Source: menu/iconMenuItem.ts:69
LockLocked
LockLocked: 'LockLocked';A locked padlock template image.
Source: menu/iconMenuItem.ts:71
LockUnlocked
LockUnlocked: 'LockUnlocked';An unlocked padlock template image.
Source: menu/iconMenuItem.ts:73
MenuMixedState
MenuMixedState: 'MenuMixedState';A horizontal dash, for use in menus.
Source: menu/iconMenuItem.ts:75
MenuOnState
MenuOnState: 'MenuOnState';A check mark template image, for use in menus.
Source: menu/iconMenuItem.ts:77
MobileMe
MobileMe: 'MobileMe';A MobileMe icon.
Source: menu/iconMenuItem.ts:79
MultipleDocuments
MultipleDocuments: 'MultipleDocuments';A drag image for multiple items.
Source: menu/iconMenuItem.ts:81
Network
Network: 'Network';A network icon.
Source: menu/iconMenuItem.ts:83
Path
Path: 'Path';A path button template image.
Source: menu/iconMenuItem.ts:85
PreferencesGeneral
PreferencesGeneral: 'PreferencesGeneral';General preferences toolbar icon for the preferences window.
Source: menu/iconMenuItem.ts:87
QuickLook
QuickLook: 'QuickLook';A Quick Look template image.
Source: menu/iconMenuItem.ts:89
Refresh
Refresh: 'Refresh';A refresh template image.
Source: menu/iconMenuItem.ts:93
RefreshFreestanding
RefreshFreestanding: 'RefreshFreestanding';A refresh template image.
Source: menu/iconMenuItem.ts:91
Remove
Remove: 'Remove';A remove item template image.
Source: menu/iconMenuItem.ts:95
RevealFreestanding
RevealFreestanding: 'RevealFreestanding';A reveal contents template image.
Source: menu/iconMenuItem.ts:97
RightFacingTriangle
RightFacingTriangle: 'RightFacingTriangle';A generic right-facing triangle template image.
Source: menu/iconMenuItem.ts:99
Share
Share: 'Share';A share view template image.
Source: menu/iconMenuItem.ts:101
Slideshow
Slideshow: 'Slideshow';A slideshow template image.
Source: menu/iconMenuItem.ts:103
SmartBadge
SmartBadge: 'SmartBadge';A badge for a smart item.
Source: menu/iconMenuItem.ts:105
StatusAvailable
StatusAvailable: 'StatusAvailable';Small green indicator, similar to iChat’s available image.
Source: menu/iconMenuItem.ts:107
StatusNone
StatusNone: 'StatusNone';Small clear indicator.
Source: menu/iconMenuItem.ts:109
StatusPartiallyAvailable
StatusPartiallyAvailable: 'StatusPartiallyAvailable';Small yellow indicator, similar to iChat’s idle image.
Source: menu/iconMenuItem.ts:111
StatusUnavailable
StatusUnavailable: 'StatusUnavailable';Small red indicator, similar to iChat’s unavailable image.
Source: menu/iconMenuItem.ts:113
StopProgress
StopProgress: 'StopProgress';A stop progress button template image.
Source: menu/iconMenuItem.ts:117
StopProgressFreestanding
StopProgressFreestanding: 'StopProgressFreestanding';A stop progress template image.
Source: menu/iconMenuItem.ts:115
TrashEmpty
TrashEmpty: 'TrashEmpty';An image of the empty trash can.
Source: menu/iconMenuItem.ts:119
TrashFull
TrashFull: 'TrashFull';An image of the full trash can.
Source: menu/iconMenuItem.ts:121
User
User: 'User';Permissions for a single user.
Source: menu/iconMenuItem.ts:123
UserAccounts
UserAccounts: 'UserAccounts';User account toolbar icon for the preferences window.
Source: menu/iconMenuItem.ts:125
UserGroup
UserGroup: 'UserGroup';Permissions for a group of users.
Source: menu/iconMenuItem.ts:127
UserGuest
UserGuest: 'UserGuest';Permissions for guests.
Source: menu/iconMenuItem.ts:129
Classes
CheckMenuItem
A check menu item inside a Menu or Submenu
and usually contains a text and a check mark or a similar toggle
that corresponds to a checked and unchecked states.
Extends
MenuItemBase
Properties
| Property | Type |
|---|---|
private readonly #rid | number |
Accessors
id
get id(): stringSource: menu/base.ts:108
Inherited from
MenuItemBase.id
rid
get rid(): numberSource: core.ts:222
Inherited from
MenuItemBase.rid
Methods
close()
close(): Promise< void >Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Promise< void >
Inherited from
MenuItemBase.close
Source: core.ts:234
isChecked()
isChecked(): Promise< boolean >Returns whether this check menu item is checked or not.
Returns
Promise< boolean >
Source: menu/checkMenuItem.ts:71
isEnabled()
isEnabled(): Promise< boolean >Returns whether this check menu item is enabled or not.
Returns
Promise< boolean >
Source: menu/checkMenuItem.ts:48
setAccelerator()
setAccelerator(accelerator): Promise< void >Sets the accelerator for this check menu item.
Parameters
| Parameter | Type |
|---|---|
accelerator | null | string |
Returns
Promise< void >
Source: menu/checkMenuItem.ts:62
setChecked()
setChecked(checked): Promise< void >Sets whether this check menu item is checked or not.
Parameters
| Parameter | Type |
|---|---|
checked | boolean |
Returns
Promise< void >
Source: menu/checkMenuItem.ts:76
setEnabled()
setEnabled(enabled): Promise< void >Sets whether this check menu item is enabled or not.
Parameters
| Parameter | Type |
|---|---|
enabled | boolean |
Returns
Promise< void >
Source: menu/checkMenuItem.ts:53
setText()
setText(text): Promise< void >Sets the text for this check menu item.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
Promise< void >
Source: menu/checkMenuItem.ts:39
text()
text(): Promise< string >Returns the text of this check menu item.
Returns
Promise< string >
Source: menu/checkMenuItem.ts:34
new()
static new(opts): Promise< CheckMenuItem >Create a new check menu item.
Parameters
| Parameter | Type |
|---|---|
opts | CheckMenuItemOptions |
Returns
Source: menu/checkMenuItem.ts:27
IconMenuItem
An icon menu item inside a Menu or Submenu
and usually contains an icon and a text.
Extends
MenuItemBase
Properties
| Property | Type |
|---|---|
private readonly #rid | number |
Accessors
id
get id(): stringSource: menu/base.ts:108
Inherited from
MenuItemBase.id
rid
get rid(): numberSource: core.ts:222
Inherited from
MenuItemBase.rid
Methods
close()
close(): Promise< void >Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Promise< void >
Inherited from
MenuItemBase.close
Source: core.ts:234
isEnabled()
isEnabled(): Promise< boolean >Returns whether this icon menu item is enabled or not.
Returns
Promise< boolean >
Source: menu/iconMenuItem.ts:170
setAccelerator()
setAccelerator(accelerator): Promise< void >Sets the accelerator for this icon menu item.
Parameters
| Parameter | Type |
|---|---|
accelerator | null | string |
Returns
Promise< void >
Source: menu/iconMenuItem.ts:184
setEnabled()
setEnabled(enabled): Promise< void >Sets whether this icon menu item is enabled or not.
Parameters
| Parameter | Type |
|---|---|
enabled | boolean |
Returns
Promise< void >
Source: menu/iconMenuItem.ts:175
setIcon()
setIcon(icon): Promise< void >Sets an icon for this icon menu item
Parameters
| Parameter | Type |
|---|---|
icon | null | string | number[] | ArrayBuffer | Uint8Array | Image |
Returns
Promise< void >
Source: menu/iconMenuItem.ts:193
setText()
setText(text): Promise< void >Sets the text for this icon menu item.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
Promise< void >
Source: menu/iconMenuItem.ts:161
text()
text(): Promise< string >Returns the text of this icon menu item.
Returns
Promise< string >
Source: menu/iconMenuItem.ts:156
new()
static new(opts): Promise< IconMenuItem >Create a new icon menu item.
Parameters
| Parameter | Type |
|---|---|
opts | IconMenuItemOptions |
Returns
Source: menu/iconMenuItem.ts:151
Menu
A type that is either a menu bar on the window on Windows and Linux or as a global menu in the menubar on macOS.
Extends
MenuItemBase
Properties
| Property | Type |
|---|---|
private readonly #rid | number |
Accessors
id
get id(): stringSource: menu/base.ts:108
Inherited from
MenuItemBase.id
rid
get rid(): numberSource: core.ts:222
Inherited from
MenuItemBase.rid
Methods
append()
append<T>(items): Promise< void >Add a menu item to the end of this menu.
Platform-spcific:
Type parameters
| Parameter |
|---|
T extends CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
| Parameter | Type |
|---|---|
items | T | T[] |
Returns
Promise< void >
Source: menu/menu.ts:97
close()
close(): Promise< void >Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Promise< void >
Inherited from
MenuItemBase.close
Source: core.ts:234
get()
get(id): Promise< null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem >Retrieves the menu item matching the given identifier.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise< null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem >
Source: menu/menu.ts:220
insert()
insert<T>(items, position): Promise< void >Add a menu item to the specified position in this menu.
Platform-spcific:
Type parameters
| Parameter |
|---|
T extends CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
| Parameter | Type |
|---|---|
items | T | T[] |
position | number |
Returns
Promise< void >
Source: menu/menu.ts:155
items()
items(): Promise< (CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem)[] >Returns a list of menu items that has been added to this menu.
Returns
Promise< (CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem)[] >
Source: menu/menu.ts:208
popup()
popup(at?, window?): Promise< void >Popup this menu as a context menu on the specified window.
If the position, is provided, it is relative to the window’s top-left corner.
Parameters
| Parameter | Type |
|---|---|
at? | LogicalPosition | PhysicalPosition |
window? | Window |
Returns
Promise< void >
Source: menu/menu.ts:242
prepend()
prepend<T>(items): Promise< void >Add a menu item to the beginning of this menu.
Platform-spcific:
Type parameters
| Parameter |
|---|
T extends CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
| Parameter | Type |
|---|---|
items | T | T[] |
Returns
Promise< void >
Source: menu/menu.ts:126
remove()
remove(item): Promise< void >Remove a menu item from this menu.
Parameters
| Parameter | Type |
|---|---|
item | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem |
Returns
Promise< void >
Source: menu/menu.ts:179
removeAt()
removeAt(position): Promise< null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem >Remove a menu item from this menu at the specified position.
Parameters
| Parameter | Type |
|---|---|
position | number |
Returns
Promise< null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem >
Source: menu/menu.ts:190
setAsAppMenu()
setAsAppMenu(): Promise< null | Menu >Sets the app-wide menu and returns the previous one.
If a window was not created with an explicit menu or had one set explicitly, this menu will be assigned to it.
Returns
Source: menu/menu.ts:268
setAsWindowMenu()
setAsWindowMenu(window?): Promise< null | Menu >Sets the window menu and returns the previous one.
Platform-specific:
- macOS: Unsupported. The menu on macOS is app-wide and not specific to one
window, if you need to set it, use
Menu.setAsAppMenuinstead.
Parameters
| Parameter | Type |
|---|---|
window? | Window |
Returns
Source: menu/menu.ts:282
default()
static default(): Promise< Menu >Create a default menu.
Returns
Source: menu/menu.ts:84
new()
static new(opts?): Promise< Menu >Create a new menu.
Parameters
| Parameter | Type |
|---|---|
opts? | MenuOptions |
Returns
Source: menu/menu.ts:79
MenuItem
A menu item inside a Menu or Submenu and contains only text.
Extends
MenuItemBase
Properties
| Property | Type |
|---|---|
private readonly #rid | number |
Accessors
id
get id(): stringSource: menu/base.ts:108
Inherited from
MenuItemBase.id
rid
get rid(): numberSource: core.ts:222
Inherited from
MenuItemBase.rid
Methods
close()
close(): Promise< void >Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Promise< void >
Inherited from
MenuItemBase.close
Source: core.ts:234
isEnabled()
isEnabled(): Promise< boolean >Returns whether this menu item is enabled or not.
Returns
Promise< boolean >
Source: menu/menuItem.ts:49
setAccelerator()
setAccelerator(accelerator): Promise< void >Sets the accelerator for this menu item.
Parameters
| Parameter | Type |
|---|---|
accelerator | null | string |
Returns
Promise< void >
Source: menu/menuItem.ts:63
setEnabled()
setEnabled(enabled): Promise< void >Sets whether this menu item is enabled or not.
Parameters
| Parameter | Type |
|---|---|
enabled | boolean |
Returns
Promise< void >
Source: menu/menuItem.ts:54
setText()
setText(text): Promise< void >Sets the text for this menu item.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
Promise< void >
Source: menu/menuItem.ts:40
text()
text(): Promise< string >Returns the text of this menu item.
Returns
Promise< string >
Source: menu/menuItem.ts:35
new()
static new(opts): Promise< MenuItem >Create a new menu item.
Parameters
| Parameter | Type |
|---|---|
opts | MenuItemOptions |
Returns
Source: menu/menuItem.ts:30
PredefinedMenuItem
A predefined (native) menu item which has a predefined behavior by the OS or by tauri.
Extends
MenuItemBase
Properties
| Property | Type |
|---|---|
private readonly #rid | number |
Accessors
id
get id(): stringSource: menu/base.ts:108
Inherited from
MenuItemBase.id
rid
get rid(): numberSource: core.ts:222
Inherited from
MenuItemBase.rid
Methods
close()
close(): Promise< void >Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Promise< void >
Inherited from
MenuItemBase.close
Source: core.ts:234
setText()
setText(text): Promise< void >Sets the text for this predefined menu item.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
Promise< void >
Source: menu/predefinedMenuItem.ts:132
text()
text(): Promise< string >Returns the text of this predefined menu item.
Returns
Promise< string >
Source: menu/predefinedMenuItem.ts:127
new()
static new(opts?): Promise< PredefinedMenuItem >Create a new predefined menu item.
Parameters
| Parameter | Type |
|---|---|
opts? | PredefinedMenuItemOptions |
Returns
Source: menu/predefinedMenuItem.ts:118
Submenu
A type that is a submenu inside a Menu or Submenu.
Extends
MenuItemBase
Properties
| Property | Type |
|---|---|
private readonly #rid | number |
Accessors
id
get id(): stringSource: menu/base.ts:108
Inherited from
MenuItemBase.id
rid
get rid(): numberSource: core.ts:222
Inherited from
MenuItemBase.rid
Methods
append()
append<T>(items): Promise< void >Add a menu item to the end of this submenu.
Platform-spcific:
Type parameters
| Parameter |
|---|
T extends CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
| Parameter | Type |
|---|---|
items | T | T[] |
Returns
Promise< void >
Source: menu/submenu.ts:97
close()
close(): Promise< void >Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Returns
Promise< void >
Inherited from
MenuItemBase.close
Source: core.ts:234
get()
get(id): Promise< null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem >Retrieves the menu item matching the given identifier.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise< null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem >
Source: menu/submenu.ts:220
insert()
insert<T>(items, position): Promise< void >Add a menu item to the specified position in this submenu.
Platform-spcific:
Type parameters
| Parameter |
|---|
T extends CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
| Parameter | Type |
|---|---|
items | T | T[] |
position | number |
Returns
Promise< void >
Source: menu/submenu.ts:155
isEnabled()
isEnabled(): Promise< boolean >Returns whether this submenu is enabled or not.
Returns
Promise< boolean >
Source: menu/submenu.ts:77
items()
items(): Promise< (CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem)[] >Returns a list of menu items that has been added to this submenu.
Returns
Promise< (CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem)[] >
Source: menu/submenu.ts:208
popup()
popup(at?, window?): Promise< void >Popup this submenu as a context menu on the specified window.
If the position, is provided, it is relative to the window’s top-left corner.
Parameters
| Parameter | Type |
|---|---|
at? | LogicalPosition | PhysicalPosition |
window? | Window |
Returns
Promise< void >
Source: menu/submenu.ts:242
prepend()
prepend<T>(items): Promise< void >Add a menu item to the beginning of this submenu.
Platform-spcific:
Type parameters
| Parameter |
|---|
T extends CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem |
Parameters
| Parameter | Type |
|---|---|
items | T | T[] |
Returns
Promise< void >
Source: menu/submenu.ts:126
remove()
remove(item): Promise< void >Remove a menu item from this submenu.
Parameters
| Parameter | Type |
|---|---|
item | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem |
Returns
Promise< void >
Source: menu/submenu.ts:179
removeAt()
removeAt(position): Promise< null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem >Remove a menu item from this submenu at the specified position.
Parameters
| Parameter | Type |
|---|---|
position | number |
Returns
Promise< null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem >
Source: menu/submenu.ts:190
setAsHelpMenuForNSApp()
setAsHelpMenuForNSApp(): Promise< void >Set this submenu as the Help menu for the application on macOS.
This will cause macOS to automatically add a search box to the menu.
If no menu is set as the Help menu, macOS will automatically use any menu which has a title matching the localized word “Help”.
Platform-specific:
- Windows / Linux: Unsupported.
Returns
Promise< void >
Source: menu/submenu.ts:290
setAsWindowsMenuForNSApp()
setAsWindowsMenuForNSApp(): Promise< void >Set this submenu as the Window menu for the application on macOS.
This will cause macOS to automatically add window-switching items and certain other items to the menu.
Platform-specific:
- Windows / Linux: Unsupported.
Returns
Promise< void >
Source: menu/submenu.ts:272
setEnabled()
setEnabled(enabled): Promise< void >Sets whether this submenu is enabled or not.
Parameters
| Parameter | Type |
|---|---|
enabled | boolean |
Returns
Promise< void >
Source: menu/submenu.ts:82
setText()
setText(text): Promise< void >Sets the text for this submenu.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
Promise< void >
Source: menu/submenu.ts:68
text()
text(): Promise< string >Returns the text of this submenu.
Returns
Promise< string >
Source: menu/submenu.ts:63
new()
static new(opts): Promise< Submenu >Create a new submenu.
Parameters
| Parameter | Type |
|---|---|
opts | SubmenuOptions |
Returns
Source: menu/submenu.ts:58
Interfaces
AboutMetadata
A metadata for the about predefined menu item.
Properties
| Property | Type | Description |
|---|---|---|
authors? | string[] | The authors of the application. #### Platform-specific - macOS: Unsupported. |
comments? | string | Application comments. #### Platform-specific - macOS: Unsupported. |
copyright? | string | The copyright of the application. |
credits? | string | The credits. #### Platform-specific - Windows / Linux: Unsupported. |
icon? | string | number[] | ArrayBuffer | Uint8Array | Image | The application icon. #### Platform-specific - Windows: Unsupported. |
license? | string | The license of the application. #### Platform-specific - macOS: Unsupported. |
name? | string | Sets the application name. |
shortVersion? | string | The short version, e.g. “1.0”. #### Platform-specific - Windows / Linux: Appended to the end of version in parentheses. |
version? | string | The application version. |
website? | string | The application website. #### Platform-specific - macOS: Unsupported. |
websiteLabel? | string | The website label. #### Platform-specific - macOS: Unsupported. |
CheckMenuItemOptions
Options for creating a new check menu item.
Extends
Properties
IconMenuItemOptions
Options for creating a new icon menu item.
Extends
Properties
| Property | Type | Description |
|---|---|---|
accelerator? | string | Specify an accelerator for the new menu item. |
action? | (id) => void | Specify a handler to be called when this menu item is activated. |
enabled? | boolean | Whether the new menu item is enabled or not. |
icon? | string | number[] | ArrayBuffer | Uint8Array | Image | Icon to be used for the new icon menu item. |
id? | string | Specify an id to use for the new menu item. |
text | string | The text of the new menu item. |
MenuItemOptions
Options for creating a new menu item.
Extended By
Properties
MenuOptions
Options for creating a new menu.
Properties
| Property | Type | Description |
|---|---|---|
id? | string | Specify an id to use for the new menu. |
items? | (CheckMenuItemOptions | MenuItemOptions | CheckMenuItem | IconMenuItemOptions | IconMenuItem | PredefinedMenuItemOptions | PredefinedMenuItem | SubmenuOptions | Submenu | MenuItem)[] | List of items to add to the new menu. |
PredefinedMenuItemOptions
Options for creating a new predefined menu item.
Properties
| Property | Type | Description |
|---|---|---|
item | {About: null | AboutMetadata;} | "Separator" | "Copy" | "Cut" | "Paste" | "SelectAll" | "Undo" | "Redo" | "Minimize" | "Maximize" | "Fullscreen" | "Hide" | "HideOthers" | "ShowAll" | "CloseWindow" | "Quit" | "Services" | The predefined item type |
text? | string | The text of the new predefined menu item. |
Type Aliases
SubmenuOptions
SubmenuOptions: Omit<MenuItemOptions, 'accelerator' | 'action'> & MenuOptions;Source: menu/submenu.ts:47
© 2024 Tauri Contributors. CC-BY / MIT