Skip to content

AssetIndex beta ​

Class of @v12-engine/editor

ts
export declare class AssetIndex

The index of every asset the editor knows. refresh reads the listing; usesOf finds where one is used

Members ​

constructor ​

ts
constructor(source: AssetIndexSource);

Constructs a new instance of the AssetIndex class

all ​

ts
get all(): readonly Asset[];

Every asset, the map's first, then the game's, the project's, the package's

byId ​

ts
byId(id: string): Asset | undefined;

The asset with that id, or undefined when none has it

codeUses ​

ts
codeUses(asset: Asset): Promise<string[]>;

The files of the code and the maps that name an asset: the dev server's to say, while developing

find ​

ts
find(path: string, place?: AssetPlace): Asset | undefined;

An asset by its place and path; by path alone, the first place that has it (the map's files first, as the client serves them)

orphans ​

ts
orphans(): Asset[];

The game's own files that nothing of the map or the game's files uses (the code may still: codeUses)

refresh ​

ts
refresh(): Promise<void>;

Reads the files again: the map's, and the dev server's listing while developing. Rejects when that could not be read, after showing the map's files: whoever asked says so (EditorPanel.run)

setTags ​

ts
setTags(asset: Asset, tags: string[]): Promise<void>;

The tags of a game's own file written, and kept here

usesOf ​

ts
usesOf(asset: Asset): AssetUse[];

Where an asset is used, over the map and the game's files; the code's uses are the dev server's to say (codeUses)

watch ​

ts
watch(listener: () => void): () => void;

Told when the listing changed