UNPKG

1.88 kBTypeScriptView Raw
1import { DocumentRegistry } from '@jupyterlab/docregistry';
2import { ITranslator } from '@jupyterlab/translation';
3import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
4import { Widget } from '@lumino/widgets';
5import { IDocumentManager } from './tokens';
6/**
7 * A VDomRenderer for a saving status item.
8 */
9export declare class SavingStatus extends VDomRenderer<SavingStatus.Model> {
10 /**
11 * Create a new SavingStatus item.
12 */
13 constructor(opts: SavingStatus.IOptions);
14 /**
15 * Render the SavingStatus item.
16 */
17 render(): JSX.Element | null;
18 private _statusMap;
19}
20/**
21 * A namespace for SavingStatus statics.
22 */
23export declare namespace SavingStatus {
24 /**
25 * A VDomModel for the SavingStatus item.
26 */
27 class Model extends VDomModel {
28 /**
29 * Create a new SavingStatus model.
30 */
31 constructor(docManager: IDocumentManager);
32 /**
33 * The current status of the model.
34 */
35 get status(): DocumentRegistry.SaveState | null;
36 /**
37 * The current widget for the model. Any widget can be assigned,
38 * but it only has any effect if the widget is an IDocument widget
39 * known to the application document manager.
40 */
41 get widget(): Widget | null;
42 set widget(widget: Widget | null);
43 /**
44 * React to a saving status change from the current document widget.
45 */
46 private _onStatusChange;
47 private _status;
48 private _widget;
49 private _docManager;
50 }
51 /**
52 * Options for creating a new SaveStatus item
53 */
54 interface IOptions {
55 /**
56 * The application document manager.
57 */
58 docManager: IDocumentManager;
59 /**
60 * The application language translator.
61 */
62 translator?: ITranslator;
63 }
64}