/** * An abstract class that wraps a "bytes" value, such as a Buffer value in Node.js or an ArrayBuffer in the browser. * Its purpose is to create a layer of compatibility for code that should be used both in Node.js and in the browser. */ export declare abstract class BytesView { protected _buffer: T; /** * The constructor of [[BytesView]] * @param _buffer The buffer that should be wrapped. */ constructor(_buffer: T); /** * Returns the buffer. * @returns The buffer. */ get buffer(): T; /** * Sets the buffer. * @param value The buffer that will be assigned. */ set buffer(value: T); /** * Returns the length of the buffer. * @returns The length of the buffer. */ abstract get length(): number; /** * Returns a new [[BytesView]] instance given a string or an array of numbers. * @param value The value that will be converted into a [[BytesView]] instance. * @returns A new [[BytesView]] instance. */ from(value: string | number[]): BytesView; /** * Returns a new [[BytesView]] instance given a string. * @param value The value that will be converted into a [[BytesView]] instance. * @returns A new [[BytesView]] instance. */ protected abstract fromString(str: string): BytesView; /** * Returns a new [[BytesView]] instance given an array of numbers. * @param arr The array that will be converted into a [[BytesView]] instance. * @returns A new [[BytesView]] instance. */ protected abstract fromArray(arr: number[]): BytesView; abstract alloc(sizeInBytes: number): BytesView; abstract slice(start?: number, end?: number): BytesView; abstract readUint8(offset?: number): number; abstract readUint16LE(offset?: number): number; abstract readUint16BE(offset?: number): number; abstract readUint32LE(offset?: number): number; abstract readUint32BE(offset?: number): number; abstract readInt8(offset?: number): number; abstract readInt16LE(offset?: number): number; abstract readInt16BE(offset?: number): number; abstract readInt32LE(offset?: number): number; abstract readInt32BE(offset?: number): number; abstract write(value: string, offset?: number): number; abstract writeUint8(value: number, offset?: number): number; abstract toString(): string; }