Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

@dioramajs/assets

Asset loading, cache and preload.

View as Markdown
On this page
import { AssetError, assets } from '@dioramajs/assets'

Classes

AssetErrorRejects `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

AssetA 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()`.
AssetLoaderLoads one type of asset.
AssetsApiThe `assets` service: a shared cache of media and models with progress.
AssetsOptionsOptions of the `assets` plugin.
AssetsStatsCounters of the cache.
AssetTypesValue types of typed loads. Extend via declaration merging for your own loaders.
DecoderOptionsWhere Draco, KTX2 and Meshopt decoders come from.
LoadedWhat a loader resolves with.
LoaderContextWhat a loader gets for one entry.
LoadOptionsOptions of `assets.load`.
ModelA glTF owned by the cache. Place instances and never dispose their resources.
PreloadSettles once everything has settled. Never rejects.
PreloadOptionsOptions of `assets.preload`.

Types

AssetErrorCodeCodes of `AssetError`.
AssetStatusState of a lease.
CrossOrigin`''` (default) sends no CORS mode, like an <img> without `crossorigin`.
LoaderEntryA loader, or a lazy module exporting one. Three-based loaders come through import().
PreloadSourceWhat `preload` takes: URLs, a parsed Document or a container element.
PriorityRequest priority. An entry runs at the highest priority among its leases.