@runejs/filestore
Version:
Tools for managing the RuneJS filestore.
37 lines (36 loc) • 1.07 kB
TypeScript
import type { Filestore } from '../filestore';
import type { FileData } from '../file-data';
/**
* A single sound file object.
*/
export declare class SoundFile {
readonly fileData: FileData;
constructor(fileData: FileData);
/**
* Writes this unpacked sound file to the disk under `./unpacked/sounds/{soundId}.wav`
*/
writeToDisk(): Promise<void>;
get fileId(): number;
}
/**
* Controls sound file storage.
*/
export declare class SoundStore {
private fileStore;
constructor(fileStore: Filestore);
/**
* Writes all unpacked WAV files to the disk under `./unpacked/sounds/`
*/
writeToDisk(): Promise<void>;
/**
* Decodes the specified sound file.
* @param id The ID of the sound file.
* @returns The decoded SoundFile object, or null if the file is not found.
*/
getSound(id: number): SoundFile | null;
/**
* Decodes all WAV files within the filestore.
* @returns The list of decoded SoundFile objects from the sound store.
*/
decodeSoundStore(): SoundFile[];
}