import BaseObject from "./baseObject"; import { ByteVector } from "../../byteVector"; import { ObjectType } from "../constants"; import { DataType, DescriptorBase, DescriptorValue } from "./descriptorBase"; import { File } from "../../file"; /** * This class provides a representation of an ASF description record to be used inside a * MetadataLibraryObject. * @remarks * This class can store various types of information. Although {@link toString} provides * a representation of all types of values, it is recommended to determine which of the `get*` * methods to use by accessing {@link type} */ export declare class MetadataDescriptor extends DescriptorBase { private readonly _languageListIndex; private readonly _streamNumber; /** * Constructs and initializes a new instance. * @param languageListIndex Index of the language * @param streamNumber Index of the stream * @param name Name of the metadata library object * @param type Datatype of the object * @param value Value to store in the instance */ constructor(languageListIndex: number, streamNumber: number, name: string, type: DataType, value: DescriptorValue); /** * Instantiates a new instance by reading in the contents from a file. * @param file The file to read the raw ASF description record from * @internal */ static fromFile(file: File): MetadataDescriptor; /** * Gets the index of the language associated with the current instance. */ get languageListIndex(): number; /** * Gets the index of the stream associated with the current instance. */ get streamNumber(): number; /** @inheritDoc */ render(): ByteVector; } /** * This class provides a representation of an ASF metadata library object which can be read from * and written to disk. */ export declare class MetadataLibraryObject extends BaseObject { private readonly _records; private constructor(); /** * Constructs and initializes a new instance that does not contain any records. */ static fromEmpty(): MetadataLibraryObject; /** * Constructs and initializes a new instance by reading the object from a file. * @param file File to read the instance from * @param position Offset into the file where the object begins */ static fromFile(file: File, position: number): MetadataLibraryObject; /** * Gets whether the current instance contains any records. * @returns * `true` if the current instance does not contain any records, `false` * otherwise. */ get isEmpty(): boolean; /** @inheritDoc */ get objectType(): ObjectType; /** * Gets all records stored in the current instance. */ get records(): MetadataDescriptor[]; /** * Adds a record to the current instance. * @param record Record to add to the current instance */ addRecord(record: MetadataDescriptor): void; /** * Gets all records with a given language, stream, and any of a collection of names from the * current instance. * @param languageListIndex Index of the desired language in the language list * @param streamNumber Index of the stream in the file the desired records applies to * @param names List of names of the records to return */ getRecords(languageListIndex: number, streamNumber: number, ...names: string[]): MetadataDescriptor[]; /** * Removes all records with a given language, stream, and name from the current instance. * @param languageListIndex Language list index of the records to be removed * @param streamNumber Index of the stream in the file the desired records to remove * @param name Name of the records to remove */ removeRecords(languageListIndex: number, streamNumber: number, name: string): void; /** @inheritDoc */ render(): ByteVector; /** * Sets a collection of records for a given language, language, ane name, removing the existing * records that match. * @remarks * All added entries in `records` should match the provided `languageListIndex`, * `streamNumber`, and `name`, but this will not be verified by the method. The records * will be added with their own values and not those provided in the method arguments. The * arguments are only used for removing existing values and determining where to position * the new records. * @param languageListIndex Index of the desired language in the language list * @param streamNumber Index of the stream in the file the desired records applies to * @param name Names of the records to remove * @param records Records to insert into the current instance */ setRecords(languageListIndex: number, streamNumber: number, name: string, ...records: MetadataDescriptor[]): void; }