import { ByteVector } from "../../byteVector"; import { Frame, FrameClassType } from "./frame"; import { Id3v2FrameHeader } from "./frameHeader"; /** * This class extends {@link Frame} implementing support for ID3v2 private (PRIV) frames. * A PrivateFrame should be used for storing values specific to the application that cannot or * should not be stored in another frame type. */ export default class PrivateFrame extends Frame { private _owner; private _privateData; private constructor(); /** * Constructs and initializes a new instance with the provided owner * @param owner Owner of the private frame */ static fromOwner(owner: string): PrivateFrame; /** * 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): PrivateFrame; /** * 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): PrivateFrame; /** @inheritDoc */ get frameClassType(): FrameClassType; /** * Gets the owner of the current instance. * There should only be one frame with a given owner per tag. */ get owner(): string; /** * Gets the private data stored in the current instance. */ get privateData(): ByteVector; /** * Sets the private data stored in the current instance. * @param value Private data to store in the current instance */ set privateData(value: ByteVector); /** * Get a specified private frame from the list of private frames that matches the provided * parameters. * @param frames List of frames to search * @param owner Owner to match when searching * @returns Matching frame or `undefined` if a match was not found */ static find(frames: PrivateFrame[], owner: string): PrivateFrame; /** @inheritDoc */ clone(): Frame; /** @inheritDoc */ protected parseFields(data: ByteVector): void; /** @inheritDoc */ protected renderFields(version: number): ByteVector; }