UNPKG

1.39 kBTypeScriptView Raw
1import { Kernel } from '@jupyterlab/services';
2import { IRankedMenu, RankedMenu } from '@jupyterlab/ui-components';
3import { Widget } from '@lumino/widgets';
4import { IMenuExtender } from './tokens';
5/**
6 * An interface for a Help menu.
7 */
8export interface IHelpMenu extends IRankedMenu {
9 /**
10 * A set of kernel users for the help menu.
11 * This is used to populate additional help
12 * links provided by the kernel of a widget.
13 */
14 readonly kernelUsers: Set<IHelpMenu.IKernelUser<Widget>>;
15}
16/**
17 * An extensible Help menu for the application.
18 */
19export declare class HelpMenu extends RankedMenu implements IHelpMenu {
20 /**
21 * Construct the help menu.
22 */
23 constructor(options: IRankedMenu.IOptions);
24 /**
25 * A set of kernel users for the help menu.
26 * This is used to populate additional help
27 * links provided by the kernel of a widget.
28 */
29 readonly kernelUsers: Set<IHelpMenu.IKernelUser<Widget>>;
30}
31/**
32 * Namespace for IHelpMenu
33 */
34export declare namespace IHelpMenu {
35 /**
36 * Interface for a Kernel user to register itself
37 * with the IHelpMenu's semantic extension points.
38 */
39 interface IKernelUser<T extends Widget> extends IMenuExtender<T> {
40 /**
41 * A function to get the kernel for a widget.
42 */
43 getKernel: (widget: T) => Kernel.IKernelConnection | null;
44 }
45}