AssetIndex beta
Class of @v12-engine/editor
export declare class AssetIndexThe index of every asset the editor knows. refresh reads the listing; usesOf finds where one is used
Members
constructor
constructor(source: AssetIndexSource);Constructs a new instance of the AssetIndex class
all
get all(): readonly Asset[];Every asset, the map's first, then the game's, the project's, the package's
byId
byId(id: string): Asset | undefined;The asset with that id, or undefined when none has it
codeUses
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
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
orphans(): Asset[];The game's own files that nothing of the map or the game's files uses (the code may still: codeUses)
refresh
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
setTags(asset: Asset, tags: string[]): Promise<void>;The tags of a game's own file written, and kept here
usesOf
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
watch(listener: () => void): () => void;Told when the listing changed