UNPKG

2.31 kBTypeScriptView Raw
1import { Token } from '@lumino/coreutils';
2import { IDisposable } from '@lumino/disposable';
3import { ISignal } from '@lumino/signaling';
4import { JupyterFrontEnd } from './frontend';
5/**
6 * The application status token.
7 */
8export declare const ILabStatus: Token<ILabStatus>;
9/**
10 * An interface for JupyterLab-like application status functionality.
11 */
12export interface ILabStatus {
13 /**
14 * A signal for when application changes its busy status.
15 */
16 readonly busySignal: ISignal<JupyterFrontEnd<any, any>, boolean>;
17 /**
18 * A signal for when application changes its dirty status.
19 */
20 readonly dirtySignal: ISignal<JupyterFrontEnd<any, any>, boolean>;
21 /**
22 * Whether the application is busy.
23 */
24 readonly isBusy: boolean;
25 /**
26 * Whether the application is dirty.
27 */
28 readonly isDirty: boolean;
29 /**
30 * Set the application state to busy.
31 *
32 * @returns A disposable used to clear the busy state for the caller.
33 */
34 setBusy(): IDisposable;
35 /**
36 * Set the application state to dirty.
37 *
38 * @returns A disposable used to clear the dirty state for the caller.
39 */
40 setDirty(): IDisposable;
41}
42/**
43 * The application status signals and flags class.
44 */
45export declare class LabStatus implements ILabStatus {
46 /**
47 * Construct a new status object.
48 */
49 constructor(app: JupyterFrontEnd<any, any>);
50 /**
51 * Returns a signal for when application changes its busy status.
52 */
53 get busySignal(): ISignal<JupyterFrontEnd, boolean>;
54 /**
55 * Returns a signal for when application changes its dirty status.
56 */
57 get dirtySignal(): ISignal<JupyterFrontEnd, boolean>;
58 /**
59 * Whether the application is busy.
60 */
61 get isBusy(): boolean;
62 /**
63 * Whether the application is dirty.
64 */
65 get isDirty(): boolean;
66 /**
67 * Set the application state to dirty.
68 *
69 * @returns A disposable used to clear the dirty state for the caller.
70 */
71 setDirty(): IDisposable;
72 /**
73 * Set the application state to busy.
74 *
75 * @returns A disposable used to clear the busy state for the caller.
76 */
77 setBusy(): IDisposable;
78 private _busyCount;
79 private _busySignal;
80 private _dirtyCount;
81 private _dirtySignal;
82}