UNPKG

1.73 kBTypeScriptView Raw
1import { IRankedMenu, RankedMenu } from '@jupyterlab/ui-components';
2import { SemanticCommand } from '@jupyterlab/apputils';
3/**
4 * An interface for a Kernel menu.
5 */
6export interface IKernelMenu extends IRankedMenu {
7 /**
8 * Semantic commands IKernelUsers for the Kernel menu.
9 */
10 readonly kernelUsers: IKernelMenu.IKernelUser;
11}
12/**
13 * An extensible Kernel menu for the application.
14 */
15export declare class KernelMenu extends RankedMenu implements IKernelMenu {
16 /**
17 * Construct the kernel menu.
18 */
19 constructor(options: IRankedMenu.IOptions);
20 /**
21 * Semantic commands IKernelUsers for the Kernel menu.
22 */
23 readonly kernelUsers: IKernelMenu.IKernelUser;
24}
25/**
26 * Namespace for IKernelMenu
27 */
28export declare namespace IKernelMenu {
29 /**
30 * Interface for a Kernel user to register itself
31 * with the IKernelMenu's semantic extension points.
32 */
33 interface IKernelUser {
34 /**
35 * A semantic command to interrupt the kernel.
36 */
37 interruptKernel: SemanticCommand;
38 /**
39 * A semantic command to reconnect to the kernel
40 */
41 reconnectToKernel: SemanticCommand;
42 /**
43 * A semantic command to restart the kernel, which
44 * returns a promise of whether the kernel was restarted.
45 */
46 restartKernel: SemanticCommand;
47 /**
48 * A semantic command to clear the widget.
49 */
50 clearWidget: SemanticCommand;
51 /**
52 * A semantic command to change the kernel.
53 */
54 changeKernel: SemanticCommand;
55 /**
56 * A semantic command to shut down the kernel.
57 */
58 shutdownKernel: SemanticCommand;
59 }
60}