UNPKG

1.18 kBPlain TextView Raw
1// Copyright (c) Jupyter Development Team.
2// Distributed under the terms of the Modified BSD License.
3
4import { IRankedMenu, RankedMenu } from '@jupyterlab/ui-components';
5import { SemanticCommand } from '@jupyterlab/apputils';
6
7/**
8 * An interface for a Help menu.
9 */
10export interface IHelpMenu extends IRankedMenu {
11 /**
12 * A semantic command to get the kernel for the help menu.
13 * This is used to populate additional help
14 * links provided by the kernel of a widget.
15 *
16 * #### Note
17 * The command must return a Kernel.IKernelConnection object
18 */
19 readonly getKernel: SemanticCommand;
20}
21
22/**
23 * An extensible Help menu for the application.
24 */
25export class HelpMenu extends RankedMenu implements IHelpMenu {
26 /**
27 * Construct the help menu.
28 */
29 constructor(options: IRankedMenu.IOptions) {
30 super(options);
31 this.getKernel = new SemanticCommand();
32 }
33
34 /**
35 * A semantic command to get the kernel for the help menu.
36 * This is used to populate additional help
37 * links provided by the kernel of a widget.
38 *
39 * #### Note
40 * The command must return a Kernel.IKernelConnection object
41 */
42 readonly getKernel: SemanticCommand;
43}