Skip to content

ObsidianIpcMenuItemTemplate

Unofficial

One item of the application menu template Obsidian’s set-menu IPC channel takes.

Import:

import type { ObsidianIpcMenuItemTemplate } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ObsidianIpcMenuItemTemplate extends ElectronMenuItemConstructorOptions

Extends: ElectronMenuItemConstructorOptions

Properties

PropertyTypeDescription
accelerator?ElectronAcceleratorThe item's accelerator.
(Inherited from ElectronMenuItemConstructorOptions)
acceleratorWorksWhenHidden?booleanWhen 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?stringThe 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?booleanShould only be specified for checkbox or radio type menu items.
(Inherited from ElectronMenuItemConstructorOptions)
enabled?booleanIf false, the menu item will be greyed out and unclickable.
(Inherited from ElectronMenuItemConstructorOptions)
icon?ElectronNativeImage | stringThe item's icon.
(Inherited from ElectronMenuItemConstructorOptions)
id?stringUnique 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?stringThe item's visible label.
(Inherited from ElectronMenuItemConstructorOptions)
registerAccelerator?booleanIf 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?ElectronSharingItemThe item to share when the role is shareMenu. darwin only.
(Inherited from ElectronMenuItemConstructorOptions)
sublabel?stringThe item's sublabel.
(Inherited from ElectronMenuItemConstructorOptions)
submenu?ObsidianIpcMenuItemTemplate[]The items of the submenu.
toolTip?stringHover 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?booleanIf false, the menu item will be entirely hidden.
(Inherited from ElectronMenuItemConstructorOptions)

Methods

MethodReturnsDescription
click(menuItem, browserWindow, $event)voidWill be called when the menu item is clicked.
(Inherited from ElectronMenuItemConstructorOptions)

Links to this page: