UNPKG

2.27 kBTypeScriptView Raw
1import { IObservableDisposable } from '@lumino/disposable';
2import { ISignal } from '@lumino/signaling';
3import { ServerConnection } from './serverconnection';
4/**
5 * Object which manages kernel instances for a given base url.
6 *
7 * #### Notes
8 * The manager is responsible for maintaining the state of kernel specs.
9 */
10export interface IManager extends IObservableDisposable {
11 /**
12 * A signal emitted when there is a connection failure.
13 */
14 connectionFailure: ISignal<IManager, ServerConnection.NetworkError>;
15 /**
16 * The server settings for the manager.
17 */
18 readonly serverSettings: ServerConnection.ISettings;
19 /**
20 * Whether the manager is ready.
21 */
22 readonly isReady: boolean;
23 /**
24 * A promise that resolves when the manager is initially ready.
25 */
26 readonly ready: Promise<void>;
27 /**
28 * Whether the manager is active.
29 */
30 readonly isActive: boolean;
31}
32export declare abstract class BaseManager implements IManager {
33 constructor(options: BaseManager.IOptions);
34 /**
35 * A signal emitted when the delegate is disposed.
36 */
37 get disposed(): ISignal<this, void>;
38 /**
39 * A signal emitted when there is a connection failure.
40 */
41 abstract connectionFailure: ISignal<this, Error>;
42 /**
43 * Test whether the delegate has been disposed.
44 */
45 get isDisposed(): boolean;
46 /**
47 * Test whether the manager is ready.
48 */
49 abstract isReady: boolean;
50 /**
51 * A promise that fulfills when the manager is ready.
52 */
53 abstract ready: Promise<void>;
54 /**
55 * Whether the manager is active.
56 */
57 get isActive(): boolean;
58 /**
59 * Dispose of the delegate and invoke the callback function.
60 */
61 dispose(): void;
62 /**
63 * The server settings of the manager.
64 */
65 readonly serverSettings: ServerConnection.ISettings;
66 private _isDisposed;
67 private _disposed;
68}
69/**
70 * The namespace for `BaseManager` class statics.
71 */
72export declare namespace BaseManager {
73 /**
74 * The options used to initialize a SessionManager.
75 */
76 interface IOptions {
77 /**
78 * The server settings for the manager.
79 */
80 serverSettings?: ServerConnection.ISettings;
81 }
82}