Documentation
    Preparing search index...

    Interface PreloadManifestIntoCatalogOptions<T, R>

    Options for preloadManifestIntoCatalog, over ManifestLoadOptions from @fourjs/assets.

    interface PreloadManifestIntoCatalogOptions<T, R extends object> {
        decodeInWorker?: boolean;
        expectedHash?: string;
        hashContent?: boolean;
        keys?: readonly string[];
        map?: (loaded: T, key: string) => R;
        onProgress?: (event: AssetProgressEvent) => void;
        requireHash?: boolean;
        signal?: AbortSignalLike;
    }

    Type Parameters

    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.

    keys?: readonly string[]

    Load only these keys, in this order. Defaults to every key the manifest names, in the document's own order.

    Duplicates are dropped after the first, so a document that names the same material twice still takes one reference. A key the manifest does not name is refused by loadFromManifest from @fourjs/assets, at the call.

    map?: (loaded: T, key: string) => R

    Lift a loaded asset into the catalog entry. A TextureAsset becomes a Texture here — @fourjs/assets cannot name @fourjs/render, which is why this helper lives on the umbrella.

    Omit it when the loader already produces the catalog's type (a BufferGeometry loader, a material factory).

    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.

    requireHash?: boolean

    Refuse a manifest row that declares no hash (§96). Defaults to false.

    true is the production posture: it turns "this manifest was built without hashes" from a silent loss of verification into a load-time failure.

    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.