/** A class for writing EO data to a sequence of bytes. */ export declare class EoWriter { private data; private _length; private _stringSanitizationMode; /** * Adds a raw byte to the writer data. * * @param value - the byte to add * @throws `Error` if the value is above `0xFF`. */ addByte(value: number): void; /** * Adds an array of raw bytes to the writer data. * * @param bytes - the array of bytes to add */ addBytes(bytes: Uint8Array): void; /** * Adds an encoded 1-byte integer to the writer data. * * @param char - the number to encode and add * @throws `Error` if the value is not below {@link CHAR_MAX}. */ addChar(char: number): void; /** * Adds an encoded 2-byte integer to the writer data. * * @param short - the number to encode and add * @throws `Error` if the value is not below {@link SHORT_MAX}. */ addShort(short: number): void; /** * Adds an encoded 3-byte integer to the writer data. * * @param three - the number to encode and add * @throws `Error` if the value is not below {@link THREE_MAX}. */ addThree(three: number): void; /** * Adds an encoded 4-byte integer to the writer data. * * @param int - the number to encode and add * @throws `Error` if the value is not below {@link INT_MAX}. */ addInt(int: number): void; /** * Adds a string to the writer data. * * @param str - the string to be added */ addString(str: string): void; /** * Adds a fixed-length string to the writer data. * * @param str - the string to be added * @param length - the expected length of the string * @param padded - true if the string should be padded to the length with trailing `0xFF` * bytes. * @throws `Error` if the string does not have the expected length */ addFixedString(str: string, length: number, padded?: boolean): void; /** * Adds an encoded string to the writer data. * * @param str - the string to encoded and added */ addEncodedString(str: string): void; /** * Adds a fixed-length encoded string to the writer data. * * @param str - the string to be encoded and added * @param length - the expected length of the string * @param padded - true if the string should be padded to the length with trailing `0xFF` * bytes * @throws `Error` if the string does not have the expected length */ addFixedEncodedString(str: string, length: number, padded?: boolean): void; /** * Sets the string sanitization mode for the writer. * *
With string sanitization enabled, the writer will switch `0xFF` bytes in strings (ΓΏ) * to `0x79` (y). * * @param stringSanitizationMode - the new string sanitization mode */ set stringSanitizationMode(stringSanitizationMode: boolean); /** * Gets the string sanitization mode for the writer * * @returns True if string sanitization is enabled */ get stringSanitizationMode(): boolean; /** * Gets the length of the writer data. * * @returns The length of the writer data */ get length(): number; /** * Gets the writer data as a byte array. * * @returns A copy of the writer data as a byte array */ toByteArray(): Uint8Array; private doAddBytes; private expand; private sanitizeString; private static addPadding; private static checkNumberSize; private static checkStringLength; private static encodeAnsi; } //# sourceMappingURL=eo-writer.d.ts.map