UNPKG

2.7 kBTypeScriptView Raw
1import { Cell, CodeCellModel } from '@jupyterlab/cells';
2import { CodeEditorWrapper } from '@jupyterlab/codeeditor';
3import { Context, DocumentRegistry } from '@jupyterlab/docregistry';
4import { INotebookContent } from '@jupyterlab/nbformat';
5import { RenderMimeRegistry } from '@jupyterlab/rendermime';
6import { ServiceManager } from '@jupyterlab/services';
7import { INotebookModel } from './model';
8import { NotebookPanel } from './panel';
9import { Notebook } from './widget';
10import { NotebookWidgetFactory } from './widgetfactory';
11export declare const DEFAULT_CONTENT: INotebookContent;
12/**
13 * Create and initialize context for a notebook.
14 */
15export declare function initNotebookContext(options?: {
16 path?: string;
17 manager?: ServiceManager.IManager;
18 startKernel?: boolean;
19}): Promise<Context<INotebookModel>>;
20/**
21 * The default notebook content.
22 */
23export declare namespace NBTestUtils {
24 const DEFAULT_OUTPUTS: import("@jupyterlab/nbformat").IOutput[];
25 const defaultEditorConfig: {
26 code: Record<string, any>;
27 markdown: Record<string, any>;
28 raw: Record<string, any>;
29 };
30 const editorFactory: any;
31 const mimeTypeService: import("@jupyterlab/codeeditor").IEditorMimeTypeService;
32 /**
33 * Get a copy of the default rendermime instance.
34 */
35 function defaultRenderMime(): RenderMimeRegistry;
36 const clipboard: import("@lumino/coreutils").MimeData;
37 /**
38 * Create a base cell content factory.
39 */
40 function createBaseCellFactory(): Cell.IContentFactory;
41 /**
42 * Create a new code cell content factory.
43 */
44 function createCodeCellFactory(): Cell.IContentFactory;
45 /**
46 * Create a cell editor widget.
47 */
48 function createCellEditor(model?: CodeCellModel): CodeEditorWrapper;
49 /**
50 * Create a default notebook content factory.
51 */
52 function createNotebookFactory(): Notebook.IContentFactory;
53 /**
54 * Create a default notebook panel content factory.
55 */
56 function createNotebookPanelFactory(): NotebookPanel.IContentFactory;
57 /**
58 * Create a notebook widget.
59 */
60 function createNotebook(): Notebook;
61 /**
62 * Create a notebook panel widget.
63 */
64 function createNotebookPanel(context: Context<INotebookModel>): NotebookPanel;
65 /**
66 * Populate a notebook with default content.
67 */
68 function populateNotebook(notebook: Notebook): void;
69 function createNotebookWidgetFactory(toolbarFactory?: (widget: NotebookPanel) => DocumentRegistry.IToolbarItem[]): NotebookWidgetFactory;
70 /**
71 * Create a context for a file.
72 */
73 function createMockContext(startKernel?: boolean): Promise<Context<INotebookModel>>;
74}