Skip to content

AssetHandle

Defined in: AssetHandle.ts:6

A phantom-typed handle referencing an asset by type and path. Created by plugin-specific factory functions (e.g. texture(), sound()). Core knows nothing about concrete asset types.

T

new AssetHandle<T>(type, path, data?): AssetHandle<T>

Defined in: AssetHandle.ts:7

string

Loader type key (e.g. “texture”, “sound”).

string

Asset path or URL.

unknown

Optional loader metadata that the path can’t carry — e.g. the @font-face family for a web font. Forwarded to the loader’s load(path, data); ignored by loaders that don’t read it.

AssetHandle<T>

readonly _type: T

Defined in: AssetHandle.ts:21

Phantom field to preserve the generic type at compile time.


readonly optional data?: unknown

Defined in: AssetHandle.ts:17

Optional loader metadata that the path can’t carry — e.g. the @font-face family for a web font. Forwarded to the loader’s load(path, data); ignored by loaders that don’t read it.


readonly path: string

Defined in: AssetHandle.ts:11

Asset path or URL.


readonly type: string

Defined in: AssetHandle.ts:9

Loader type key (e.g. “texture”, “sound”).