1 | import { ISessionContext, Printing } from '@jupyterlab/apputils';
|
2 | import { DocumentWidget } from '@jupyterlab/docregistry';
|
3 | import { ITranslator } from '@jupyterlab/translation';
|
4 | import { Token } from '@lumino/coreutils';
|
5 | import { INotebookModel } from './model';
|
6 | import { Notebook, StaticNotebook } from './widget';
|
7 | import { Message } from '@lumino/messaging';
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare class NotebookPanel extends DocumentWidget<Notebook, INotebookModel> {
|
16 | |
17 |
|
18 |
|
19 | constructor(options: DocumentWidget.IOptions<Notebook, INotebookModel>);
|
20 | /**
|
21 | * Handle a change to the document registry save state.
|
22 | *
|
23 | * @param sender The document registry context
|
24 | * @param state The document registry save state
|
25 | */
|
26 | private _onSave;
|
27 | /**
|
28 | * The session context used by the panel.
|
29 | */
|
30 | get sessionContext(): ISessionContext;
|
31 | /**
|
32 | * The model for the widget.
|
33 | */
|
34 | get model(): INotebookModel | null;
|
35 | /**
|
36 | * Update the options for the current notebook panel.
|
37 | *
|
38 | * @param config new options to set
|
39 | */
|
40 | setConfig(config: NotebookPanel.IConfig): void;
|
41 | /**
|
42 | * Set URI fragment identifier.
|
43 | */
|
44 | setFragment(fragment: string): void;
|
45 | /**
|
46 | * Dispose of the resources used by the widget.
|
47 | */
|
48 | dispose(): void;
|
49 | /**
|
50 | * Prints the notebook by converting to HTML with nbconvert.
|
51 | */
|
52 | [Printing.symbol](): () => Promise<void>;
|
53 | /**
|
54 | * A message handler invoked on a 'before-hide' message.
|
55 | */
|
56 | protected onBeforeHide(msg: Message): void;
|
57 | /**
|
58 | * A message handler invoked on a 'before-show' message.
|
59 | */
|
60 | protected onBeforeShow(msg: Message): void;
|
61 | /**
|
62 | * Handle a change in the kernel by updating the document metadata.
|
63 | */
|
64 | private _onKernelChanged;
|
65 | private _onSessionStatusChanged;
|
66 | /**
|
67 | * Update the kernel language.
|
68 | */
|
69 | private _updateLanguage;
|
70 | /**
|
71 | * Update the kernel spec.
|
72 | */
|
73 | private _updateSpec;
|
74 | translator: ITranslator;
|
75 | private _trans;
|
76 | /**
|
77 | * Whether we are currently in a series of autorestarts we have already
|
78 | * notified the user about.
|
79 | */
|
80 | private _autorestarting;
|
81 | }
|
82 | /**
|
83 | * A namespace for `NotebookPanel` statics.
|
84 | */
|
85 | export declare namespace NotebookPanel {
|
86 | |
87 |
|
88 |
|
89 | interface IConfig {
|
90 | |
91 |
|
92 |
|
93 | autoStartDefault: boolean;
|
94 | |
95 |
|
96 |
|
97 | editorConfig: StaticNotebook.IEditorConfig;
|
98 | |
99 |
|
100 |
|
101 | notebookConfig: StaticNotebook.INotebookConfig;
|
102 | |
103 |
|
104 |
|
105 | kernelShutdown: boolean;
|
106 | }
|
107 | |
108 |
|
109 |
|
110 | interface IContentFactory extends Notebook.IContentFactory {
|
111 | |
112 |
|
113 |
|
114 | createNotebook(options: Notebook.IOptions): Notebook;
|
115 | }
|
116 | |
117 |
|
118 |
|
119 | class ContentFactory extends Notebook.ContentFactory implements IContentFactory {
|
120 | |
121 |
|
122 |
|
123 | createNotebook(options: Notebook.IOptions): Notebook;
|
124 | }
|
125 | |
126 |
|
127 |
|
128 | const IContentFactory: Token<IContentFactory>;
|
129 | }
|