Optional ReadonlyabortMints one cancellation source per load — () => new AbortController() in
any modern runtime (§76).
Presence is the capability. Without it, cancellation still works at the promise level (an aborted load rejects, gives back its reference, and frees its cache slot) and the request merely drains; with it, the request is cancelled at the transport, and so is a request that outlives AssetManagerOptions.timeoutSeconds. AssetManager.canAbortTransport reports which manager this is, so a caller never has to guess.
It is a factory, not a controller: a controller is single-use, and every load needs its own.
Optional ReadonlydecodeThe UTF-8 decoder a hashed text()/json() load needs, because hashing is
defined over bytes. Defaults to globalThis.TextDecoder.
Only ever consulted by a load that asked to be hashed and whose loader reads the body as text; a byte-reading loader needs none.
Optional ReadonlydigestThe content hash implementation (§76). Defaults to SHA-256 over
globalThis.crypto.subtle, where the runtime has one.
Presence is the capability, reported by
AssetManager.canHashContent: a manager without one loads exactly as
before, and refuses — loudly, at the call — any load that asked for a hash.
See content-hash.ts for the algorithm argument.
Optional ReadonlyfetchThe IO implementation. Defaults to globalThis.fetch bound to
globalThis; see the module comment for why an IO manager is allowed a
platform default.
Optional Readonlymaximum§96 input-size limit, in bytes. Defaults to DEFAULT_MAXIMUM_BYTES.
Checked against the declared content-length before the body is read, and
against the body itself as the loader reads it. text() is measured in
UTF-16 code units, which is never more than the UTF-8 byte count, so that
check is conservative in the safe direction.
Number.POSITIVE_INFINITY disables it; anything else must be greater than
zero.
Optional Readonlytimeout§96 deadline for a whole load — transport and decode — in seconds (§7a). Defaults to DEFAULT_TIMEOUT_SECONDS.
On expiry the load rejects with ASSET_LOAD_FAILED and the entry is
evicted, so the caller is released and the key is retryable. The underlying
request is aborted too when the manager was given an
AssetManagerOptions.abortController, and left to drain when it was
not — the caller's promise settles identically either way.
Number.POSITIVE_INFINITY disables it — and with it the need for a
TimerLike; anything else must be greater than zero.
Optional ReadonlytimerThe timer behind AssetManagerOptions.timeoutSeconds. Defaults to
globalThis, which satisfies TimerLike in every browser and in
Node.
Optional ReadonlywatchDev-server file watcher (§76 hot reload).
Presence is the capability, reported by AssetManager.canWatch.
AssetManager.watch forwards to this function; without it, watch
throws INVALID_APPLICATION_STATE naming the injection point. The
host owns the protocol — this package never opens a socket.
Optional ReadonlyworkerMints one Worker per decodeInWorker load (§76).
Presence is the capability, reported by
AssetManager.canDecodeInWorker. Without it,
{ decodeInWorker: true } decodes in-process. It is a factory, not a
Worker: a Worker is single-use from this package's point of view, and
every decode gets its own (then terminates it, when the fake has one).
Construction options for AssetManager.
TSignalis inferred from whichever of AssetManagerOptions.fetch and AssetManagerOptions.abortController is present, and its only job is to make the two agree: a controller whose signal the transport would refuse is a compile error here rather than aTypeErrorat the first load.