API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classAssetVariantSet
Per-device selection between several files that stand for one logical asset. Without this layer a path is a path: one URL, one set of bytes, on every device. That is the wrong shape for two things a real project needs - a texture shipped once per compressed format family (no GPU supports them all) and once per display density - because the choice can only be made where the device is known, which is at load time. Selection happens before the source is canonicalized, so asset identity is keyed on the file that was actually chosen. Two devices picking different candidates therefore get different cache entries instead of one entry whose contents depend on who wrote it last. A source with no rule resolves to itself. Nothing is registered by default, so an application that never calls define pays one map lookup per load and nothing else.
import { AssetVariantSet } from '@codexo/exojs'Per-device selection between several files that stand for one logical asset.
Without this layer a path is a path: one URL, one set of bytes, on every device. That is the wrong shape for two things a real project needs - a texture shipped once per compressed format family (no GPU supports them all) and once per display density - because the choice can only be made where the device is known, which is at load time.
Selection happens before the source is canonicalized, so asset identity is keyed on the file that was actually chosen. Two devices picking different candidates therefore get different cache entries instead of one entry whose contents depend on who wrote it last.
A source with no rule resolves to itself. Nothing is registered by default, so an application that never calls define pays one map lookup per load and nothing else.
new(): AssetVariantSetcandidates(source: string): readonly AssetVariantOne candidate representation of a logical asset source. A candidate is eligible when every condition it states holds for the current AssetVariantProfile. A can…[] | undefinedclear(): thisdefine(source: string, variants: readonly AssetVariantOne candidate representation of a logical asset source. A candidate is eligible when every condition it states holds for the current AssetVariantProfile. A can…[]): thisresolve(source: string): stringundefine(source: string): this