API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classLoaderScope
An owner of asset claims with an explicit lifetime. Assets acquired through a scope stay resident for as long as that scope holds them, and are freed when it releases them - but only if no other scope still holds the same asset. Several scopes can own one asset independently: they share a single fetch and a single resident payload, and one scope releasing never invalidates another. Create a scope with Loader.createScope whenever an asset's lifetime is shorter than the application's - a level, a streamed chunk, a UI panel, a prefetch. Assets acquired directly on the Loader are held for the application's lifetime instead and are freed only when the loader is destroyed. A scope describes a lifetime, never a set of assets: what to acquire comes from an Assets catalog or an Asset descriptor passed to get / load, and typed access stays on that catalog. Scopes nest: createScope makes a child whose claims are independent but whose lifetime cannot outlive its parent's.
import { LoaderScope } from '@codexo/exojs'An owner of asset claims with an explicit lifetime.
Assets acquired through a scope stay resident for as long as that scope holds them, and are freed when it releases them - but only if no other scope still holds the same asset. Several scopes can own one asset independently: they share a single fetch and a single resident payload, and one scope releasing never invalidates another.
Create a scope with Loader.createScope whenever an asset's lifetime is shorter than the application's - a level, a streamed chunk, a UI panel, a prefetch. Assets acquired directly on the Loader are held for the application's lifetime instead and are freed only when the loader is destroyed.
A scope describes a lifetime, never a set of assets: what to acquire comes from an Assets catalog or an Asset descriptor passed to get / load, and typed access stays on that catalog.
Scopes nest: createScope makes a child whose claims are independent but whose lifetime cannot outlive its parent's.
createScope(options?: LoaderScopeOptionsOptions for Loader.createScope and LoaderScope.createScope.): LoaderScopedestroy(): voidget(path: [KindByPathThe asset type inferred from a path literal, or `never` when unregistered.<S>] extends [never] ? never : S, options?: unknown): LeafForPath<S>get(asset: CatalogValueLeafA value type's catalog leaf: a deferred AssetRef, branded with the DECODED payload type - which is what loading it resolves to.<T> | ValueAssetA value/ref-type asset descriptor. Structurally an Asset, but branded so a catalog classifies its leaf as a deferred `AssetRef<T>` - even when `T` is an object…<T>): CatalogValueLeafA value type's catalog leaf: a deferred AssetRef, branded with the DECODED payload type - which is what loading it resolves to.<T>get(catalog: AssetsA reusable, typed asset container. Each field is materialized as a handle-hybrid leaf: a resource type's leaf IS a usable placeholder resource (`Texture`/`Soun…<M>): InferAssetsProperties<M>get(leaf: CatalogResourceLeafA resource type's catalog leaf: the heal-in-place placeholder resource itself (`Texture`, `Sound`, ...), branded. Stays assignable to the bare resource, so `co…<T>): CatalogResourceLeafA resource type's catalog leaf: the heal-in-place placeholder resource itself (`Texture`, `Sound`, ...), branded. Stays assignable to the bare resource, so `co…<T>load(assets: AssetsA reusable, typed asset container. Each field is materialized as a handle-hybrid leaf: a resource type's leaf IS a usable placeholder resource (`Texture`/`Soun…<M>, options?: LoadOptionsOptions for the catalog/asset/leaf Loader.load forms.): LoadingQueueAn awaitable, progress-aware load operation. Implements `PromiseLike<T>` so it can be `await`ed directly and composed with `Promise.all([queue1, queue2])` with…<InferLoadedMapMaps each key of a catalog DEFINITION record to its resolved runtime resource type. Keyed on CatalogEntry, not `AssetInput`: a materialized catalog may have be…<M>>load(leaf: CatalogValueLeafA value type's catalog leaf: a deferred AssetRef, branded with the DECODED payload type - which is what loading it resolves to.<T>, options?: LoadOptionsOptions for the catalog/asset/leaf Loader.load forms.): LoadingQueueAn awaitable, progress-aware load operation. Implements `PromiseLike<T>` so it can be `await`ed directly and composed with `Promise.all([queue1, queue2])` with…<T>load(leaf: CatalogResourceLeafA resource type's catalog leaf: the heal-in-place placeholder resource itself (`Texture`, `Sound`, ...), branded. Stays assignable to the bare resource, so `co…<T>, options?: LoadOptionsOptions for the catalog/asset/leaf Loader.load forms.): LoadingQueueAn awaitable, progress-aware load operation. Implements `PromiseLike<T>` so it can be `await`ed directly and composed with `Promise.all([queue1, queue2])` with…<T>load(path: [KindByPathThe asset type inferred from a path literal, or `never` when unregistered.<S>] extends [never] ? never : S): LoadingQueueAn awaitable, progress-aware load operation. Implements `PromiseLike<T>` so it can be `await`ed directly and composed with `Promise.all([queue1, queue2])` with…<ResourceForKind<KindByPathThe asset type inferred from a path literal, or `never` when unregistered.<S>>>loadContainer(source: ManifestPackOne pack a manifest carries. | string, options?: LoadContainerOptionsHow Loader.loadContainer fetches a container.): Promise<void>release(handle: object): voidrelease(asset: AssetA typed, loadable asset reference. Holds config only - no loaded resource.<T>): voidid: numbername?: string