UNPKG

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