import { type SceneTerrainGrid, type SceneTerrainMaterial, type SceneTerrainSplatLayers } from '@hypersoniclabs/helix-manifest'; import type { TerrainSource } from './tile'; export declare const TERRAIN_SOURCE_SCHEMA = "helix.terrain-source/1"; export declare const TERRAIN_SOURCE_MANIFEST = "terrain.json"; /** * Writes the terrain source folder. Every JSON key is sorted and the file ends in a newline, so re-writing an * unchanged terrain produces byte-identical bytes and leaves no diff. */ export declare function writeTerrainSource(dir: string, source: TerrainSource): Promise; /** Reads the folder back and verifies every recorded sha256; a rewritten or truncated object fails here, not in the browser. */ export declare function readTerrainSource(dir: string): Promise; /** One object of the folder, as the manifest records it. `path` is relative to the folder root. */ export interface TerrainSourceFile { path: string; bytes: number; sha256: string; } export interface TerrainSourceLayerIndex { heights: TerrainSourceFile; splat?: TerrainSourceFile; normals?: TerrainSourceFile; layers?: SceneTerrainSplatLayers; heightMin: number; heightMax: number; } export interface TerrainSourceIndex { dir: string; grid: SceneTerrainGrid; tiles: Array; coarse: TerrainSourceLayerIndex & { metresPerSample: number; }; material: SceneTerrainMaterial | null; } /** * The folder's object table — paths, byte lengths and verified digests — without decoding a heightfield. Both scene * compilers read a terrain through this: they ship the bytes as they lie, they never resample them. */ export declare function readTerrainSourceIndex(dir: string): TerrainSourceIndex;