Documentation
    Preparing search index...

    Interface SceneResourceCatalog<T>

    How the two directions of a §79 resource reference are resolved (2026-08-07, A-16).

    §79 references resources "by logical key"; this is the pair of functions that decides what that key is and what it comes back as. Both halves are optional so that the two directions can be supplied separately — a build that only ever writes documents needs no get — but supplying one without the other is exactly how a document that cannot be loaded gets written, so prefer resourceCatalog, which derives both from one map.

    A ReadonlyMap<string, T> satisfies the read half as it stands, since Map.get has precisely this signature.

    Both halves are declared with method syntax, which makes their parameters bivariant — the same deliberate choice, for the same reason, that @fourjs/serialization's ComponentSerializer documents: a catalog of SpriteMaterials has to be usable where a catalog of Materials is asked for, and the substitution is sound because a lookup that misses answers undefined, which is the case the callers already handle.

    interface SceneResourceCatalog<T> {
        get?(key: string): T | undefined;
        keyOf?(resource: T): string | undefined;
    }

    Type Parameters

    • T

      the resource being referenced — BufferGeometry, Material

    Index