import { ZDLEConfig } from './types'; /** * Class that handles ZDLE encoding and decoding. * Encoding is subject to a given configuration--specifically, whether * we want to escape all control characters. Decoding is static; however * a given string is encoded we can always decode it. */ declare class ZmodemZDLE { _config: ZDLEConfig; _zdle_table?: number[]; _lastcode?: number; /** * Create a ZDLE encoder. * * @param {object} [config] - The initial configuration. * @param {object} config.escape_ctrl_chars - Whether the ZDLE encoder * should escape control characters. */ constructor(config?: ZDLEConfig); set_escape_ctrl_chars(value: boolean): void; /** * Whether or not control-character escaping is enabled. * * @return {boolean} Whether the escaping is on (true) or off (false). */ escapes_ctrl_chars(): boolean; /** * Encode an array of octet values and return it. * This will mutate the given array. * * @param {number[]} octets - The octet values to transform. * Each array member should be an 8-bit unsigned integer (0-255). * This object is mutated in the function. * * @returns {number[]} The passed-in array, transformed. This is the * same object that is passed in. */ encode(octets: number[]): number[]; /** * Decode an array of octet values and return it. * This will mutate the given array. * * @param {number[]} octets - The octet values to transform. * Each array member should be an 8-bit unsigned integer (0-255). * This object is mutated in the function. * * @returns {number[]} The passed-in array. * This is the same object that is passed in. */ static decode(octets: number[]): number[]; /** * Remove, ZDLE-decode, and return bytes from the passed-in array. * If the requested number of ZDLE-encoded bytes isn’t available, * then the passed-in array is unmodified (and the return is undefined). * * @param {number[]} octets - The octet values to transform. * Each array member should be an 8-bit unsigned integer (0-255). * This object is mutated in the function. * * @param {number} offset - The number of (undecoded) bytes to skip * at the beginning of the “octets” array. * * @param {number} count - The number of bytes (octet values) to return. * * @returns {number[]|undefined} An array with the requested number of * decoded octet values, or undefined if that number of decoded * octets isn’t available (given the passed-in offset). */ static splice(octets: number[], offset: number | undefined, count: number): number[] | undefined; _setup_zdle_table(): void; } export default ZmodemZDLE;