import { ByteVector, StringType } from "../../byteVector"; import { Frame, FrameClassType } from "./frame"; import { Id3v2FrameHeader } from "./frameHeader"; export default class TermsOfUseFrame extends Frame { private _language; private _text; private _textEncoding; private constructor(); /** * Constructs and initializes a new instance with a specified language. * @param language ISO-639-2 language code for the new frame * @param textEncoding Optional, text encoding to use when rendering the new frame. If not * provided defaults to {@link Id3v2Settings.defaultEncoding} */ static fromFields(language: string, textEncoding?: StringType): TermsOfUseFrame; /** * 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): TermsOfUseFrame; /** * 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): TermsOfUseFrame; /** @inheritDoc */ get frameClassType(): FrameClassType; /** * Gets the ISO-639-2 language code stored in the current instance. */ get language(): string; /** * Sets the ISO-639-2 language code stored in the current instance. * There should only be one frame with a matching ISO-639-2 language code per tag. */ set language(value: string); /** * Gets the text of the terms of use */ get text(): string; /** * Sets the text of the terms of use */ set text(value: string); /** * Gets the text encoding to use when storing the current instance. */ get textEncoding(): StringType; /** * Sets the text encoding to use when storing the current instance. * This encoding is overridden when rendering if {@link Id3v2Settings.forceDefaultEncoding} is * `true` or the render version does not support it. * @param value Text encoding to use when storing the current instance */ set textEncoding(value: StringType); /** * Gets a specified terms of use frame from the list of frames * @param frames List of frames to search * @param language Optionally, the ISO-639-2 language code to match * @returns A matching frame if found or `undefined` if a matching frame was not found */ static find(frames: TermsOfUseFrame[], language?: string): TermsOfUseFrame; /** * Gets a specified terms of use frame from the list of frames, trying to match the language but * accepting one with a different language if a match was not found. * @param frames List of frames to search * @param language ISO-639-2 language code to match * @returns Frame containing the matching frame or `undefined` if a match was not found */ static findPreferred(frames: TermsOfUseFrame[], language: string): TermsOfUseFrame; /** @inheritDoc */ clone(): Frame; /** * Returns a string representation of the frame. */ toString(): string; /** @inheritDoc */ protected parseFields(data: ByteVector): void; /** @inheritDoc */ protected renderFields(version: number): ByteVector; }