Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Class LoaderRegistry

    Registry that manages all geometry loaders (Points, Lines, GSplats, Mesh) and tracks loading failures for retry/recovery.

    Index
    autoRetryableFailureCallback: (() => void) | null = null
    byKind: ReadonlyMap<LoaderTypeName, Map<string, AnyDataLoader>> = ...

    Every loader, bucketed by geometry kind, path → loader.

    One bucket per LOADER_TYPES entry, created up front so loadersOf never has to handle a missing bucket. The kind-specific accessors below are thin views onto these same Map objects — callers that hold registry.loaders and mutate it directly are mutating this store, as they always were.

    LOADER_TYPES, not GEOMETRY_TYPES: a bucket here presupposes a loader interface in LoaderByKind, so this must be the viewer-drawable subset. Building it from the wider leaf vocabulary would allocate a bucket for a type loadersOf can never be called with.

    failedLoaders: Map<string, FailedLoaderInfo> = ...

    Error tracking for failed loaders

    • Drop a single loader so it no longer participates in scene-wide updateView sweeps. Defensive: lazy substitutive LOD levels are never registered in the first place (they stay out of the sweep by design — see load-lod-group-node.ts; the registry drives their reloads), so on the lazy-release path this is a no-op. It exists so a future path that DOES register such a loader cannot leak it into the sweep after its geometry was released. The loader object itself stays alive in the lod_group's ensureLoaded closure for reload.

      Type Parameters

      Parameters

      • kind: K
      • path: string

      Returns void

    • Find which geometry kind owns a given path, or null if none does.

      Nothing prevents the same path from being registered under two kinds, so this has a documented precedence: points > lines > gsplats. That order is now the bucket insertion order, which comes from LOADER_TYPES — i.e. from the order of loader_types in format-contract/contract.yaml. Reordering that list would silently reorder this precedence; the "checks points first when a path collides" test is the guard.

      Parameters

      • path: string

      Returns LoaderTypeName | null

    • Record a loader failure. kind defaults to the heuristic classification of error; pass it explicitly when the caller already computed one.

      The single writer for failedLoaders — the retry and update-sweep paths route through here rather than calling .set inline, which also removes a pre-existing skew where those two baselined retryCount at 1 and 0.

      Bumps the diagnostic retryCount but leaves autoRetryCount untouched — only markAutoRetryAttempt charges the automatic-retry budget.

      Parameters

      Returns void

    • Charge one automatic (connectivity-triggered) retry attempt against a path. No-op if the path has no failure record. Kept separate from recordFailure so update sweeps and manual retries — which also record failures — cannot drain the automatic budget gated by autoRetryablePaths.

      Parameters

      • path: string

      Returns void

    • Paths an AUTOMATIC retry should attempt: a transient (Network) cause that is still under MAX_AUTO_RETRY_ATTEMPTS.

      A manual Retry deliberately ignores both filters — the user pressing the button is new information (they may have just fixed the server), and a deterministic failure is still worth one more look on request.

      Returns string[]