UNPKG

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