import { IIterator } from '@phosphor/algorithm'; import { ISignal } from '@phosphor/signaling'; import { ServerConnection } from '..'; import { Kernel } from './kernel'; /** * An implementation of a kernel manager. */ export declare class KernelManager implements Kernel.IManager { /** * Construct a new kernel manager. * * @param options - The default options for kernel. */ constructor(options?: KernelManager.IOptions); /** * A signal emitted when the specs change. */ readonly specsChanged: ISignal; /** * A signal emitted when the running kernels change. */ readonly runningChanged: ISignal; /** * Test whether the terminal manager is disposed. */ readonly isDisposed: boolean; /** * Dispose of the resources used by the manager. */ dispose(): void; /** * The server settings for the manager. */ readonly serverSettings: ServerConnection.ISettings; /** * Get the most recently fetched kernel specs. */ readonly specs: Kernel.ISpecModels | null; /** * Test whether the manager is ready. */ readonly isReady: boolean; /** * A promise that fulfills when the manager is ready. */ readonly ready: Promise; /** * Create an iterator over the most recent running kernels. * * @returns A new iterator over the running kernels. */ running(): IIterator; /** * Force a refresh of the specs from the server. * * @returns A promise that resolves when the specs are fetched. * * #### Notes * This is intended to be called only in response to a user action, * since the manager maintains its internal state. */ refreshSpecs(): Promise; /** * Force a refresh of the running kernels. * * @returns A promise that with the list of running sessions. * * #### Notes * This is not typically meant to be called by the user, since the * manager maintains its own internal state. */ refreshRunning(): Promise; /** * Start a new kernel. * * @param options - The kernel options to use. * * @returns A promise that resolves with the kernel instance. * * #### Notes * The manager `serverSettings` will be always be used. */ startNew(options?: Kernel.IOptions): Promise; /** * Find a kernel by id. * * @param id - The id of the target kernel. * * @returns A promise that resolves with the kernel's model. */ findById(id: string): Promise; /** * Connect to an existing kernel. * * @param model - The model of the target kernel. * * @returns A promise that resolves with the new kernel instance. */ connectTo(model: Kernel.IModel): Kernel.IKernel; /** * Shut down a kernel by id. * * @param id - The id of the target kernel. * * @returns A promise that resolves when the operation is complete. * * #### Notes * This will emit [[runningChanged]] if the running kernels list * changes. */ shutdown(id: string): Promise; /** * Shut down all kernels. * * @returns A promise that resolves when all of the kernels are shut down. */ shutdownAll(): Promise; /** * Handle a kernel terminating. */ private _onTerminated; /** * Handle a kernel starting. */ private _onStarted; /** * Refresh the specs. */ private _refreshSpecs; /** * Refresh the running sessions. */ private _refreshRunning; private _models; private _kernels; private _specs; private _isDisposed; private _modelsTimer; private _specsTimer; private _readyPromise; private _isReady; private _specsChanged; private _runningChanged; } /** * The namespace for `KernelManager` class statics. */ export declare namespace KernelManager { /** * The options used to initialize a KernelManager. */ interface IOptions { /** * The server settings for the manager. */ serverSettings?: ServerConnection.ISettings; } }