import { IIterator } from '@phosphor/algorithm'; import { ISignal } from '@phosphor/signaling'; import { ServerConnection } from '..'; import { TerminalSession } from './terminal'; /** * A terminal session manager. */ export declare class TerminalManager implements TerminalSession.IManager { /** * Construct a new terminal manager. */ constructor(options?: TerminalManager.IOptions); /** * A signal emitted when the running terminals change. */ readonly runningChanged: ISignal; /** * Test whether the terminal manager is disposed. */ readonly isDisposed: boolean; /** * The server settings of the manager. */ readonly serverSettings: ServerConnection.ISettings; /** * Test whether the manager is ready. */ readonly isReady: boolean; /** * Dispose of the resources used by the manager. */ dispose(): void; /** * A promise that fulfills when the manager is ready. */ readonly ready: Promise; /** * Whether the terminal service is available. */ isAvailable(): boolean; /** * Create an iterator over the most recent running terminals. * * @returns A new iterator over the running terminals. */ running(): IIterator; /** * Create a new terminal session. * * @param options - The options used to connect to the session. * * @returns A promise that resolves with the terminal instance. * * #### Notes * The manager `serverSettings` will be used unless overridden in the * options. */ startNew(options?: TerminalSession.IOptions): Promise; connectTo(name: string, options?: TerminalSession.IOptions): Promise; /** * Shut down a terminal session by name. */ shutdown(name: string): Promise; /** * Shut down all terminal sessions. * * @returns A promise that resolves when all of the sessions are shut down. */ shutdownAll(): Promise; /** * Force a refresh of the running sessions. * * @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; /** * Handle a session terminating. */ private _onTerminated; /** * Handle a session starting. */ private _onStarted; /** * Refresh the running sessions. */ private _refreshRunning; /** * Get a set of options to pass. */ private _getOptions; private _models; private _sessions; private _isDisposed; private _isReady; private _refreshTimer; private _readyPromise; private _runningChanged; } /** * The namespace for TerminalManager statics. */ export declare namespace TerminalManager { /** * The options used to initialize a terminal manager. */ interface IOptions { /** * The server settings used by the manager. */ serverSettings?: ServerConnection.ISettings; } }