AssetManager
Defined in: AssetManager.ts:7
Orchestrates asset loading across plugin-provided loaders. Core owns the “when” and “what”; plugins own the “how”.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AssetManager():
AssetManager
Returns
Section titled “Returns”AssetManager
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Defined in: AssetManager.ts:72
Unload all cached assets.
Returns
Section titled “Returns”void
get<
T>(handle):T
Defined in: AssetManager.ts:17
Retrieve a loaded asset. Throws if not loaded.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”handle
Section titled “handle”AssetHandle<T>
Returns
Section titled “Returns”T
has(
handle):boolean
Defined in: AssetManager.ts:27
Check if an asset is loaded.
Parameters
Section titled “Parameters”handle
Section titled “handle”AssetHandle<unknown>
Returns
Section titled “Returns”boolean
loadAll()
Section titled “loadAll()”loadAll(
handles,onProgress?):Promise<void>
Defined in: AssetManager.ts:35
Load all assets, skipping already-cached ones. Reports progress via optional callback (0→1).
Parameters
Section titled “Parameters”handles
Section titled “handles”readonly AssetHandle<unknown>[]
onProgress?
Section titled “onProgress?”(ratio) => void
Returns
Section titled “Returns”Promise<void>
registerLoader()
Section titled “registerLoader()”registerLoader(
type,loader):void
Defined in: AssetManager.ts:12
Register a loader for a given asset type. Called by plugins during install().
Parameters
Section titled “Parameters”string
loader
Section titled “loader”Returns
Section titled “Returns”void
unload()
Section titled “unload()”unload(
handle):void
Defined in: AssetManager.ts:62
Unload a single asset and remove from cache.
Parameters
Section titled “Parameters”handle
Section titled “handle”AssetHandle<unknown>
Returns
Section titled “Returns”void