1 | import { IDisposable } from '@lumino/disposable';
|
2 | import { ISignal, Signal } from '@lumino/signaling';
|
3 | import { VirtualElement } from '@lumino/virtualdom';
|
4 | import { ContextMenu, Menu } from '@lumino/widgets';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export declare class ContextMenuSvg extends ContextMenu implements IDisposable {
|
10 | |
11 |
|
12 |
|
13 |
|
14 |
|
15 | constructor(options: ContextMenu.IOptions);
|
16 | readonly menu: MenuSvg;
|
17 | /**
|
18 | * Test whether the context menu is disposed.
|
19 | */
|
20 | get isDisposed(): boolean;
|
21 | /**
|
22 | * A signal fired when the context menu is opened.
|
23 | */
|
24 | get opened(): ISignal<ContextMenu, void>;
|
25 | /**
|
26 | * Dispose of the resources held by the context menu.
|
27 | */
|
28 | dispose(): void;
|
29 | /**
|
30 | * Open the context menu in response to a `'contextmenu'` event.
|
31 | *
|
32 | * @param event - The `'contextmenu'` event of interest.
|
33 | *
|
34 | * @returns `true` if the menu was opened, or `false` if no items
|
35 | * matched the event and the menu was not opened.
|
36 | *
|
37 | * #### Notes
|
38 | * This method will populate the context menu with items which match
|
39 | * the propagation path of the event, then open the menu at the mouse
|
40 | * position indicated by the event.
|
41 | */
|
42 | open(event: MouseEvent): boolean;
|
43 | protected _isDisposed: boolean;
|
44 | protected _opened: Signal<ContextMenu, void>;
|
45 | }
|
46 | /**
|
47 | * a widget which displays items as a canonical menu.
|
48 | * Tweaked to use inline svg icons
|
49 | */
|
50 | export declare class MenuSvg extends Menu {
|
51 | |
52 |
|
53 |
|
54 |
|
55 |
|
56 | constructor(options: Menu.IOptions);
|
57 | /**
|
58 | * insert a menu item into the menu at the specified index. Replaces the
|
59 | * default renderer for submenus
|
60 | *
|
61 | * @param index - The index at which to insert the item.
|
62 | *
|
63 | * @param options - The options for creating the menu item.
|
64 | *
|
65 | * @returns The menu item added to the menu.
|
66 | *
|
67 | * #### Notes
|
68 | * The index will be clamped to the bounds of the items.
|
69 | */
|
70 | insertItem(index: number, options: Menu.IItemOptions): Menu.IItem;
|
71 | }
|
72 | export declare namespace MenuSvg {
|
73 | function overrideDefaultRenderer(menu: Menu): void;
|
74 | |
75 |
|
76 |
|
77 | class Renderer extends Menu.Renderer {
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | renderIcon(data: Menu.IRenderData): VirtualElement;
|
86 | |
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | createIconClass(data: Menu.IRenderData): string;
|
94 | |
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | renderSubmenu(data: Menu.IRenderData): VirtualElement;
|
102 | }
|
103 | const defaultRenderer: Renderer;
|
104 | }
|