import type * as THREE from "three"; import type { ThreeParts } from "../realistic/textures.ts"; /** * What the grid has done: whether it is drawn, whether it shows the lines every 15 degrees (else every 30), how many segments the last draw had, and how many times its lines were made. * * @example * ```ts no-run * import type { GridStats } from "@johnmorrisdotca/chikyu-earth/realistic"; * * const none: GridStats = { shown: false, fine: false, segments: 0, builds: 0, failed: false }; * console.log(none); * ``` */ export interface GridStats { shown: boolean; fine: boolean; segments: number; builds: number; failed: boolean; } /** What the element and the scene share: whether the grid is on, and what it did. */ export interface GridState { on: boolean; onError?: (error: unknown) => void; stats: GridStats; } export declare const newGridState: () => GridState; export interface GridLayer { /** Shows or hides the grid for this draw, finer or coarser by the Earth's radius on the screen (CSS pixels). */ sync(radius: number): void; dispose(): void; } /** * Makes the grid under `parent` (the group that turns with the Earth). * * @param three - The page's three.js; it must have `LineSegments`. * @param parent - The Earth's own group. * @param state - The model's grid. * @param sunDir - The direction to the Sun in the world's axes, the uniform the Earth's surface is lit by. * @param order - The render order: after the ground, before the clouds. * @returns The layer. */ export declare function createGridLayer(three: ThreeParts, parent: THREE.Object3D, state: GridState, sunDir: { value: THREE.Vector3; }, order: number): GridLayer;