UNPKG

2.33 kBTypeScriptView Raw
1import { TranslationBundle } from '@jupyterlab/translation';
2import { RankedMenu } from '@jupyterlab/ui-components';
3import { CommandRegistry } from '@lumino/commands';
4import { Menu, MenuBar } from '@lumino/widgets';
5import { EditMenu } from './edit';
6import { FileMenu } from './file';
7import { HelpMenu } from './help';
8import { KernelMenu } from './kernel';
9import { RunMenu } from './run';
10import { SettingsMenu } from './settings';
11import { TabsMenu } from './tabs';
12import { IMainMenu } from './tokens';
13import { ViewMenu } from './view';
14/**
15 * The main menu class. It is intended to be used as a singleton.
16 */
17export declare class MainMenu extends MenuBar implements IMainMenu {
18 /**
19 * Construct the main menu bar.
20 */
21 constructor(commands: CommandRegistry);
22 /**
23 * The application "Edit" menu.
24 */
25 get editMenu(): EditMenu;
26 /**
27 * The application "File" menu.
28 */
29 get fileMenu(): FileMenu;
30 /**
31 * The application "Help" menu.
32 */
33 get helpMenu(): HelpMenu;
34 /**
35 * The application "Kernel" menu.
36 */
37 get kernelMenu(): KernelMenu;
38 /**
39 * The application "Run" menu.
40 */
41 get runMenu(): RunMenu;
42 /**
43 * The application "Settings" menu.
44 */
45 get settingsMenu(): SettingsMenu;
46 /**
47 * The application "View" menu.
48 */
49 get viewMenu(): ViewMenu;
50 /**
51 * The application "Tabs" menu.
52 */
53 get tabsMenu(): TabsMenu;
54 /**
55 * Add a new menu to the main menu bar.
56 */
57 addMenu(menu: Menu, update?: boolean, options?: IMainMenu.IAddOptions): void;
58 /**
59 * Dispose of the resources held by the menu bar.
60 */
61 dispose(): void;
62 /**
63 * Generate the menu.
64 *
65 * @param commands The command registry
66 * @param options The main menu options.
67 * @param trans - The application language translator.
68 */
69 static generateMenu(commands: CommandRegistry, options: IMainMenu.IMenuOptions, trans: TranslationBundle): RankedMenu;
70 /**
71 * Handle the disposal of a menu.
72 */
73 private _onMenuDisposed;
74 private _commands;
75 private _items;
76 private _editMenu;
77 private _fileMenu;
78 private _helpMenu;
79 private _kernelMenu;
80 private _runMenu;
81 private _settingsMenu;
82 private _viewMenu;
83 private _tabsMenu;
84}