@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
41 lines (40 loc) • 1.87 kB
TypeScript
import IFile from "../storage/IFile";
import { IEventHandler } from "ste-events";
import { ISoundCatalog, ISoundEventSet } from "./ISoundCatalog";
import Project from "../app/Project";
import ProjectItem from "../app/ProjectItem";
import IDefinition from "./IDefinition";
import RelationsIndex from "../app/RelationsIndex";
export default class SoundCatalogDefinition implements IDefinition {
private _data?;
private _file?;
private _isLoaded;
private _loadedWithComments;
private _onLoaded;
id: string | undefined;
get isLoaded(): boolean;
get file(): IFile | undefined;
get onLoaded(): import("ste-events").IEvent<SoundCatalogDefinition, SoundCatalogDefinition>;
get data(): ISoundCatalog;
set file(newFile: IFile | undefined);
get entityIdList(): string[];
getSoundEventNameList(): string[];
ensureEntityEvent(idSound: string): ISoundEventSet;
ensureDefault(): void;
static ensureForProject(project: Project): Promise<SoundCatalogDefinition>;
static ensureOnFile(file: IFile, loadHandler?: IEventHandler<SoundCatalogDefinition, SoundCatalogDefinition>): Promise<SoundCatalogDefinition>;
/**
* Converts ISoundEvent objects that only have {sound: "..."} back
* to plain strings, keeping the file compact and canonical.
*/
private _downscaleEvents;
persist(): boolean;
/**
* Loads the definition from the file.
* @param preserveComments If true, uses comment-preserving JSON parsing for edit/save cycles.
* If false (default), uses efficient standard JSON parsing.
* Can be called again with true to "upgrade" a read-only load to read/write.
*/
load(preserveComments?: boolean): Promise<void>;
addChildItems(project: Project, item: ProjectItem, index?: RelationsIndex): Promise<void>;
}