1 | import { IWidgetTracker } from '@jupyterlab/apputils';
|
2 | import { Cell } from '@jupyterlab/cells';
|
3 | import { Token } from '@lumino/coreutils';
|
4 | import { ISignal } from '@lumino/signaling';
|
5 | import { Widget } from '@lumino/widgets';
|
6 | import { NotebookTools } from './notebooktools';
|
7 | import { NotebookPanel } from './panel';
|
8 | import { NotebookWidgetFactory } from './widgetfactory';
|
9 | /**
|
10 | * The notebook widget factory token.
|
11 | */
|
12 | export declare const INotebookWidgetFactory: Token<NotebookWidgetFactory.IFactory>;
|
13 | /**
|
14 | * The notebook tools token.
|
15 | */
|
16 | export declare const INotebookTools: Token<INotebookTools>;
|
17 | /**
|
18 | * The interface for notebook metadata tools.
|
19 | */
|
20 | export interface INotebookTools extends Widget {
|
21 | activeNotebookPanel: NotebookPanel | null;
|
22 | activeCell: Cell | null;
|
23 | selectedCells: Cell[];
|
24 | addItem(options: NotebookTools.IAddOptions): void;
|
25 | addSection(options: NotebookTools.IAddSectionOptions): void;
|
26 | }
|
27 | /**
|
28 | * The namespace for NotebookTools class statics.
|
29 | */
|
30 | export declare namespace INotebookTools {
|
31 | /**
|
32 | * The options used to add an item to the notebook tools.
|
33 | */
|
34 | interface IAddOptions {
|
35 | /**
|
36 | * The tool to add to the notebook tools area.
|
37 | */
|
38 | tool: ITool;
|
39 | /**
|
40 | * The section to which the tool should be added.
|
41 | */
|
42 | section: 'advanced' | string;
|
43 | /**
|
44 | * The rank order of the widget among its siblings.
|
45 | */
|
46 | rank?: number;
|
47 | }
|
48 | /**
|
49 | * The options used to add a section to the notebook tools.
|
50 | */
|
51 | interface IAddSectionOptions {
|
52 | /**
|
53 | * The name of the new section.
|
54 | */
|
55 | sectionName: string;
|
56 | /**
|
57 | * The tool to add to the notebook tools area.
|
58 | */
|
59 | tool?: INotebookTools.ITool;
|
60 | /**
|
61 | * The label of the new section.
|
62 | */
|
63 | label?: string;
|
64 | /**
|
65 | * The rank order of the section among its siblings.
|
66 | */
|
67 | rank?: number;
|
68 | }
|
69 | interface ITool extends Widget {
|
70 | /**
|
71 | * The notebook tools object.
|
72 | */
|
73 | notebookTools: INotebookTools;
|
74 | }
|
75 | }
|
76 | /**
|
77 | * The notebook tracker token.
|
78 | */
|
79 | export declare const INotebookTracker: Token<INotebookTracker>;
|
80 | /**
|
81 | * An object that tracks notebook widgets.
|
82 | */
|
83 | export interface INotebookTracker extends IWidgetTracker<NotebookPanel> {
|
84 | /**
|
85 | * The currently focused cell.
|
86 | *
|
87 | * #### Notes
|
88 | * If there is no cell with the focus, then this value is `null`.
|
89 | */
|
90 | readonly activeCell: Cell | null;
|
91 | /**
|
92 | * A signal emitted when the current active cell changes.
|
93 | *
|
94 | * #### Notes
|
95 | * If there is no cell with the focus, then `null` will be emitted.
|
96 | */
|
97 | readonly activeCellChanged: ISignal<this, Cell | null>;
|
98 | /**
|
99 | * A signal emitted when the selection state changes.
|
100 | */
|
101 | readonly selectionChanged: ISignal<this, void>;
|
102 | }
|