1 | import { ITranslator } from '@jupyterlab/translation';
|
2 | import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
|
3 | import { KeyboardEvent } from 'react';
|
4 | import { ISessionContext } from './sessioncontext';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export declare function translateKernelStatuses(translator?: ITranslator): Record<ISessionContext.KernelDisplayStatus, string>;
|
13 |
|
14 |
|
15 |
|
16 | export declare class KernelStatus extends VDomRenderer<KernelStatus.Model> {
|
17 | |
18 |
|
19 |
|
20 | constructor(opts: KernelStatus.IOptions, translator?: ITranslator);
|
21 | /**
|
22 | * Render the kernel status item.
|
23 | */
|
24 | render(): JSX.Element | null;
|
25 | translator: ITranslator;
|
26 | private _handleClick;
|
27 | private _handleKeyDown;
|
28 | }
|
29 | /**
|
30 | * A namespace for KernelStatus statics.
|
31 | */
|
32 | export declare namespace KernelStatus {
|
33 | |
34 |
|
35 |
|
36 | class Model extends VDomModel {
|
37 | constructor(translator?: ITranslator);
|
38 | /**
|
39 | * The name of the kernel.
|
40 | */
|
41 | get kernelName(): string;
|
42 | /**
|
43 | * The current status of the kernel.
|
44 | */
|
45 | get status(): string | undefined;
|
46 | /**
|
47 | * A display name for the activity.
|
48 | */
|
49 | get activityName(): string;
|
50 | set activityName(val: string);
|
51 | /**
|
52 | * The current client session associated with the kernel status indicator.
|
53 | */
|
54 | get sessionContext(): ISessionContext | null;
|
55 | set sessionContext(sessionContext: ISessionContext | null);
|
56 | /**
|
57 | * React to changes to the kernel status.
|
58 | */
|
59 | private _onKernelStatusChanged;
|
60 | /**
|
61 | * React to changes in the kernel.
|
62 | */
|
63 | private _onKernelChanged;
|
64 | private _getAllState;
|
65 | private _triggerChange;
|
66 | protected translation: ITranslator;
|
67 | private _trans;
|
68 | private _activityName;
|
69 | private _kernelName;
|
70 | private _kernelStatus;
|
71 | private _sessionContext;
|
72 | private readonly _statusNames;
|
73 | }
|
74 | /**
|
75 | * Options for creating a KernelStatus object.
|
76 | */
|
77 | interface IOptions {
|
78 | |
79 |
|
80 |
|
81 |
|
82 | onClick: () => void;
|
83 | |
84 |
|
85 |
|
86 |
|
87 | onKeyDown: (event: KeyboardEvent<HTMLImageElement>) => void;
|
88 | }
|
89 | }
|