taglib-wasm
Version:
TagLib-Wasm is the universal tagging library for TypeScript/JavaScript platforms: Browsers, Node.js, Deno, Bun, Cloudflare Workers, and Electron apps
55 lines • 1.87 kB
TypeScript
/**
* @fileoverview High-level MessagePack utilities for common TagLib-Wasm operations
*/
import type { AudioProperties, ExtendedTag, Picture, PropertyMap } from "../types.js";
/**
* High-level MessagePack utilities for common TagLib-Wasm operations
*/
export declare class MessagePackUtils {
/**
* Smart decode that automatically detects the data type
*/
static decode(buffer: Uint8Array): ExtendedTag | AudioProperties | Picture | PropertyMap;
/**
* Validate and decode tag data with error handling
*/
static safeDecodeTagData(buffer: Uint8Array): ExtendedTag | null;
/**
* Validate and decode audio properties with error handling
*/
static safeDecodeAudioProperties(buffer: Uint8Array): AudioProperties | null;
/**
* Validate and decode picture data with error handling
*/
static safeDecodePicture(buffer: Uint8Array): Picture | null;
/**
* Get performance metrics for MessagePack vs JSON
*/
static getPerformanceComparison(data: ExtendedTag): {
messagePackSize: number;
jsonSize: number;
sizeReduction: number;
estimatedSpeedImprovement: number;
};
/**
* Convert between MessagePack and JSON for debugging/comparison
*/
static toJson(buffer: Uint8Array): string;
/**
* Convert JSON back to MessagePack (for testing/migration)
*/
static fromJson(jsonString: string): Uint8Array;
/**
* Batch process multiple MessagePack buffers
*/
static batchDecode(buffers: Uint8Array[]): Array<{
success: boolean;
data?: ExtendedTag | AudioProperties | Picture | PropertyMap;
error?: string;
}>;
/**
* Check if data is compatible with TagLib MessagePack format
*/
static isTagLibCompatible(data: unknown): boolean;
}
//# sourceMappingURL=utils.d.ts.map