UNPKG

1.45 kBTypeScriptView Raw
1import { ContextMenuPopoverProps } from "./contextMenuPopover";
2/**
3 * Show a context menu at a particular offset from the top-left corner of the document.
4 * The menu will appear below-right of this point and will flip to below-left if there is not enough
5 * room onscreen. Additional props like `onClose`, `isDarkTheme`, etc. can be forwarded to the `<ContextMenuPopover>`.
6 *
7 * Context menus created with this API will automatically close when a user clicks outside the popover.
8 * You may force them to close by using `hideContextMenu()`.
9 *
10 * Note that this API relies on global state in the @blueprintjs/core package, and should be used with caution,
11 * especially if your build system allows multiple copies of Blueprint libraries to be bundled into an application at
12 * once.
13 *
14 * Alternative APIs to consider which do not have the limitations of global state:
15 * - `<ContextMenu>`
16 * - `<ContextMenuPopover>`
17 *
18 * @see https://blueprintjs.com/docs/#core/components/context-menu-popover.imperative-api
19 */
20export declare function showContextMenu(props: Omit<ContextMenuPopoverProps, "isOpen">): void;
21/**
22 * Hide a context menu that was created using `showContextMenu()`.
23 *
24 * Note that this API relies on global state in the @blueprintjs/core package, and should be used with caution.
25 *
26 * @see https://blueprintjs.com/docs/#core/components/context-menu-popover.imperative-api
27 */
28export declare function hideContextMenu(): void;