1 | import { ISessionContextDialogs } from '@jupyterlab/apputils';
|
2 | import { IEditorMimeTypeService } from '@jupyterlab/codeeditor';
|
3 | import { ABCWidgetFactory, DocumentRegistry } from '@jupyterlab/docregistry';
|
4 | import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
5 | import { ITranslator } from '@jupyterlab/translation';
|
6 | import { INotebookModel } from './model';
|
7 | import { NotebookPanel } from './panel';
|
8 | import { StaticNotebook } from './widget';
|
9 |
|
10 |
|
11 |
|
12 | export declare class NotebookWidgetFactory extends ABCWidgetFactory<NotebookPanel, INotebookModel> {
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 | constructor(options: NotebookWidgetFactory.IOptions<NotebookPanel>);
|
19 | readonly rendermime: IRenderMimeRegistry;
|
20 | /**
|
21 | * The content factory used by the widget factory.
|
22 | */
|
23 | readonly contentFactory: NotebookPanel.IContentFactory;
|
24 | /**
|
25 | * The service used to look up mime types.
|
26 | */
|
27 | readonly mimeTypeService: IEditorMimeTypeService;
|
28 | /**
|
29 | * A configuration object for cell editor settings.
|
30 | */
|
31 | get editorConfig(): StaticNotebook.IEditorConfig;
|
32 | set editorConfig(value: StaticNotebook.IEditorConfig);
|
33 | /**
|
34 | * A configuration object for notebook settings.
|
35 | */
|
36 | get notebookConfig(): StaticNotebook.INotebookConfig;
|
37 | set notebookConfig(value: StaticNotebook.INotebookConfig);
|
38 | /**
|
39 | * Create a new widget.
|
40 | *
|
41 | * #### Notes
|
42 | * The factory will start the appropriate kernel.
|
43 | */
|
44 | protected createNewWidget(context: DocumentRegistry.IContext<INotebookModel>, source?: NotebookPanel): NotebookPanel;
|
45 | /**
|
46 | * Default factory for toolbar items to be added after the widget is created.
|
47 | */
|
48 | protected defaultToolbarFactory(widget: NotebookPanel): DocumentRegistry.IToolbarItem[];
|
49 | private _editorConfig;
|
50 | private _notebookConfig;
|
51 | private _sessionDialogs;
|
52 | }
|
53 | /**
|
54 | * The namespace for `NotebookWidgetFactory` statics.
|
55 | */
|
56 | export declare namespace NotebookWidgetFactory {
|
57 | |
58 |
|
59 |
|
60 | interface IOptions<T extends NotebookPanel> extends DocumentRegistry.IWidgetFactoryOptions<T> {
|
61 | rendermime: IRenderMimeRegistry;
|
62 | |
63 |
|
64 |
|
65 | contentFactory: NotebookPanel.IContentFactory;
|
66 | |
67 |
|
68 |
|
69 | mimeTypeService: IEditorMimeTypeService;
|
70 | |
71 |
|
72 |
|
73 | editorConfig?: StaticNotebook.IEditorConfig;
|
74 | |
75 |
|
76 |
|
77 | notebookConfig?: StaticNotebook.INotebookConfig;
|
78 | |
79 |
|
80 |
|
81 | sessionDialogs?: ISessionContextDialogs;
|
82 | |
83 |
|
84 |
|
85 | translator?: ITranslator;
|
86 | }
|
87 | |
88 |
|
89 |
|
90 | interface IFactory extends DocumentRegistry.IWidgetFactory<NotebookPanel, INotebookModel> {
|
91 | |
92 |
|
93 |
|
94 | editorConfig: StaticNotebook.IEditorConfig;
|
95 | |
96 |
|
97 |
|
98 | notebookConfig: StaticNotebook.INotebookConfig;
|
99 | |
100 |
|
101 |
|
102 | shutdownOnClose: boolean;
|
103 | }
|
104 | }
|