import { ByteVector } from "../../byteVector"; import { Frame, FrameClassType } from "./frame"; import { Id3v2FrameHeader } from "./frameHeader"; /** * Implements support for ID3v2 Unique File Identifier (UFID) frames. */ export default class UniqueFileIdentifierFrame extends Frame { private _identifier; private _owner; private constructor(); /** * Constructs and initializes a new instance using the provided information * @param owner Owner of the new frame. Should be an email or url to the database where this * unique identifier is applicable * @param identifier Unique identifier to store in the frame. Must be no more than 64 bytes */ static fromData(owner: string, identifier: ByteVector): UniqueFileIdentifierFrame; /** * Constructs and initializes a new instance by reading its raw data in a specified ID3v2 * version. This method allows for offset reading from the data byte vector. * @param data Raw representation of the new frame * @param offset What offset in `data` the frame actually begins. Must be positive, * safe integer * @param header Header of the frame found at `data` in the data * @param version ID3v2 version the frame was originally encoded with */ static fromOffsetRawData(data: ByteVector, offset: number, header: Id3v2FrameHeader, version: number): UniqueFileIdentifierFrame; /** * Constructs and initializes a new instance by reading its raw data in a specified * ID3v2 version. * @param data Raw representation of the new frame * @param version ID3v2 version the raw frame is encoded with, must be a positive 8-bit integer */ static fromRawData(data: ByteVector, version: number): UniqueFileIdentifierFrame; /** @inheritDoc */ get frameClassType(): FrameClassType; /** * Gets the owner of this unique ID. */ get owner(): string; /** * Gets the identifier data stored in the current instance. */ get identifier(): ByteVector; /** * Sets the identifier data stored in the current instance. */ set identifier(value: ByteVector); /** * Gets a unique file identifier frame from a list of frames * @param frames List of frames to search * @param owner Owner to match * @returns Frame containing the matching user, `undefined` if a match was not found */ static find(frames: UniqueFileIdentifierFrame[], owner: string): UniqueFileIdentifierFrame; /** @inheritDoc */ clone(): Frame; /** @inheritDoc */ protected parseFields(data: ByteVector): void; /** @inheritDoc */ protected renderFields(): ByteVector; }