/** @packageDocumentation ASF / WMA file implementation including internal object parsing hierarchy. */ import { ByteVector } from "../byteVector.js"; import { File } from "../file.js"; import { ReadStyle } from "../toolkit/types.js"; import type { IOStream } from "../toolkit/ioStream.js"; import { PropertyMap } from "../toolkit/propertyMap.js"; import type { VariantMap } from "../toolkit/variant.js"; import { AsfTag } from "./asfTag.js"; import { AsfProperties } from "./asfProperties.js"; /** * Common interface shared by all ASF object types that appear inside the * Header Object. Each object knows how to parse itself from a file stream * and render itself back to bytes. * @internal */ export interface BaseObject { guid(): ByteVector; parse(file: AsfFile, size: bigint): Promise; render(file: AsfFile): ByteVector; data: ByteVector; } /** * Parses/renders the Metadata Object (stream-specific attributes, no language index). * @internal */ export declare class MetadataObject implements BaseObject { data: ByteVector; attributeData: ByteVector[]; guid(): ByteVector; parse(file: AsfFile): Promise; render(): ByteVector; } /** * Parses/renders the Metadata Library Object (stream- and language-specific * attributes, supports large values > 64 KB). * @internal */ export declare class MetadataLibraryObject implements BaseObject { data: ByteVector; attributeData: ByteVector[]; guid(): ByteVector; parse(file: AsfFile): Promise; render(): ByteVector; } /** * Reads and writes ASF (Advanced Systems Format) files, including WMA and WMV. * * The file is parsed on construction; call {@link save} to write metadata * changes back to the stream. */ export declare class AsfFile extends File { /** @internal */ _tag: AsfTag | null; /** @internal */ _properties: AsfProperties | null; /** @internal Total size of the ASF Header Object in bytes. */ /** @internal */ _headerSize: bigint; /** List of all top-level header sub-objects in parse order. */ private _objects; /** Parsed Content Description Object, or `null` if absent. */ private _contentDescriptionObject; /** Parsed Extended Content Description Object, or `null` if absent. */ private _extendedContentDescriptionObject; /** Parsed Header Extension Object, or `null` if absent. */ private _headerExtensionObject; /** @internal */ _metadataObject: MetadataObject | null; /** @internal */ _metadataLibraryObject: MetadataLibraryObject | null; /** @internal - used by inner parser objects to invalidate */ setFileInvalid(): void; /** * @param stream - The stream backing this file. */ private constructor(); /** * Open and parse an ASF file from `stream`. * * @param stream - Readable (and optionally writable) stream. * @param _readProperties - Whether to read audio properties (currently always read). * @param _readStyle - Level of detail for audio properties parsing. * @returns A resolved promise containing the populated {@link AsfFile}. */ static open(stream: IOStream, _readProperties?: boolean, _readStyle?: ReadStyle): Promise; /** Returns the ASF tag, or `null` if the file has not been parsed yet. */ tag(): AsfTag | null; /** Returns the audio properties, or `null` if the file has not been parsed yet. */ audioProperties(): AsfProperties | null; save(): Promise; /** * Quickly determine whether `stream` starts with the ASF Header GUID. * * @param stream - The stream to probe (will be seeked to position 0). * @returns `true` if the stream begins with the ASF Header Object GUID. */ static isSupported(stream: IOStream): Promise; /** @inheritdoc */ properties(): PropertyMap; /** @inheritdoc */ setProperties(properties: PropertyMap): PropertyMap; /** @inheritdoc */ removeUnsupportedProperties(properties: string[]): void; /** @inheritdoc */ complexPropertyKeys(): string[]; /** @inheritdoc */ complexProperties(key: string): VariantMap[]; /** @inheritdoc */ setComplexProperties(key: string, value: VariantMap[]): boolean; /** Parse the ASF Header Object and populate tag / properties. */ private read; } //# sourceMappingURL=asfFile.d.ts.map