/** @packageDocumentation Matroska tag implementation using EBML SimpleTag structures. */ import { Tag } from "../tag.js"; import { PropertyMap } from "../toolkit/propertyMap.js"; import type { VariantMap } from "../toolkit/variant.js"; import { ByteVector } from "../byteVector.js"; import { IOStream } from "../toolkit/ioStream.js"; import { type EbmlElement } from "./ebml/ebmlElement.js"; /** * Matroska TargetTypeValue hierarchy, as defined in the Matroska specification. * Controls which level of the content hierarchy a tag applies to. */ export declare enum TargetTypeValue { None = 0, Shot = 10, Scene = 20, Track = 30, Part = 40, Album = 50, Edition = 60, Collection = 70 } /** * Represents a Matroska SimpleTag element with its name, value, * target type, and optional UID filters. */ export interface SimpleTag { name: string; value: string; binaryValue?: ByteVector; language: string; defaultLanguageFlag: boolean; targetTypeValue: TargetTypeValue; trackUid: number; editionUid: number; chapterUid: number; attachmentUid: number; } /** * Represents an attached file stored in a Matroska Attachments element. */ export interface AttachedFile { description: string; fileName: string; mediaType: string; data: ByteVector; uid: number; } /** * Matroska tag implementation. Reads SimpleTag elements from Tags/Tag elements. */ export declare class MatroskaTag extends Tag { /** List of all SimpleTag entries parsed from or to be written to the file. */ private _simpleTags; /** List of all attached files parsed from or to be written to the file. */ private _attachedFiles; /** Segment title from the Info element, used as fallback for `title`. */ private _segmentTitle; /** Track title, falling back to the segment title if no TITLE tag is set. */ get title(): string; /** @param value - Track title. */ set title(value: string); /** Artist name. */ get artist(): string; /** @param value - Artist name. */ set artist(value: string); /** Album title. */ get album(): string; /** @param value - Album title. */ set album(value: string); /** Track comment. */ get comment(): string; /** @param value - Track comment. */ set comment(value: string); /** Genre string. */ get genre(): string; /** @param value - Genre string. */ set genre(value: string); /** Release year, parsed from the DATE tag. Returns 0 if not set. */ get year(): number; /** @param value - Release year; set to 0 to clear. */ set year(value: number); /** Track number, parsed from the TRACKNUMBER tag. Returns 0 if not set. */ get track(): number; /** @param value - Track number; set to 0 to clear. */ set track(value: number); /** `true` when no SimpleTags are present. */ get isEmpty(): boolean; /** All SimpleTag entries stored in this tag. */ get simpleTags(): SimpleTag[]; /** All attached files stored in this tag. */ get attachedFiles(): AttachedFile[]; /** @param value - Segment title from the Info element. */ set segmentTitle(value: string); /** Returns all standard tags as a PropertyMap. */ properties(): PropertyMap; /** * Replace standard tag fields from a PropertyMap. * @param propertyMap - The properties to apply. * @returns A map of properties that could not be mapped to Matroska tags. */ setProperties(propertyMap: PropertyMap): PropertyMap; /** * Remove SimpleTags whose names appear in `properties`. * @param properties - Tag names to remove. */ removeUnsupportedProperties(properties: string[]): void; /** Returns the list of complex property keys present in this tag (e.g. `"PICTURE"`). */ complexPropertyKeys(): string[]; /** * Returns complex property values for the given key. * @param key - The complex property key (e.g. `"PICTURE"`). * @returns An array of variant maps, one per value. */ complexProperties(key: string): VariantMap[]; /** * Retrieve the value of a standard tag by PropertyMap key. * @param key - The PropertyMap key to look up. * @returns The tag value, or an empty string if not found. */ private getTag; /** * Set or clear a standard tag by PropertyMap key. * @param key - The PropertyMap key to set. * @param value - The new value; pass an empty string to clear. */ private setTag; /** * Render the SimpleTag EBML element for a given tag entry. */ private renderSimpleTag; /** * Render the Targets EBML element. */ private renderTargets; /** * Render the entire Tags EBML element from the current tag state. * Returns null if the tag is empty. */ renderTags(): ByteVector | null; /** * Render the Attachments EBML element from the current attached files. * Returns null if there are no attachments. */ renderAttachments(): ByteVector | null; /** * Parse Tags element (0x1254C367) from the stream. */ static parseFromStream(stream: IOStream, tagsElement: EbmlElement): Promise; /** * Parse Attachments element (0x1941A469) from the stream. */ parseAttachments(stream: IOStream, attachmentsElement: EbmlElement): Promise; /** * Parse a single Tag element and extract target info and SimpleTag children. * @param stream - The I/O stream to read from. * @param tagElement - The Tag EBML element to parse. */ private parseTagElement; /** * Parse a single SimpleTag element and append it to `_simpleTags`. * @param stream - The I/O stream to read from. * @param simpleTagElement - The SimpleTag EBML element to parse. * @param targetTypeValue - The target type value inherited from the parent Tag element. * @param trackUid - Track UID filter from the parent Targets element. * @param editionUid - Edition UID filter from the parent Targets element. * @param chapterUid - Chapter UID filter from the parent Targets element. * @param attachmentUid - Attachment UID filter from the parent Targets element. */ private parseSimpleTag; /** * Parse a single AttachedFile element and append it to `_attachedFiles`. * @param stream - The I/O stream to read from. * @param element - The AttachedFile EBML element to parse. */ private parseAttachedFile; } //# sourceMappingURL=matroskaTag.d.ts.map