UNPKG

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