///
import type { Socket } from 'net';
import type { Logger } from '../logging';
export declare class TelnetRequestPipeline {
client: Socket;
constructor(client: Socket);
private logger;
private commands;
isAtDebuggerPrompt: boolean;
get isProcessing(): boolean;
private activeCommand;
private emitter;
on(eventName: 'device-unresponsive', handler: (data: {
lastCommand: string;
}) => void): any;
on(eventName: 'console-output', handler: (data: string) => void): any;
on(eventName: 'unhandled-console-output', handler: (data: string) => void): any;
emit(eventName: 'console-output', data: string): any;
emit(eventName: 'unhandled-console-output', data: string): any;
emit(eventName: 'device-unresponsive', data: {
lastCommand: string;
}): any;
/**
* Start listening for future incoming data from the client
*/
connect(): void;
/**
* Any data that has not yet been fully processed. This could be a partial response
* during a command execute, or a message split across multiple telnet terminals
*/
unhandledText: string;
/**
* Stores split telnet messages for next call to `handleData`
*/
private buffer;
private handleData;
/**
* Send a command to the device immediately, without waiting for a response, and without worrying about
* whether we are currently at a debugger prompt. (This is mostly used for "pause" commands")
*/
write(commandText: string): void;
/**
* Used to help with logging
*/
private commandIdSequence;
/**
* Schedule a command to be run. Resolves with the result once the command finishes.
*/
executeCommand(commandText: string, options: {
waitForPrompt: boolean;
/**
* Should the command be inserted at the front? This means it will be the next command to execute
*/
insertAtFront?: boolean;
}): Promise;
private activeDeviceTimer;
private activeDeviceTimeout;
private setActiveDeviceTimer;
private clearActiveDeviceTimer;
/**
* Executes the next command if no commands are running. If a command is running, exits immediately as that command will call this function again when it's finished.
*/
executeNextCommand(): void;
destroy(): void;
}
export declare class TelnetCommand {
commandText: string;
/**
* Should this command wait for the next prompt?
*/
waitForPrompt: boolean;
pipeline: TelnetRequestPipeline;
id: number;
constructor(commandText: string,
/**
* Should this command wait for the next prompt?
*/
waitForPrompt: boolean, logger: Logger, pipeline: TelnetRequestPipeline, id: number);
logger: Logger;
private deferred;
/**
* Promise that completes when the command is finished
*/
get promise(): Promise;
get isCompleted(): boolean;
execute(): void;
/**
* Remove garbage from the response
*/
private removeJunk;
handleData(pipeline: TelnetRequestPipeline): void;
toJSON(): {
commandText: string;
id: number;
isCompleted: boolean;
waitForPrompt: boolean;
};
}