taglib-wasm
Version:
TagLib-Wasm is the universal tagging library for TypeScript/JavaScript platforms: Browsers, Node.js, Deno, Bun, Cloudflare Workers, and Electron apps
72 lines • 2.53 kB
TypeScript
/**
* @fileoverview WASI-based FileHandle implementation
*/
import type { FileHandle, RawChapter, RawId3v2Frame, RawLyrics, RawPicture } from "../../wasm.js";
import type { BasicTagData } from "../../types/tags.js";
import type { AudioProperties } from "../../types.js";
import type { WasiModule } from "../wasmer-sdk-loader/types.js";
export declare class WasiFileHandle implements FileHandle {
private readonly wasi;
private fileData;
private filePath;
private tagData;
private destroyed;
constructor(wasiModule: WasiModule);
private checkNotDestroyed;
loadFromBuffer(buffer: Uint8Array): boolean;
loadFromPath(path: string): boolean;
isValid(): boolean;
save(): boolean;
getTagData(): BasicTagData;
setTagData(data: Partial<BasicTagData>): void;
getAudioProperties(): AudioProperties | null;
getFormat(): string;
private detectOggCodec;
getBuffer(): Uint8Array;
getProperties(): Record<string, string[]>;
setProperties(props: Record<string, string[]>): void;
getProperty(key: string): string;
setProperty(key: string, value: string): void;
isMP4(): boolean;
getMP4Item(key: string): string;
setMP4Item(key: string, value: string): void;
/** Record an exact atom name to be repaired after the PropertyMap write. */
private registerMp4ItemName;
removeMP4Item(key: string): void;
getPictures(): RawPicture[];
setPictures(pictures: RawPicture[]): void;
addPicture(picture: RawPicture): void;
removePictures(): void;
getChapters(): RawChapter[];
setChapters(chapters: RawChapter[], mp4ChapterStyle: string): void;
getBextData(): Uint8Array | undefined;
setBextData(data: Uint8Array | null): void;
getIxml(): string | undefined;
setIxml(data: string | null): void;
hasId3Tags(): {
v1: boolean;
v2: boolean;
};
stripId3Tags(opts: {
v1: boolean;
v2: boolean;
}): void;
getRatings(): {
rating: number;
email: string;
counter: number;
}[];
setRatings(ratings: {
rating: number;
email?: string;
counter?: number;
}[]): void;
getLyrics(): RawLyrics[];
setLyrics(lyrics: RawLyrics[]): void;
getId3v2Frames(id: string): RawId3v2Frame[];
setId3v2Frames(id: string, data: Uint8Array[]): void;
removeId3v2Frames(id: string): void;
getStagedId3v2Frames(): Record<string, Uint8Array[]> | undefined;
destroy(): void;
}
//# sourceMappingURL=file-handle.d.ts.map