/** @packageDocumentation ASF attribute value type and {@link AsfAttribute} implementation. */ import { ByteVector } from "../byteVector.js"; import type { File } from "../file.js"; import { AsfPicture } from "./asfPicture.js"; /** Discriminates the value type stored in an {@link AsfAttribute}. */ export declare enum AsfAttributeType { /** A null-terminated UTF-16LE string. */ UnicodeType = 0, /** Arbitrary binary data. */ BytesType = 1, /** Boolean flag, encoded as a WORD or DWORD depending on the object kind. */ BoolType = 2, /** Unsigned 32-bit integer. */ DWordType = 3, /** Unsigned 64-bit integer. */ QWordType = 4, /** Unsigned 16-bit integer. */ WordType = 5, /** 16-byte GUID value. */ GuidType = 6 } /** * Represents a single attribute value in an ASF tag. * * An attribute can be one of several typed values ({@link AsfAttributeType}) * and may be associated with a particular stream or language index when stored * in the Metadata or Metadata Library objects. */ export declare class AsfAttribute { /** Discriminator for the value stored in this attribute. */ private _type; /** String payload (UnicodeType attributes). */ private _stringValue; /** Binary payload (BytesType / GuidType attributes). */ private _byteVectorValue; /** Embedded picture payload (BytesType WM/Picture attributes). */ private _pictureValue; /** Numeric payload, stored as BigInt for lossless 64-bit handling. */ private _numericValue; /** Stream number this attribute belongs to (Metadata / Metadata Library). */ private _stream; /** Language list index this attribute belongs to (Metadata Library only). */ private _language; /** Create an empty Unicode attribute. */ constructor(); /** * Create a Unicode string attribute. * @param value - The string to store. */ static fromString(value: string): AsfAttribute; /** * Create a binary byte-array attribute. * @param value - The binary data to store. */ static fromByteVector(value: ByteVector): AsfAttribute; /** * Create a BytesType attribute whose payload is the rendered form of `value`. * @param value - The picture to embed. */ static fromPicture(value: AsfPicture): AsfAttribute; /** * Create a DWord (unsigned 32-bit) attribute. * @param value - Value in the range [0, 2³²−1]. */ static fromUInt(value: number): AsfAttribute; /** * Create a QWord (unsigned 64-bit) attribute. * @param value - The BigInt value to store. */ static fromULongLong(value: bigint): AsfAttribute; /** * Create a Word (unsigned 16-bit) attribute. * @param value - Value in the range [0, 65535]. */ static fromUShort(value: number): AsfAttribute; /** * Create a Bool attribute. * @param value - The boolean value to store. */ static fromBool(value: boolean): AsfAttribute; /** The discriminated type of the value held by this attribute. */ get type(): AsfAttributeType; /** Returns the Unicode string value, or `""` for non-string attributes. */ toString(): string; /** * Returns the binary data value. * For embedded pictures the rendered picture bytes are returned. */ toByteVector(): ByteVector; /** Returns `1` if the boolean value is true, otherwise `0`. */ toBool(): number; /** Returns the numeric value truncated to an unsigned 16-bit integer. */ toUShort(): number; /** Returns the numeric value truncated to an unsigned 32-bit integer. */ toUInt(): number; /** Returns the full unsigned 64-bit integer value as a BigInt. */ toULongLong(): bigint; /** Returns the embedded picture value (may be invalid). */ toPicture(): AsfPicture; /** Language list index for Metadata Library objects; `0` for all others. */ get language(): number; /** @param value - Language list index. */ set language(value: number); /** Stream number for Metadata / Metadata Library objects; `0` for Extended Content Description. */ get stream(): number; /** @param value - Stream number. */ set stream(value: number); /** * Parse an attribute from an ASF file. * @param kind 0 = extended content descriptor, 1 = metadata, 2 = metadata library * @returns the attribute name */ parse(file: File, kind?: number): Promise; /** * Size in bytes of the encoded value, **excluding** the attribute header * (name, type, and length fields). */ get dataSize(): number; /** * Serialize this attribute to bytes for inclusion in an ASF file. * * @param name - The attribute name to write. * @param kind - Object kind: `0` = Extended Content Descriptor, * `1` = Metadata, `2` = Metadata Library. * @returns The serialized bytes. */ render(name: string, kind?: number): ByteVector; } //# sourceMappingURL=asfAttribute.d.ts.map