@dioramajs/assets
Asset loading, cache and preload.
On this page
import { AssetError, assets } from '@dioramajs/assets'Classes
AssetError | Rejects `Asset.ready`. Reported as `asset:<url>`, which the kernel wraps as `REPORTED`. |
Constants
assets | `app.assets`. One cache with leases for media and models, a priority queue, preloading of the next page and the progress wave of a preloader. |
Interfaces
Asset | A lease, returned synchronously. The entry lives while any lease does. Calling it releases it. `E` is the failure type, AssetError for `load()` and whatever `make` threw for `acquire()`. |
AssetLoader | Loads one type of asset. |
AssetsApi | The `assets` service: a shared cache of media and models with progress. |
AssetsOptions | Options of the `assets` plugin. |
AssetsStats | Counters of the cache. |
AssetTypes | Value types of typed loads. Extend via declaration merging for your own loaders. |
DecoderOptions | Where Draco, KTX2 and Meshopt decoders come from. |
Loaded | What a loader resolves with. |
LoaderContext | What a loader gets for one entry. |
LoadOptions | Options of `assets.load`. |
Model | A glTF owned by the cache. Place instances and never dispose their resources. |
Preload | Settles once everything has settled. Never rejects. |
PreloadOptions | Options of `assets.preload`. |
Types
AssetErrorCode | Codes of `AssetError`. |
AssetStatus | State of a lease. |
CrossOrigin | `''` (default) sends no CORS mode, like an <img> without `crossorigin`. |
LoaderEntry | A loader, or a lazy module exporting one. Three-based loaders come through import(). |
PreloadSource | What `preload` takes: URLs, a parsed Document or a container element. |
Priority | Request priority. An entry runs at the highest priority among its leases. |