import { type SharedRenderer } from "@johnmorrisdotca/kazoku-ui/renderer"; import type { ThreeParts } from "./textures.ts"; type Three = ThreeParts; export type ContextState = "lost" | "restored" | "unavailable"; /** * Where three.js comes from, if a page wants to hand it over itself (before the first element connects). A page that hands over a module re-exporting only the parts the Earth and the space view use ships a few hundred kilobytes of three.js instead of all of it. * * @param load - Returns the parts of three.js the Earth and the space view use, as a promise. * * @example * ```ts no-run * import { setThreeLoader } from "@johnmorrisdotca/chikyu-earth/realistic/element"; * * setThreeLoader(() => import("three")); * ``` */ export declare function setThreeLoader(load: () => Promise): void; /** * Hands the elements a renderer the page made, so a page that draws other things with kazoku-ui's shared renderer keeps one WebGL context for all of them. Call it before the first element connects, or while none is in the page. The page owns the renderer: the elements never dispose it, and its own `maxRatio` and `onContext` apply. Pass `undefined` to go back to the package's own. * * @param renderer - A renderer made with `createSharedRenderer` from `@johnmorrisdotca/kazoku-ui/renderer`, whose `load` gives the same three.js, or `undefined`. * * @example * ```ts no-run * import { createSharedRenderer } from "@johnmorrisdotca/kazoku-ui/renderer"; * import { setSharedRenderer } from "@johnmorrisdotca/chikyu-earth/realistic/element"; * * setSharedRenderer(createSharedRenderer({ load: () => import("three"), maxRatio: 1.5 })); * ``` */ export declare function setSharedRenderer(renderer: SharedRenderer | undefined): void; /** The page's renderer, made on first use. Call `release()` (from the result) when the element leaves. A `maxRatio` lower than the one it was made with makes a new one if no element holds it. */ export declare function takeRenderer(onContext: (state: ContextState) => void, maxRatio?: number): { renderer: SharedRenderer; release(): void; }; export {};