Documentation
    Preparing search index...

    Interface AssetLoadOptions

    Per-call options for AssetManager.load.

    interface AssetLoadOptions {
        decodeInWorker?: boolean;
        expectedHash?: string;
        hashContent?: boolean;
        onProgress?: (event: AssetProgressEvent) => void;
        signal?: AbortSignalLike;
    }

    Hierarchy (View Summary)

    Index
    decodeInWorker?: boolean

    Decode the response bytes on a Worker when the manager was built with AssetManagerOptions.workerFactory (§76).

    Presence of the factory is the capability (AssetManager.canDecodeInWorker). Without one this flag is a no-op and the loader decodes in-process, exactly as it did before the seam existed. The worker is posted { type: "decode", url, buffer } and must reply with an ArrayBuffer (or { buffer } / { type: "decoded", buffer }); { type: "error", message } refuses the load.

    expectedHash?: string

    The content hash this asset is declared to have — §79's manifest half.

    The bytes are hashed and compared; a mismatch rejects this call with ASSET_LOAD_FAILED and context.reason === "hash-mismatch" (plus context.expectedHash and context.observedHash), and hands back the reference the call took, so an asset that failed verification must not be released. Refusing is the feature: §96 treats external content as untrusted, and bytes that are not the bytes the build named are exactly the case the manifest exists to catch.

    hashContent?: boolean

    Compute and record this asset's content hash (§76), readable afterwards through AssetManager.contentHash.

    Implied by AssetLoadOptions.expectedHash. See the module comment's four hashing rules — in particular that the hash covers the response's bytes, so it does not depend on which loader read them.

    onProgress?: (event: AssetProgressEvent) => void

    Byte-progress callback for this waiter (§76).

    Fired with { loaded, total, url }. total is the declared content-length / FetchResponse.contentLength when the transport exposes one, otherwise null. Incremental events require body.getReader; a one-shot body reports once it is read. A coalesced waiter gets its own callback — aborting or detaching one does not silence the others.

    Cancels this call (§76). See the module comment's three cancellation rules: an aborted load never holds a reference, one waiter's abort is not the others', and release is not abort.