1 | import { CodeCellModel } from '@jupyterlab/cells';
|
2 | import { DocumentRegistry } from '@jupyterlab/docregistry';
|
3 | import { IModelDB } from '@jupyterlab/observables';
|
4 | import { Contents } from '@jupyterlab/services';
|
5 | import { INotebookModel, NotebookModel } from './model';
|
6 |
|
7 |
|
8 |
|
9 | export declare class NotebookModelFactory implements DocumentRegistry.IModelFactory<INotebookModel> {
|
10 | |
11 |
|
12 |
|
13 | constructor(options: NotebookModelFactory.IOptions);
|
14 | /**
|
15 | * The content model factory used by the NotebookModelFactory.
|
16 | */
|
17 | readonly contentFactory: NotebookModel.IContentFactory;
|
18 | /**
|
19 | * Define the disableDocumentWideUndoRedo property.
|
20 | */
|
21 | set disableDocumentWideUndoRedo(disableDocumentWideUndoRedo: boolean);
|
22 | /**
|
23 | * The name of the model.
|
24 | */
|
25 | get name(): string;
|
26 | /**
|
27 | * The content type of the file.
|
28 | */
|
29 | get contentType(): Contents.ContentType;
|
30 | /**
|
31 | * The format of the file.
|
32 | */
|
33 | get fileFormat(): Contents.FileFormat;
|
34 | /**
|
35 | * Get whether the model factory has been disposed.
|
36 | */
|
37 | get isDisposed(): boolean;
|
38 | /**
|
39 | * Dispose of the model factory.
|
40 | */
|
41 | dispose(): void;
|
42 | /**
|
43 | * Create a new model for a given path.
|
44 | *
|
45 | * @param languagePreference - An optional kernel language preference.
|
46 | *
|
47 | * @returns A new document model.
|
48 | */
|
49 | createNew(languagePreference?: string, modelDB?: IModelDB, isInitialized?: boolean): INotebookModel;
|
50 | /**
|
51 | * Get the preferred kernel language given a path.
|
52 | */
|
53 | preferredLanguage(path: string): string;
|
54 | /**
|
55 | * Defines if the document can be undo/redo.
|
56 | */
|
57 | private _disableDocumentWideUndoRedo;
|
58 | private _disposed;
|
59 | }
|
60 | /**
|
61 | * The namespace for notebook model factory statics.
|
62 | */
|
63 | export declare namespace NotebookModelFactory {
|
64 | |
65 |
|
66 |
|
67 | interface IOptions {
|
68 | |
69 |
|
70 |
|
71 | disableDocumentWideUndoRedo?: boolean;
|
72 | |
73 |
|
74 |
|
75 | codeCellContentFactory?: CodeCellModel.IContentFactory;
|
76 | |
77 |
|
78 |
|
79 |
|
80 | contentFactory?: NotebookModel.IContentFactory;
|
81 | }
|
82 | }
|