UNPKG

2.01 kBTypeScriptView Raw
1import { ServiceManager } from '@jupyterlab/services';
2import { ITranslator } from '@jupyterlab/translation';
3import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
4/**
5 * A VDomRenderer for a RunningSessions status item.
6 */
7export declare class RunningSessions extends VDomRenderer<RunningSessions.Model> {
8 /**
9 * Create a new RunningSessions widget.
10 */
11 constructor(opts: RunningSessions.IOptions);
12 /**
13 * Render the running sessions widget.
14 */
15 render(): JSX.Element | null;
16 /**
17 * Dispose of the status item.
18 */
19 dispose(): void;
20 /**
21 * Set the number of kernel sessions when the list changes.
22 */
23 private _onSessionsRunningChanged;
24 /**
25 * Set the number of terminal sessions when the list changes.
26 */
27 private _onTerminalsRunningChanged;
28 protected translator: ITranslator;
29 private _trans;
30 private _handleClick;
31 private _serviceManager;
32}
33/**
34 * A namespace for RunningSessions statics.
35 */
36export declare namespace RunningSessions {
37 /**
38 * A VDomModel for the RunningSessions status item.
39 */
40 class Model extends VDomModel {
41 /**
42 * The number of active kernel sessions.
43 */
44 get sessions(): number;
45 set sessions(sessions: number);
46 /**
47 * The number of active terminal sessions.
48 */
49 get terminals(): number;
50 set terminals(terminals: number);
51 private _terminals;
52 private _sessions;
53 }
54 /**
55 * Options for creating a RunningSessions item.
56 */
57 interface IOptions {
58 /**
59 * The application service manager.
60 */
61 serviceManager: ServiceManager.IManager;
62 /**
63 * A click handler for the item. By default this is used
64 * to activate the running sessions side panel.
65 */
66 onClick: () => void;
67 /**
68 * The application language translator.
69 */
70 translator?: ITranslator;
71 }
72}