import * as THREE from 'three'; import type { Tile } from '../../geometry/hexasphere.types'; import type { TerrainLevel } from '../types/terrain.types'; /** * Resolves the geometry context for a tile (tile data + terrain level) used by * overlay primitives. Returned from {@link TileGeometryQuery} callbacks. */ export interface TileGeometryContext { tile: Tile; level: TerrainLevel; } /** Lookup function resolving a tile id to its geometry context. */ export type TileGeometryQuery = (tileId: number) => TileGeometryContext | null; /** * Visual layout modes supported by {@link createTileOverlayMesh}. * * - `fill` — triangle fan covering the top face of each tile. * - `border` — thin inset perimeter ring on the top face. * - `fill-sides` — triangle fan on the top face plus the entire side wall strip. * - `border-sides`— inset border on the top face plus the entire side wall strip. */ export type TileOverlayKind = 'fill' | 'border' | 'fill-sides' | 'border-sides'; /** * Configuration for a single overlay layer rendered on top of the hex mesh. * All distances are in world units; all angles/fractions are normalised. */ export interface TileOverlayOptions { /** Base overlay color. */ color: number | THREE.Color; /** Alpha applied to the material. */ opacity?: number; /** Optional blending override (defaults to normal). */ blending?: THREE.Blending; /** Layout variant (fill / border / with sides). */ kind: TileOverlayKind; /** Radial offset added to the baseline surface offset of the body. */ surfaceOffset: number; /** Border width as a fraction of tile avg radius (border kinds only). */ borderWidth?: number; /** Ring expand factor applied to fill kinds (0 = flush with boundary). */ ringExpand?: number; /** THREE renderOrder for the mesh. */ renderOrder?: number; /** Starts hidden; call setTiles to reveal. */ initiallyVisible?: boolean; } /** * Handle returned by {@link createTileOverlayMesh}. Wraps a reusable mesh * whose geometry is rebuilt on demand to cover a given set of tiles. */ export interface TileOverlayMesh { /** Underlying THREE mesh — caller adds/removes from any parent group. */ mesh: THREE.Mesh; /** * Rebuilds the overlay geometry for the given tiles. Pass null or an * empty array to hide the overlay. */ setTiles(tileIds: number[] | null): void; /** Disposes the geometry + material. */ dispose(): void; } /** * Creates a reusable tile-overlay mesh — a shared geometry that can be * rebuilt at any time to cover an arbitrary set of tiles with a single * merged draw call. * * @param query - Resolves tile id → geometry context (tile data + level). * @param opts - Visual options (color, layout, offset, blending). */ export declare function createTileOverlayMesh(query: TileGeometryQuery, opts: TileOverlayOptions): TileOverlayMesh; //# sourceMappingURL=TileOverlayMesh.d.ts.map