import RiffList from "./riffList"; import { ByteVector, StringType } from "../byteVector"; import { Tag } from "../tag"; /** * Abstract class that provides support for reading/writing tags in the RIFF list format. */ export default abstract class RiffListTag extends Tag { private readonly _list; private _stringType; protected constructor(list: RiffList); /** @inheritDoc */ get isEmpty(): boolean; /** * Gets the {@link RiffList} that backs the data for this tag. * @remarks * Tags based on RiffLists are only supposed to support certain fields. Modify at your * own risk. */ get list(): RiffList; /** @inheritDoc */ get sizeOnDisk(): number; /** * Gets the type of string used for parsing and rendering the contents of this tag. */ get stringType(): StringType; /** * Sets the type of string used for parsing and rendering the contents of this tag. * @remarks The value must be `StringType.Latin1` or `StringType.UTF8`. */ set stringType(value: StringType); /** @inheritDoc */ clear(): void; /** * Gets the values for a specified item in the current instance. * @param id ID of the item of which to get the values */ getValues(id: string): ByteVector[]; /** * Gets the values for a specified item in the current instance as strings. * @param id ID of the item of which to get the values */ getValuesAsStrings(id: string): string[]; /** * Gets the value for a specified item in the current instance as an unsigned integer. * @param id ID of the item for which to get the value */ getValueAsUint(id: string): number; /** * Removes the item with the specified ID from the current instance. * @param id ID of the item to remove */ removeValue(id: string): void; /** * Sets the value for a specified item in the current instance * @param id ID of the item to set * @param values Values to store in the specified item */ setValues(id: string, values: ByteVector[]): void; /** * Sets the value for a specified item in the current instance using a list of strings. * @param id ID of the item to set * @param values Values to store in the specified item */ setValuesFromStrings(id: string, values: string[]): void; /** * Sets the value for a specified item in the current instance using an unsigned integer. * @param id ID of the item to set * @param value Value to store in the specified item, must be an unsigned 32-bit integer */ setValueFromUint(id: string, value: number): void; /** * Renders the current instance, including list header and padding bytes, ready to be written * to a file. */ render(): ByteVector; /** * Gets the first non-falsy string for the specified ID. If the item is not found, `undefined` * is returned. * @param id ID of the item to lookup in the list. * @protected */ protected getFirstValueAsString(id: string): string | undefined; }