import { ByteVector, StringType } from "../../byteVector"; import { Frame, FrameClassType } from "./frame"; import { Id3v2FrameHeader } from "./frameHeader"; import { FrameIdentifier } from "../frameIdentifiers"; /** * Provides ID3v2 URL Link frame implementation (section 4.3.1) covering `W000` to `WZZZ`, * excluding `WXXX`. * With these frames dynamic data such as webpages with touring information, price information, * or plain ordinary news can be added to the tag. There may only be one URL link frame of its kind * in a tag, except when stated otherwise in the frame description. If the text string is followed * by a string termination, all the following information should be ignored and not be displayed. * The following table contains the types and descriptions as found in the ID3 2.4.0 native frames * specification. * * WCOM - The 'Commercial Information' frame is a URL pointing at a webpage with information * such as where the album can be bought. There may be more than one WCOM frame per tag, but not * with the same content. * * WCOP - The 'Copyright/Legal information' frame is a URL pointing at a webpage where the terms * of use and ownership of the field is described. * * WOAF - The 'Official audio file webpage' frame is a URL pointing at a file specific webpage. * * WOAR - The 'Official artist/performer webpage' frame is a URL pointing at the artists' * official webpage. There may be more than one WOAR frame in a tag if the audio contains more * than one performer, but not with the same content. * * WOAS - THe 'Official audio source webpage' frame is a URL pointing at the official webpage of * the source of the audio file, eg, a movie. * * WORS - The 'Official internet radio station homepage' frame contains a URL pointing at the * homepage of the internet radio station. * * WPAY - The 'Payment' frame is a URL pointing at a webpage that will handle the process of * paying for this file. * * WPUB - The 'Publisher's official webpage' frame is a URL pointing at the official webpage * for the publisher. */ export declare class UrlLinkFrame extends Frame { /** * Text encoding to use to store the text contents of the current instance. * @protected */ protected _encoding: StringType; /** * Raw data contents in the current instance. * @protected */ protected _rawData: ByteVector; /** * ID3v2 version of the current instance. * @protected */ protected _rawVersion: number; /** * Decoded text contained in the current instance. * @protected */ protected _textFields: string[]; protected constructor(header: Id3v2FrameHeader); /** * Constructs and initializes an empty frame with the provided frame identity * @param ident Identity of the frame to construct */ static fromIdentity(ident: FrameIdentifier): UrlLinkFrame; /** * 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): UrlLinkFrame; /** * 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): UrlLinkFrame; get frameClassType(): FrameClassType; /** * Gets the text contained in the current instance. * Modifying the contents of the returned value will not modify the contents of the current * instance. The value must be reassigned for the value to change. */ get text(): string[]; /** * Sets the text contained in the current instance. */ set text(value: string[]); /** * Gets the text encoding to use when rendering the current instance. */ get textEncoding(): StringType; /** * Sets the text encoding to use when rendering the current instance. * NOTE: This value will be overwritten if {@link Id3v2Settings.forceDefaultEncoding} is `true`. * @param value */ set textEncoding(value: StringType); /** * Gets the first frame that matches the provided type * @param frames Object to search in * @param ident Frame identifier to search for * @returns Frame containing the matching frameId, `undefined` if a match was not found */ static findUrlLinkFrame(frames: UrlLinkFrame[], ident: FrameIdentifier): UrlLinkFrame; /** @inheritDoc */ clone(): UrlLinkFrame; /** * Generates a string representation of the URL link frame. */ toString(): string; /** @inheritDoc */ protected parseFields(data: ByteVector, version: number): void; /** * Performs the actual parsing of the raw data. * @remarks * Because of the high parsing cost and relatively low usage of the class, * {@link parseFields} only stores the field data, so it can be parsed on demand. Whenever * a property or method is called which requires the data, this method is called, and only * on the first call does it actually parse the data. * @protected */ protected parseRawData(): void; /** @inheritDoc */ protected renderFields(version: number): ByteVector; } /** * Provides support for ID3v2 User URL Link frames (WXXX). */ export declare class UserUrlLinkFrame extends UrlLinkFrame { private constructor(); /** * Constructs and initializes a new instance using the provided description as the text * of the frame. * @param description Description to use as text of the frame. */ static fromDescription(description: string): UserUrlLinkFrame; /** * 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): UserUrlLinkFrame; /** * 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): UserUrlLinkFrame; /** @inheritDoc */ get frameClassType(): FrameClassType; /** * Gets the description stored in the current instance. */ get description(): string; /** * Sets the description stored in the current instance. * There should only be one frame with a matching description per tag. */ set description(value: string); /** * Gets the text contained in the current instance. * NOTE: Modifying the contents of the returned value will not modify the contents of the * current instance. The value must be reassigned for the value to change. */ get text(): string[]; /** * Sets the text contained in the current instance. */ set text(value: string[]); /** * Gets a frame from a list of frames. * @param frames List of frames to search * @param description Description of the frame to match * @returns Frame containing the matching user, `undefined` if a match was not found */ static findUserUrlLinkFrame(frames: UserUrlLinkFrame[], description: string): UserUrlLinkFrame; /** @inheritDoc */ clone(): UserUrlLinkFrame; /** @inheritDoc */ toString(): string; }