import { type CitySource, type Vec2 } from '../source'; import { type GroundFilter } from './ground'; import type { BuildingsStats } from './model'; /** Bump when a change to the generator changes any output byte (the digest gate in digest.spec.ts pins it). */ export declare const BUILDINGS_GENERATOR_VERSION = 1; export declare const BUILDINGS_MANIFEST_SCHEMA: "helix.city-buildings/1"; export declare const BUILDINGS_MANIFEST_FILE = "buildings.json"; export declare const CELL_INDEX_SCHEMA: "helix.city-buildings-index/1"; export interface BuildBuildingsOptions { out: string; cellM?: number; farCellM?: number; groundFilter?: GroundFilter; /** Plan only the first N buildings (by id): for smoke runs. */ limit?: number; /** Nothing is written; everything else runs (timing and sizes). */ dryRun?: boolean; } export interface FileRef { file: string; sha256: string; bytes: number; } export interface CellEntry { key: string; ix: number; iz: number; /** Scene metres of the cell origin the GLB and collider coordinates are relative to. */ origin: [number, number, number]; bounds: { min: [number, number, number]; max: [number, number, number]; }; buildings: number; meshBuildings: number; near: (FileRef & { triangles: number; vertices: number; }) | null; box: FileRef & { triangles: number; vertices: number; }; colliders: FileRef & { boxes: number; hulls: number; }; index: FileRef; } export interface FarEntry extends FileRef { key: string; ix: number; iz: number; /** Cluster-local coordinates: positions are relative to this origin (the centre of the cluster, y = 0). */ origin: [number, number, number]; bounds: { min: [number, number, number]; max: [number, number, number]; }; /** Fine cell keys in source order: `_HELIX_HLOD_SOURCE` value i is `cells[i]`. */ cells: string[]; triangles: number; buildings: number; quantizationErrorM: number; } export interface MeshBuildingEntry { id: string; cell: string; kind: string; ref: string; baseY: number; heightM: number; } export interface BuildingsManifest { schema: typeof BUILDINGS_MANIFEST_SCHEMA; generator: { name: 'helix-city-buildings'; version: number; }; source: { id: string; manifestSha256: string; }; options: { cellM: number; farCellM: number; groundFilter: string; groundKind: string; }; boundsXZ: [Vec2, Vec2]; cells: CellEntry[]; far: FarEntry[]; meshBuildings: MeshBuildingEntry[]; totals: { buildings: number; parts: number; meshBuildings: number; cells: number; nearTriangles: number; boxTriangles: number; farTriangles: number; nearBytes: number; boxBytes: number; colliderBytes: number; indexBytes: number; farBytes: number; colliders: number; nearBox: number; nearPoly: number; }; stats: BuildingsStats; } export interface BuildTimings { readMs: number; planMs: number; emitMs: number; encodeMs: number; writeMs: number; totalMs: number; } export interface BuildResult { manifest: BuildingsManifest; manifestSha256: string; timings: BuildTimings; out: string; } export declare function newStats(): BuildingsStats; /** Builds from a folder on disk (overrides applied, hashes verified). */ export declare function buildBuildings(sourceDir: string, options: BuildBuildingsOptions): Promise; export declare function buildBuildingsFromSource(source: CitySource, manifestSha256: string, options: BuildBuildingsOptions): Promise;