1 | import { Printing } from '@jupyterlab/apputils';
|
2 | import { IRenderMime, IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
3 | import { ITranslator } from '@jupyterlab/translation';
|
4 | import { Message } from '@lumino/messaging';
|
5 | import { Widget } from '@lumino/widgets';
|
6 | import { ABCWidgetFactory, DocumentWidget } from './default';
|
7 | import { DocumentRegistry } from './registry';
|
8 |
|
9 |
|
10 |
|
11 | export declare class MimeContent extends Widget {
|
12 | |
13 |
|
14 |
|
15 | constructor(options: MimeContent.IOptions);
|
16 | /**
|
17 | * The mimetype for this rendered content.
|
18 | */
|
19 | readonly mimeType: string;
|
20 | /**
|
21 | * Print method. Deferred to the renderer.
|
22 | */
|
23 | [Printing.symbol](): Printing.OptionalAsyncThunk;
|
24 | /**
|
25 | * A promise that resolves when the widget is ready.
|
26 | */
|
27 | get ready(): Promise<void>;
|
28 | /**
|
29 | * Set URI fragment identifier.
|
30 | */
|
31 | setFragment(fragment: string): void;
|
32 | /**
|
33 | * Dispose of the resources held by the widget.
|
34 | */
|
35 | dispose(): void;
|
36 | /**
|
37 | * Handle an `update-request` message to the widget.
|
38 | */
|
39 | protected onUpdateRequest(msg: Message): void;
|
40 | /**
|
41 | * Render the mime content.
|
42 | */
|
43 | private _render;
|
44 | /**
|
45 | * A bound change callback.
|
46 | */
|
47 | private _changeCallback;
|
48 | readonly renderer: IRenderMime.IRenderer;
|
49 | protected translator: ITranslator;
|
50 | private _trans;
|
51 | private _context;
|
52 | private _fragment;
|
53 | private _monitor;
|
54 | private _ready;
|
55 | private _dataType;
|
56 | private _isRendering;
|
57 | private _renderRequested;
|
58 | }
|
59 | /**
|
60 | * The namespace for MimeDocument class statics.
|
61 | */
|
62 | export declare namespace MimeContent {
|
63 | |
64 |
|
65 |
|
66 | interface IOptions {
|
67 | |
68 |
|
69 |
|
70 | context: DocumentRegistry.IContext<DocumentRegistry.IModel>;
|
71 | |
72 |
|
73 |
|
74 | renderer: IRenderMime.IRenderer;
|
75 | |
76 |
|
77 |
|
78 | mimeType: string;
|
79 | |
80 |
|
81 |
|
82 | renderTimeout: number;
|
83 | |
84 |
|
85 |
|
86 | dataType?: 'string' | 'json';
|
87 | |
88 |
|
89 |
|
90 | translator?: ITranslator;
|
91 | }
|
92 | }
|
93 |
|
94 |
|
95 |
|
96 | export declare class MimeDocument extends DocumentWidget<MimeContent> {
|
97 | setFragment(fragment: string): void;
|
98 | }
|
99 |
|
100 |
|
101 |
|
102 | export declare class MimeDocumentFactory extends ABCWidgetFactory<MimeDocument> {
|
103 | |
104 |
|
105 |
|
106 | constructor(options: MimeDocumentFactory.IOptions<MimeDocument>);
|
107 | /**
|
108 | * Create a new widget given a context.
|
109 | */
|
110 | protected createNewWidget(context: DocumentRegistry.Context): MimeDocument;
|
111 | private _rendermime;
|
112 | private _renderTimeout;
|
113 | private _dataType;
|
114 | private _fileType;
|
115 | private _factory;
|
116 | }
|
117 | /**
|
118 | * The namespace for MimeDocumentFactory class statics.
|
119 | */
|
120 | export declare namespace MimeDocumentFactory {
|
121 | |
122 |
|
123 |
|
124 | interface IOptions<T extends MimeDocument> extends DocumentRegistry.IWidgetFactoryOptions<T> {
|
125 | |
126 |
|
127 |
|
128 | primaryFileType: DocumentRegistry.IFileType | undefined;
|
129 | |
130 |
|
131 |
|
132 | rendermime: IRenderMimeRegistry;
|
133 | |
134 |
|
135 |
|
136 | renderTimeout?: number;
|
137 | |
138 |
|
139 |
|
140 | dataType?: 'string' | 'json';
|
141 | |
142 |
|
143 |
|
144 | factory?: IRenderMime.IRendererFactory;
|
145 | }
|
146 | }
|