import { ByteVector, StringType } from "../../byteVector"; import { Frame, FrameClassType } from "./frame"; import { Id3v2FrameHeader } from "./frameHeader"; import { SynchronizedTextType, TimestampFormat } from "../utilTypes"; /** * This structure contains a single entry in a {@link SynchronizedLyricsFrame} object. */ export declare class SynchronizedText { private _time; /** * Constructs and initializes a new instance with a specified time and text. * @param time Offset into the media that owns this element when this element should be * displayed. See {@link TimestampFormat} for possible values. * @param text Text for the point in time */ constructor(time: number, text: string); /** * Text for the point in time represented by the current instance. */ text: string; /** * Gets time offset of the current instance. The specific format this text element is defined * in {@link SynchronizedLyricsFrame.format} of the frame that owns this element. */ get time(): number; /** * Sets time offset of the current instance. The specific format this text element is defined * in {@link SynchronizedLyricsFrame.format} of the frame that owns this element. * @param value Offset of the current instance, must be a safe */ set time(value: number); /** * Creates a copy of this instance. */ clone(): SynchronizedText; /** * Generates a raw byte representation of the frame for writing to a file. * @param encoding Encoding to use for encoding the text of the frame. */ render(encoding: StringType): ByteVector; } /** * This class extends Frame and implements support for ID3v2 Synchronized Lyrics and Text (SYLT) * frames. */ export declare class SynchronizedLyricsFrame extends Frame { private _description; private _format; private _language; private _text; private _textEncoding; private _textType; private constructor(); /** * Constructs and initializes a new instance with a specified description, ISO-639-2 language * code, text type, and text encoding. * @param description Description of the synchronized lyrics frame * @param language ISO-639-2 language code of the new instance * @param textType Type of the text to store in the new instance * @param encoding Encoding to use when rendering text in this new instance */ static fromInfo(description: string, language: string, textType: SynchronizedTextType, encoding?: StringType): SynchronizedLyricsFrame; /** * Constructs and initializes a new instance by reading its raw data in a specified ID3v2 * format. * @param data Raw representation of the new instance * @param offset Offset into `data` where the frame begins. Must be unsigned, safe * integer * @param header Header of the frame found at `offset` in `data` * @param version ID3v2 version the frame was originally encoded with */ static fromOffsetRawData(data: ByteVector, offset: number, header: Id3v2FrameHeader, version: number): SynchronizedLyricsFrame; /** * Constructs and initializes a new instance by reading its raw data in a specified ID3v2 * format. * @param data Raw representation of the new instance * @param version ID3v2 version the raw frame is encoded with. Must be unsigned 8-bit integer. */ static fromRawData(data: ByteVector, version: number): SynchronizedLyricsFrame; /** @inheritDoc */ get frameClassType(): FrameClassType; /** * Gets the description of the current instance. */ get description(): string; /** * Sets the description of the current instance. * There should only be one frame with a matching description, type, and ISO-639-2 language * code per tag. * @param value Description to store */ set description(value: string); /** * Gets the timestamp format used by the current instance. */ get format(): TimestampFormat; /** * Sets the timestamp format used by the current instance. * @param value Timestamp format to use */ set format(value: TimestampFormat); /** * 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 description, type, and ISO-639-2 language * code per tag. * @param value ISO-639-2 language code stored in the current instance */ set language(value: string); /** * Gets the text contained in the current instance */ get text(): SynchronizedText[]; /** * Sets the text contained in the current instance * @param value Text contained in the current instance */ set text(value: SynchronizedText[]); /** * 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 the type of text contained in the current instance */ get textType(): SynchronizedTextType; /** * Sets the type of text contained in the current instance. * @param value Type of the synchronized text */ set textType(value: SynchronizedTextType); /** * Gets a specified lyrics frame from a list of synchronized lyrics frames * @param frames List of frames to search * @param description Description to match * @param textType Text type to match * @param language Optionally, ISO-639-2 language code to match * @returns Frame containing the matching user, `undefined` if a match was not found */ static find(frames: SynchronizedLyricsFrame[], description: string, textType: SynchronizedTextType, language?: string): SynchronizedLyricsFrame; /** * Gets a synchronized lyrics frame from the specified list, trying to match the description and * language but accepting an incomplete match. * This method tries matching with the following order of precedence: * * The first frame with a matching description, language, and type. * * The first frame with a matching description and language. * * The first frame with a matching language. * * The first frame with a matching description. * * The first frame with a matching type. * * The first frame. * @param frames List of frames to search for the best match * @param description Description to match * @param language ISO-639-2 language code to match * @param textType Text type to match * @returns The matching frame or `undefined` if a match was not found */ static findPreferred(frames: SynchronizedLyricsFrame[], description: string, language: string, textType: SynchronizedTextType): SynchronizedLyricsFrame; /** @inheritDoc */ clone(): Frame; /** @inheritDoc */ protected parseFields(data: ByteVector): void; /** @inheritDoc */ protected renderFields(version: number): ByteVector; }