ObsidianIpcMenuItemTemplate
Unofficial
One item of the application menu template Obsidian’s set-menu IPC channel takes.
Import:
import type { ObsidianIpcMenuItemTemplate } from '@obsidian-typings/obsidian-public-latest';Signature:
export interface ObsidianIpcMenuItemTemplate extends ElectronMenuItemConstructorOptionsExtends: ElectronMenuItemConstructorOptions
Properties
| Property | Type | Description | |
|---|---|---|---|
| accelerator? | ElectronAccelerator | The item's accelerator. (Inherited from ElectronMenuItemConstructorOptions) | |
| acceleratorWorksWhenHidden? | boolean | When false, prevents the accelerator from triggering the item if the item is not visible. darwin only.(Inherited from ElectronMenuItemConstructorOptions) | |
| after? | string[] | Inserts this item after the item with the specified label. If the referenced item doesn't exist the item will be inserted at the end of the menu. (Inherited from ElectronMenuItemConstructorOptions) | |
| afterGroupContaining? | string[] | Declares the placement of this item's containing group after the containing group of the item with the specified label. (Inherited from ElectronMenuItemConstructorOptions) | |
| appCommand? | string | The id of an Obsidian command. The main process makes it the item's id and runs the command in the focused vault window when the item is clicked. | |
| before? | string[] | Inserts this item before the item with the specified label. If the referenced item doesn't exist the item will be inserted at the end of the menu. Also implies that the item should be placed in the same group as the referenced item. (Inherited from ElectronMenuItemConstructorOptions) | |
| beforeGroupContaining? | string[] | Declares the placement of this item's containing group before the containing group of the item with the specified label. (Inherited from ElectronMenuItemConstructorOptions) | |
| checked? | boolean | Should only be specified for checkbox or radio type menu items.(Inherited from ElectronMenuItemConstructorOptions) | |
| enabled? | boolean | If false, the menu item will be greyed out and unclickable.(Inherited from ElectronMenuItemConstructorOptions) | |
| icon? | ElectronNativeImage | string | The item's icon. (Inherited from ElectronMenuItemConstructorOptions) | |
| id? | string | Unique within a single menu. If defined then it can be used as a reference to this item by the position attribute. (Inherited from ElectronMenuItemConstructorOptions) | |
| label? | string | The item's visible label. (Inherited from ElectronMenuItemConstructorOptions) | |
| registerAccelerator? | boolean | If false, the accelerator won't be registered with the system, but it will still be displayed. linux/win32 only.(Inherited from ElectronMenuItemConstructorOptions) | |
| role? | 'about' | 'appMenu' | 'clearRecentDocuments' | 'close' | 'copy' | 'cut' | 'delete' | 'editMenu' | 'fileMenu' | 'forceReload' | 'front' | 'help' | 'hide' | 'hideOthers' | 'mergeAllWindows' | 'minimize' | 'moveTabToNewWindow' | 'paste' | 'pasteAndMatchStyle' | 'quit' | 'recentDocuments' | 'redo' | 'reload' | 'resetZoom' | 'selectAll' | 'selectNextTab' | 'selectPreviousTab' | 'services' | 'shareMenu' | 'showSubstitutions' | 'startSpeaking' | 'stopSpeaking' | 'toggleDevTools' | 'togglefullscreen' | 'toggleSmartDashes' | 'toggleSmartQuotes' | 'toggleSpellChecker' | 'toggleTabBar' | 'toggleTextReplacement' | 'undo' | 'unhide' | 'viewMenu' | 'window' | 'windowMenu' | 'zoom' | 'zoomIn' | 'zoomOut' | Defines the action of the menu item. When specified the click property will be ignored.(Inherited from ElectronMenuItemConstructorOptions) | |
| sharingItem? | ElectronSharingItem | The item to share when the role is shareMenu. darwin only.(Inherited from ElectronMenuItemConstructorOptions) | |
| sublabel? | string | The item's sublabel. (Inherited from ElectronMenuItemConstructorOptions) | |
| submenu? | ObsidianIpcMenuItemTemplate[] | The items of the submenu. | |
| toolTip? | string | Hover text for this menu item. darwin only.(Inherited from ElectronMenuItemConstructorOptions) | |
| type? | 'checkbox' | 'normal' | 'radio' | 'separator' | 'submenu' | The type of the item. (Inherited from ElectronMenuItemConstructorOptions) | |
| visible? | boolean | If false, the menu item will be entirely hidden.(Inherited from ElectronMenuItemConstructorOptions) |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| click(menuItem, browserWindow, $event) | void | Will be called when the menu item is clicked. (Inherited from ElectronMenuItemConstructorOptions) |
Links to this page: