@microsoft/dev-tunnels-ssh-tcp
Version:
SSH TCP extensions library for Dev Tunnels
64 lines • 3.49 kB
TypeScript
import { SshChannel } from '@microsoft/dev-tunnels-ssh';
import { ForwardedPort } from './forwardedPort';
import { ForwardedPortChannelEventArgs, ForwardedPortEventArgs } from './forwardedPortEventArgs';
/**
* Tracks the list of ports that are currently being forwarded between the SSH client and server,
* along with the set of channel connections for each forwarded port.
*
* Ports forwarded in either direction (client->server or server->client) are tracked in separate
* collections. Typically within a session the forwarding is done only in one direction, though
* the protocol supports bi-directional forwarding.
*
* @see PortForwardingService.RemoteForwardedPorts
* @see PortForwardingService.LocalForwardedPorts
*/
export declare class ForwardedPortsCollection implements ReadonlySet<ForwardedPort> {
/**
* Maintains a mapping from port keys to port objects and channels for the port.
*
* The ForwardedPort string representation is used as the keys.
*/
private portChannelMap;
/** Gets the number of ports in the collection. */
get size(): number;
/** Checks whether a port is in the collection. */
has(port: ForwardedPort): boolean;
/** Lists all the ports in the collection. */
values(): IterableIterator<ForwardedPort>;
/** Iterates over all the ports in the collection. */
[Symbol.iterator](): IterableIterator<ForwardedPort>;
/** Lists all the ports in the collection. */
entries(): IterableIterator<[ForwardedPort, ForwardedPort]>;
/**
* Lists all the ports in the collection.
* (In a set, the keys are the same as the values.)
*/
keys(): IterableIterator<ForwardedPort>;
/** Iterates over all the ports in the collection, invoking a callback function on each. */
forEach(callbackfn: (value: ForwardedPort, key: ForwardedPort, set: ReadonlySet<ForwardedPort>) => void, thisArg?: any): void;
getChannels(port: ForwardedPort): SshChannel[];
private readonly portAddedEmitter;
/** Event raised when a port is added to the collection. */
readonly onPortAdded: import("vscode-jsonrpc").Event<ForwardedPortEventArgs>;
private readonly portUpdatedEmitter;
/**
* Event raised when a port in the collection is updated. "Updating" a port doesn't
* change anything at the SSH protocol level, but the application may use this event
* as a signal to update or refresh its state for the forwarded port.
*/
readonly onPortUpdated: import("vscode-jsonrpc").Event<ForwardedPortEventArgs>;
private readonly portRemovedEmitter;
/** Event raised when a port is removed from the collection. */
readonly onPortRemoved: import("vscode-jsonrpc").Event<ForwardedPortEventArgs>;
private readonly portChannelAddedEmitter;
/** Event raised when a channel is added to the collection. */
readonly onPortChannelAdded: import("vscode-jsonrpc").Event<ForwardedPortChannelEventArgs>;
private readonly portChannelRemovedEmitter;
/** Event raised when a channel is removed from the collection. */
readonly onPortChannelRemoved: import("vscode-jsonrpc").Event<ForwardedPortChannelEventArgs>;
/** Finds the first port in the collection that matches a predicate. */
find(predicate: (port: ForwardedPort) => boolean): ForwardedPort | undefined;
private tryRemoveChannel;
toString(): string;
}
//# sourceMappingURL=forwardedPortsCollection.d.ts.map