/** * Methods for interacting with ToDesktop application's menu item. * * @remarks * This package exposes a number of methods for interacting with ToDesktop * application's menu item. * @experimental * @public * @packageDocumentation */ import { MenuItemConstructorOptions } from "@todesktop/client-electron-types"; import { type Ref } from "./invoke.js"; /** * Creates a new MenuItem. * * @returns Identifier for the newly created MenuItem. * @public */ export declare function create(options: MenuItemConstructorOptions): Promise; /** * The id of the Menuitem * * @param options - ref: Reference for the MenuItem * @public */ export declare function getId({ ref }: { ref: Ref; }): Promise; /** * Sets the id of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setId({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["id"]; }): Promise; /** * A string indicating the item's visible label. * * @param options - ref: Reference for the MenuItem * @public */ export declare function getLabel({ ref }: { ref: Ref; }): Promise; /** * Sets the label of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setLabel({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["label"]; }): Promise; /** * A Function that is fired when the MenuItem receives a click event. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getClick({ ref }: { ref: Ref; }): Promise; /** * Sets the click of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setClick({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["click"]; }): Promise; /** * A Menu (optional) containing the menu item's submenu, if present. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getSubmenu({ ref }: { ref: Ref; }): Promise; /** * Sets the submenu of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setSubmenu({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["submenu"]; }): Promise; /** * A string indicating the type of the item. Can be normal, separator, submenu, checkbox or radio. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getType({ ref }: { ref: Ref; }): Promise<"normal" | "separator" | "submenu" | "checkbox" | "radio">; /** * Sets the type of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setType({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["type"]; }): Promise<"normal" | "separator" | "submenu" | "checkbox" | "radio">; /** * A string indicating the type of the item. Can be normal, separator, submenu, checkbox or radio. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getRole({ ref }: { ref: Ref; }): Promise<"normal" | "separator" | "submenu" | "checkbox" | "radio">; /** * Sets the role of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setRole({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["role"]; }): Promise<"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" | "startSpeaking" | "stopSpeaking" | "zoom" | "front" | "appMenu" | "fileMenu" | "editMenu" | "viewMenu" | "shareMenu" | "recentDocuments" | "toggleTabBar" | "selectNextTab" | "selectPreviousTab" | "showAllTabs" | "mergeAllWindows" | "clearRecentDocuments" | "moveTabToNewWindow" | "windowMenu">; /** * An Accelerator (optional) indicating the item's accelerator, if set. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getAccelerator({ ref }: { ref: Ref; }): Promise; /** * Sets the accelerator of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setAccelerator({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["accelerator"]; }): Promise; /** * A NativeImage | string (optional) indicating the item's icon, if set. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getIcon({ ref }: { ref: Ref; }): Promise; /** * Sets the icon of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setIcon({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["icon"]; }): Promise; /** * A string indicating the item's sublabel. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getSublabel({ ref }: { ref: Ref; }): Promise; /** * Sets the sublabel of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setSublabel({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["sublabel"]; }): Promise; /** * A string indicating the item's hover text. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getToolTip({ ref }: { ref: Ref; }): Promise; /** * Sets the tooltip of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setToolTip({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["toolTip"]; }): Promise; /** * A boolean indicating whether the item is enabled, this property can be dynamically changed. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getEnabled({ ref }: { ref: Ref; }): Promise; /** * Sets the enabled of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setEnabled({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["enabled"]; }): Promise; /** * A boolean indicating whether the item is visible, this property can be dynamically changed. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getVisible({ ref }: { ref: Ref; }): Promise; /** * Sets the visible of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setVisible({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["visible"]; }): Promise; /** * A boolean indicating whether the item is checked, this property can be dynamically changed. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getChecked({ ref }: { ref: Ref; }): Promise; /** * Sets the checked of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setChecked({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["checked"]; }): Promise; /** * A boolean indicating if the accelerator should be registered with the system or just displayed. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getRegisterAccelerator({ ref }: { ref: Ref; }): Promise; /** * Sets the registerAccelerator of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setRegisterAccelerator({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["registerAccelerator"]; }): Promise; /** * A SharingItem indicating the item to share when the role is shareMenu. MacOS only. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getSharingItem({ ref }: { ref: Ref; }): Promise; /** * Sets the sharingItem of the Menuitem * * @param options - ref: Reference for the MenuItem; value: value to set. * @public */ export declare function setSharingItem({ ref, value, }: { ref: Ref; value: MenuItemConstructorOptions["sharingItem"]; }): Promise; /** * A number indicating an item's sequential unique id. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getCommandId({ ref }: { ref: Ref; }): Promise; /** * A Menu that the item is a part of. * * @param options - ref: Reference for the MenuItem; * @public */ export declare function getMenu({ ref }: { ref: Ref; }): Promise;