LoaderContext interface
What a loader gets for one entry.
import type { LoaderContext } from '@dioramajs/diorama/assets'interface LoaderContextMembers
| Name | Type | Description |
|---|---|---|
readonly crossOrigin | CrossOrigin | CORS mode of the request. |
readonly decoders | Readonly<Partial<DecoderOptions>> | The app's decoder options. Unset fields take three's defaults. |
readonly key | string | Cache key of the entry. |
readonly options | Readonly<Record<string, string | number | boolean>> | Loader options from |
readonly priority | Priority | The highest priority among the entry's leases. |
readonly signal | AbortSignal | Aborts when the last lease goes before the load ends. |
readonly url | string | Absolute URL to load. |
bytes | | Reads a body, counting bytes into the progress. |
decode | | Runs CPU-heavy work (createImageBitmap, parsing) in one of two decode slots and frees the request slot, so call it once the network part is done. Low-only entries wait while a pause is held. |
fetch | | fetch() with the priority hint and signal. HTTP errors throw ASSET_LOAD. |
load | | Loads a dependency. Its lease is released if this load is aborted, otherwise release it in |
render | | Resolves once |
Also exported from @dioramajs/assets.
Defined in packages/assets/src/types.ts.