import { Poll } from '@difizen/libro-common'; import { ServerConnection } from '@difizen/libro-kernel'; import type { Disposable, Disposed, Event } from '@difizen/mana-app'; import { Emitter } from '@difizen/mana-app'; import type { TerminalConnection } from './connection.js'; import type { TerminalModel, TerminalOption } from './protocol.js'; import { TerminalConnectionFactory } from './protocol.js'; import { TerminalRestAPI } from './restapi.js'; export declare class TerminalManager implements Disposable, Disposed { disposed: boolean; protected _isReady: boolean; protected _pollModels: Poll; protected _terminalConnections: Set; protected _ready: Promise; protected _runningChanged: Emitter; protected _connectionFailure: Emitter; terminalOptionsCache: Map; protected _names: string[]; protected get _models(): TerminalModel[]; terminalRestAPI: TerminalRestAPI; terminalConnectionFactory: TerminalConnectionFactory; serverConnection: ServerConnection; /** * Construct a new terminal manager. */ constructor(serverConnection: ServerConnection); /** * The server settings of the manager. */ get serverSettings(): import("@difizen/libro-kernel").ISettings; /** * Test whether the manager is ready. */ get isReady(): boolean; /** * A promise that fulfills when the manager is ready. */ get ready(): Promise; /** * A signal emitted when the running terminals change. */ get runningChanged(): Event; /** * A signal emitted when there is a connection failure. */ get connectionFailure(): Event; /** * Dispose of the resources used by the manager. */ dispose(): void; connectTo(options: { name: string; }): TerminalConnection; /** * Create an iterator over the most recent running terminals. * * @returns A new iterator over the running terminals. */ running(): IterableIterator; get runningModels(): string[]; /** * Force a refresh of the running terminals. * * @returns A promise that with the list of running terminals. * * #### Notes * This is intended to be called only in response to a user action, * since the manager maintains its internal state. */ refreshRunning(): Promise; /** * Create a new terminal session. * * @param options - The options used to create the terminal. * * @returns A promise that resolves with the terminal connection instance. * * #### Notes * The manager `serverSettings` will be used unless overridden in the * options. */ startNew(options: TerminalOption): 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; /** * Execute a request to the server to poll running terminals and update state. */ requestRunning(): Promise; /** * Handle a session starting. */ protected _onStarted(terminalConnection: TerminalConnection): void; /** * Handle a session terminating. */ protected _onDisposed(terminalConnection: TerminalConnection): void; getOrCreate: (options: TerminalOption) => Promise; getTerminalArgs: (name?: string) => any; } //# sourceMappingURL=manager.d.ts.map