import type { EnumTree } from '../interfaces/index.js'; export declare class Buffer { _buffer: Uint8Array; _bytesReadSinceCreation: number; _lastByteRead: Uint8Array | undefined; _currentByteRead: Uint8Array | undefined; constructor(buffer?: Uint8Array); /** * The length of the stored buffer. */ get length(): number; /** * Boolean indicating whether the length of the stored buffer is even (`true`) or odd (`false`). */ get lengthIsEven(): boolean; /** * The number of bytes read since the creation of the buffer. (Does not include peeked bytes). */ get bytesReadSinceCreation(): number; /** * The last byte that was read by the buffer. */ get lastByteRead(): Uint8Array | undefined; _updateLastReadByte(currentByte: Uint8Array): void; /** * Have a peek at the first `bytes` number of bytes of the stored buffer without modifying the buffer. * @param bytes The number of bytes to peek into the buffer by. * @returns A new Uint8Array containing the peeked bytes. */ peek(bytes: number): Uint8Array; /** * Read the first `bytes` number of bytes of the stored buffer, removing those bytes from the buffer in the process. * @param bytes The number of bytes to read into the buffer by. * @returns A new Uint8Array containing the read bytes. */ read(bytes: number): Uint8Array; /** * Remove the first `bytes` number of bytes from the stored buffer, "advancing" the position of the buffer. * @param bytes The number of bytes to advance the buffer by. */ advance(bytes: number): void; /** * Add another buffer on to the end of the stored buffer. Similar to `Array.[prototype].push()`. * @param buffer The new buffer to be appended. */ append(buffer: Uint8Array): void; /** * Clones the contents of the stored buffer. * @returns The cloned buffer. */ clone(): Uint8Array; /** * Clears the contents of the stored buffer. */ clear(): void; /** * Inverts the endianness of the stored buffer. * @param bytes The number of bytes to invert (optional, but must be even). * @returns A copy of the now inverted buffer. */ invertEndianness(bytes?: number): Uint8Array; /** * Recursively parse the stored buffer into an Enum Tree. * @returns An Enum Tree. */ parse(): EnumTree; /** * Resursively parse buffer enumerators by field type to produce an Enum Tree. * @param parent The parent object (trunk) of the current branch. * @param length The length of the branch (number of enumerators to process, optional). * @returns The number of bytes processed by the branch. */ _branch(parent: EnumTree, length?: number): number; } //# sourceMappingURL=Buffer.d.ts.map