Reference · The <chikyu-space> element
SpaceStatetype
What the space view is doing: loading, live, unavailable (no WebGL), lost (the GPU took the context; it comes back by itself) or idle (another view has the page's one context).
Import it
import type { SpaceState } from "@johnmorrisdotca/chikyu-earth/space/element";
Definition
type SpaceState = "loading" | "live" | "unavailable" | "lost" | "idle";
Examples
import type { ChikyuSpace, SpaceState } from "@johnmorrisdotca/chikyu-earth/space/element";
const stateOf = (space: ChikyuSpace): SpaceState => space.stats.state;
console.log(typeof stateOf);