UNPKG

2.37 kBTypeScriptView Raw
1import { Poll } from '@lumino/polling';
2import { ISignal } from '@lumino/signaling';
3import { ServerConnection } from '../serverconnection';
4import * as KernelSpec from './kernelspec';
5import * as restapi from './restapi';
6import { BaseManager } from '../basemanager';
7/**
8 * An implementation of a kernel spec manager.
9 */
10export declare class KernelSpecManager extends BaseManager implements KernelSpec.IManager {
11 /**
12 * Construct a new kernel spec manager.
13 *
14 * @param options - The default options for kernel.
15 */
16 constructor(options?: KernelSpecManager.IOptions);
17 /**
18 * The server settings for the manager.
19 */
20 readonly serverSettings: ServerConnection.ISettings;
21 /**
22 * Test whether the manager is ready.
23 */
24 get isReady(): boolean;
25 /**
26 * A promise that fulfills when the manager is ready.
27 */
28 get ready(): Promise<void>;
29 /**
30 * Get the most recently fetched kernel specs.
31 */
32 get specs(): restapi.ISpecModels | null;
33 /**
34 * A signal emitted when the specs change.
35 */
36 get specsChanged(): ISignal<this, restapi.ISpecModels>;
37 /**
38 * A signal emitted when there is a connection failure.
39 */
40 get connectionFailure(): ISignal<this, Error>;
41 /**
42 * Dispose of the resources used by the manager.
43 */
44 dispose(): void;
45 /**
46 * Force a refresh of the specs from the server.
47 *
48 * @returns A promise that resolves when the specs are fetched.
49 *
50 * #### Notes
51 * This is intended to be called only in response to a user action,
52 * since the manager maintains its internal state.
53 */
54 refreshSpecs(): Promise<void>;
55 /**
56 * Execute a request to the server to poll specs and update state.
57 */
58 protected requestSpecs(): Promise<void>;
59 private _isReady;
60 private _connectionFailure;
61 private _pollSpecs;
62 private _ready;
63 private _specs;
64 private _specsChanged;
65}
66/**
67 * The namespace for `KernelManager` class statics.
68 */
69export declare namespace KernelSpecManager {
70 /**
71 * The options used to initialize a KernelManager.
72 */
73 interface IOptions extends BaseManager.IOptions {
74 /**
75 * When the manager stops polling the API. Defaults to `when-hidden`.
76 */
77 standby?: Poll.Standby | (() => boolean | Poll.Standby);
78 }
79}
80
\No newline at end of file