UNPKG

3.24 kBTypeScriptView Raw
1import { ISessionContext, ISessionContextDialogs, ReactWidget } from '@jupyterlab/apputils';
2import { DocumentRegistry } from '@jupyterlab/docregistry';
3import { ITranslator } from '@jupyterlab/translation';
4import { Widget } from '@lumino/widgets';
5import * as React from 'react';
6import { NotebookPanel } from './panel';
7import { Notebook } from './widget';
8/**
9 * A namespace for the default toolbar items.
10 */
11export declare namespace ToolbarItems {
12 /**
13 * Create save button toolbar item.
14 *
15 * @deprecated since v3.2
16 * This is dead code now.
17 */
18 function createSaveButton(panel: NotebookPanel, translator?: ITranslator): Widget;
19 /**
20 * Create an insert toolbar item.
21 *
22 * @deprecated since v3.2
23 * This is dead code now.
24 */
25 function createInsertButton(panel: NotebookPanel, translator?: ITranslator): Widget;
26 /**
27 * Create a cut toolbar item.
28 *
29 * @deprecated since v3.2
30 * This is dead code now.
31 */
32 function createCutButton(panel: NotebookPanel, translator?: ITranslator): Widget;
33 /**
34 * Create a copy toolbar item.
35 *
36 * @deprecated since v3.2
37 * This is dead code now.
38 */
39 function createCopyButton(panel: NotebookPanel, translator?: ITranslator): Widget;
40 /**
41 * Create a paste toolbar item.
42 *
43 * @deprecated since v3.2
44 * This is dead code now.
45 */
46 function createPasteButton(panel: NotebookPanel, translator?: ITranslator): Widget;
47 /**
48 * Create a run toolbar item.
49 *
50 * @deprecated since v3.2
51 * This is dead code now.
52 */
53 function createRunButton(panel: NotebookPanel, translator?: ITranslator): Widget;
54 /**
55 * Create a restart run all toolbar item
56 *
57 * @deprecated since v3.2
58 * This is dead code now.
59 */
60 function createRestartRunAllButton(panel: NotebookPanel, dialogs?: ISessionContext.IDialogs, translator?: ITranslator): Widget;
61 /**
62 * Create a cell type switcher item.
63 *
64 * #### Notes
65 * It will display the type of the current active cell.
66 * If more than one cell is selected but are of different types,
67 * it will display `'-'`.
68 * When the user changes the cell type, it will change the
69 * cell types of the selected cells.
70 * It can handle a change to the context.
71 */
72 function createCellTypeItem(panel: NotebookPanel, translator?: ITranslator): Widget;
73 /**
74 * Get the default toolbar items for panel
75 */
76 function getDefaultItems(panel: NotebookPanel, sessionDialogs?: ISessionContextDialogs, translator?: ITranslator): DocumentRegistry.IToolbarItem[];
77}
78/**
79 * A toolbar widget that switches cell types.
80 */
81export declare class CellTypeSwitcher extends ReactWidget {
82 /**
83 * Construct a new cell type switcher.
84 */
85 constructor(widget: Notebook, translator?: ITranslator);
86 /**
87 * Handle `change` events for the HTMLSelect component.
88 */
89 handleChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
90 /**
91 * Handle `keydown` events for the HTMLSelect component.
92 */
93 handleKeyDown: (event: React.KeyboardEvent) => void;
94 render(): JSX.Element;
95 private _trans;
96 private _notebook;
97}