UNPKG

taglib-wasm

Version:

TagLib-Wasm is the universal tagging library for TypeScript/JavaScript platforms: Browsers, Node.js, Deno, Bun, Cloudflare Workers, and Electron apps

28 lines 1.78 kB
/** MessagePack encoder — converts JS objects to binary MessagePack for the C API. */ import { type EncoderOptions } from "@msgpack/msgpack"; import type { AudioProperties, ExtendedTag, Picture, PropertyMap } from "../types.js"; /** * Structured (non-text-property) keys carried verbatim through the msgpack * boundary. The reconstruct registry (`extra-state-registry.ts`) must cover the * data fields here; `extra-state-registry.test.ts` enforces that cross-check. */ export declare const PASSTHROUGH_KEYS: Set<string>; export declare function encodeTagData(tagData: ExtendedTag): Uint8Array; export declare function encodeAudioProperties(audioProps: AudioProperties): Uint8Array; export declare function encodePropertyMap(propertyMap: PropertyMap): Uint8Array; export declare function encodePicture(picture: Picture): Uint8Array; export declare function encodePictureArray(pictures: Picture[]): Uint8Array; export declare function encodeMessagePack<T>(data: T, options?: Partial<EncoderOptions>): Uint8Array; export declare function encodeMessagePackCompact<T>(data: T): Uint8Array; export declare function encodeBatchTagData(tagDataArray: ExtendedTag[]): Uint8Array; export declare function encodeMessagePackStream<T>(dataIterator: Iterable<T>): Generator<Uint8Array, void, unknown>; export declare function estimateMessagePackSize(data: unknown): number; export declare function encodeFastTagData(tagData: Pick<ExtendedTag, "title" | "artist" | "album" | "year" | "track">): Uint8Array; export declare function canEncodeToMessagePack(data: unknown): boolean; export declare function compareEncodingEfficiency(data: unknown): { messagePackSize: number; jsonSize: number; sizeReduction: number; speedImprovement: number; }; //# sourceMappingURL=encoder.d.ts.map