/** @packageDocumentation Binary data container used throughout taglib-ts for reading and writing byte sequences. */ /** * String encoding types matching TagLib's String::Type enum. */ export declare enum StringType { Latin1 = 0, UTF16 = 1, UTF16BE = 2, UTF8 = 3, UTF16LE = 4 } /** * A binary data container wrapping a Uint8Array, providing methods for * searching, manipulation, integer/float conversions, encoding, and comparison. * This is a TypeScript port of TagLib's ByteVector class. */ export declare class ByteVector { private _data; /** * Construct a ByteVector, optionally from an existing Uint8Array. * @param data - Source bytes. If omitted, creates an empty vector. * @param copy - When `true` (default) the data is copied; when `false` the * array is used directly (the caller must not mutate it afterwards). */ constructor(data?: Uint8Array, copy?: boolean); /** * Create a ByteVector from a raw `Uint8Array`. * @param data - Source byte array. * @param copy - Whether to copy the data (default `true`). * @returns A new ByteVector wrapping the given bytes. */ static fromByteArray(data: Uint8Array, copy?: boolean): ByteVector; static fromSize(size: number, fill?: number): ByteVector; static fromString(s: string, encoding?: StringType): ByteVector; static fromUint8Array(data: Uint8Array, copy?: boolean): ByteVector; static fromByteVector(other: ByteVector): ByteVector; get(index: number): number; set(index: number, value: number): void; get data(): Uint8Array; mid(index: number, length?: number): ByteVector; get length(): number; get isEmpty(): boolean; find(pattern: ByteVector, offset?: number, byteAlign?: number): number; rfind(pattern: ByteVector, offset?: number, byteAlign?: number): number; containsAt(pattern: ByteVector, offset: number, patternOffset?: number, patternLength?: number): boolean; startsWith(pattern: ByteVector): boolean; endsWith(pattern: ByteVector): boolean; /** * Checks whether the last bytes of this vector partially match the * beginning of `pattern`. Returns the index within this vector where the * partial match starts, or -1 if no partial match is found. */ endsWithPartialMatch(pattern: ByteVector): number; append(other: ByteVector | number): ByteVector; clear(): ByteVector; resize(size: number, padding?: number): ByteVector; /** * Replace bytes. Supports both single-byte replacement and pattern-based * replacement (ByteVector pattern → ByteVector replacement). */ replace(oldByte: number | ByteVector, newByte: number | ByteVector): ByteVector; /** * Read an unsigned integer from up to `maxBytes` bytes starting at * `offset`. When fewer bytes are available than requested, only the * available bytes contribute to the value (the remaining high-order bits * are zero). This matches the C++ TagLib behaviour for partial reads. */ private readUnsigned; /** * Same as readUnsigned but returns a BigInt, supporting up to 8 bytes. */ private readUnsignedBig; private static parseOffsetMsb; toInt(): number; toInt(msbFirst: boolean): number; toInt(offset: number, msbFirst?: boolean): number; toUInt(): number; toUInt(msbFirst: boolean): number; toUInt(offset: number, msbFirst?: boolean): number; toUInt(offset: number, length: number, msbFirst?: boolean): number; toShort(): number; toShort(msbFirst: boolean): number; toShort(offset: number, msbFirst?: boolean): number; toUShort(): number; toUShort(msbFirst: boolean): number; toUShort(offset: number, msbFirst?: boolean): number; toLongLong(): bigint; toLongLong(msbFirst: boolean): bigint; toLongLong(offset: number, msbFirst?: boolean): bigint; toULongLong(): bigint; toULongLong(msbFirst: boolean): bigint; toULongLong(offset: number, msbFirst?: boolean): bigint; static fromUInt(value: number, msbFirst?: boolean): ByteVector; static fromShort(value: number, msbFirst?: boolean): ByteVector; static fromUShort(value: number, msbFirst?: boolean): ByteVector; static fromLongLong(value: bigint, msbFirst?: boolean): ByteVector; static fromULongLong(value: bigint, msbFirst?: boolean): ByteVector; toFloat32BE(offset: number): number; toFloat32LE(offset: number): number; toFloat64BE(offset: number): number; toFloat64LE(offset: number): number; /** * Decode an 80-bit IEEE 754 extended-precision float (big-endian). * Layout: 1 sign bit, 15 exponent bits, 64 mantissa bits (with explicit * integer bit). */ toFloat80BE(offset: number): number; /** * Decode an 80-bit IEEE 754 extended-precision float (little-endian). */ toFloat80LE(offset: number): number; static fromFloat32BE(value: number): ByteVector; static fromFloat32LE(value: number): ByteVector; static fromFloat64BE(value: number): ByteVector; static fromFloat64LE(value: number): ByteVector; /** * Return a new ByteVector where each byte is represented as two ASCII hex * characters (lowercase). */ toHex(): ByteVector; /** * Base64-encode this vector's bytes and return the result as a new * ByteVector containing the ASCII base64 text. */ toBase64(): ByteVector; /** * Decode a base64-encoded ByteVector. Returns an empty ByteVector on * invalid input. */ static fromBase64(input: ByteVector): ByteVector; equals(other: ByteVector): boolean; /** Lexicographic less-than comparison. */ lessThan(other: ByteVector): boolean; /** * Convert the byte data to a string using the given encoding. */ toString(encoding?: StringType): string; [Symbol.iterator](): Generator; } //# sourceMappingURL=byteVector.d.ts.map