MockMenuBarOptions interface

Module @runic-artifex/views/mock in @runic-artifex/views 0.23.0

interface MockMenuBarOptions

Options of installMockMenuBar.

Properties

bridge

readonly bridge?: MockBridge;

The mock Bridge to serve the menu bar on; defaults to the installed mock Bridge, or a newly installed one.

placement

readonly placement?: "page" | "window" | "global" | "none";

Where the host shows the bar; defaults to "page". This set is open, as MenuBarState.placement.

shortcuts

readonly shortcuts?: "host" | "page";

Whether the host matches the items' shortcuts on its own key path ("host") or leaves them to the page ("page", the default, as for a page in a browser). This set is closed.

platform

readonly platform?: "windows" | "linux" | "macos";

The host's platform; defaults to "macos" on Apple platforms and "linux" elsewhere. This set is closed.

onInvoke

readonly onInvoke?: (item: MenuBarItem) => MenuBarInvokeResult | void;

Runs an enabled item the page invoked; its result is the reply, "executed" when it returns nothing. Every invocation is recorded in MockMenuBar first.