UNPKG

2.06 kBTypeScriptView Raw
1/// <reference types="react" />
2import { VDomModel, VDomRenderer } from '@jupyterlab/apputils';
3import { Widget } from '@lumino/widgets';
4import { IDocumentManager } from './tokens';
5/**
6 * A status bar item for the current file path (or activity name).
7 */
8export declare class PathStatus extends VDomRenderer<PathStatus.Model> {
9 /**
10 * Construct a new PathStatus status item.
11 */
12 constructor(opts: PathStatus.IOptions);
13 /**
14 * Render the status item.
15 */
16 render(): JSX.Element;
17}
18/**
19 * A namespace for PathStatus statics.
20 */
21export declare namespace PathStatus {
22 /**
23 * A VDomModel for rendering the PathStatus status item.
24 */
25 class Model extends VDomModel {
26 /**
27 * Construct a new model.
28 *
29 * @param docManager: the application document manager. Used to check
30 * whether the current widget is a document.
31 */
32 constructor(docManager: IDocumentManager);
33 /**
34 * The current path for the application.
35 */
36 get path(): string;
37 /**
38 * The name of the current activity.
39 */
40 get name(): string;
41 /**
42 * The current widget for the application.
43 */
44 get widget(): Widget | null;
45 set widget(widget: Widget | null);
46 /**
47 * React to a title change for the current widget.
48 */
49 private _onTitleChange;
50 /**
51 * React to a path change for the current document.
52 */
53 private _onPathChange;
54 /**
55 * Get the current state of the model.
56 */
57 private _getAllState;
58 /**
59 * Trigger a state change to rerender.
60 */
61 private _triggerChange;
62 private _path;
63 private _name;
64 private _widget;
65 private _docManager;
66 }
67 /**
68 * Options for creating the PathStatus widget.
69 */
70 interface IOptions {
71 /**
72 * The application document manager.
73 */
74 docManager: IDocumentManager;
75 }
76}