/** * Type definitions for telnet-stream 1.0.5 * Author: Voakie */ declare module "telnet-stream" { import { Socket, SocketConnectOpts, AddressInfo } from "net"; import { Transform, TransformOptions } from "stream"; export interface TelnetSocketOptions { bufferSize?: number; errorPolicy?: "keepBoth" | "keepData" | "discardBoth"; } export interface TelnetInputOptions extends TransformOptions, TelnetSocketOptions {} /** * TelnetSocket is a decorator for a net.Socket object. Incoming TELNET commands, options, and negotiations are emitted as events. Non-TELNET data is passed through without changes. */ export class TelnetSocket { constructor(socket: Socket, options?: TelnetSocketOptions); /** * When the remote system issues a TELNET command that is not option * negotiation, TelnetSocket will emit a 'command' event. * * ```js * var tSocket = new TelnetSocket(socket); * tSocket.on('command', function(command) { * // Received: IAC - See RFC 854 * }); * ``` */ on(name: "command", callback: (command: number) => void): void; /** * When the remote system wants to request that the local system * perform some function or obey some protocol, TelnetSocket will * emit a 'do' event: * * ```js * var tSocket = new TelnetSocket(socket); * tSocket.on('do', function(option) { * // Received: IAC DO