@launchmenu/core
Version:
An environment for visual keyboard controlled applets
18 lines • 1.16 kB
TypeScript
import { IMenu } from "../../_types/IMenu";
import { KeyPattern } from "../../../../keyHandler/KeyPattern";
import { IMenuItemExecuteCallback } from "../../_types/IMenuItemExecuteCallback";
import { IDisposableKeyEventListener } from "../../../../textFields/interaction/_types/IDisposableKeyEventListener";
/**
* Sets up a key listener to open the context menu, and forward key events to context menu items
* @param menu The menu to create the context menu handler for
* @param config The configuration to customize the handler
* @returns An object with an event emit function and destroy function
*/
export declare function setupContextMenuHandler(menu: IMenu, { onExecute, useContextItemKeyHandlers, pattern, }?: {
onExecute?: IMenuItemExecuteCallback;
/** Whether to forward key events to context menu items (can be costly for large selections or context menus), defaults to true */
useContextItemKeyHandlers?: boolean;
/** A pattern to detect whether to handle the keyboard opening */
pattern?: KeyPattern | (() => KeyPattern);
}): IDisposableKeyEventListener;
//# sourceMappingURL=setupContextMenuHandler.d.ts.map