import { type HelixSceneV2, type PlacementPrototype, type PlacementRecord } from '@hypersoniclabs/helix-manifest'; import { type GroundContact, type GroundSampler } from './ground'; import { type PlacementsBake } from './source'; /** How far a trunk sits in the ground: the 3 cm every CS2 tree was baked with (`replacementTreeRecord`). */ export declare const SNAP_EMBED_M = 0.03; /** A base further above the final ground than this stands on something (a roof garden, a deck) and keeps its authored height. */ export declare const SNAP_MAX_ELEVATED_M = 3; export interface SnapOptions { embedMetres?: number; /** Bases more than this above the ground are left where they are (default SNAP_MAX_ELEVATED_M); buried records are always lifted. */ maxElevatedMetres?: number; } export interface SnapStats { instances: number; moved: number; raised: number; lowered: number; /** Left alone: already seated, or elevated past maxElevatedMetres. */ settled: number; /** Records of `captured` prototypes (helix-manifest `support`), left where their source put them. */ captured: number; keptElevated: number; maxRaisedMetres: number; maxLoweredMetres: number; } /** Pure: the records re-seated on `ground`, and what that did. `records` is not mutated. */ export declare function snapRecords(records: readonly PlacementRecord[], prototypes: readonly PlacementPrototype[], ground: GroundSampler, options?: SnapOptions): { records: PlacementRecord[]; stats: SnapStats; }; export interface SnapPlacementsBakeOptions extends SnapOptions { /** The ground at the highest LOD of the FINAL terrain (`readGroundSampler`). */ ground: GroundSampler; } export interface SnapPlacementsReport { instances: number; moved: number; raised: number; lowered: number; keptElevated: number; maxRaisedMetres: number; maxLoweredMetres: number; /** Off-ground counts (GROUND_TOLERANCE_M) against the final terrain, before and after. */ before: GroundContact; after: GroundContact; regions: number; regionsRewritten: number; distantPages: number; distantPagesRewritten: number; } /** * Reads the validated placements bake in `input` and writes the same bake to the new folder `output` with every record seated * on `options.ground`. Unchanged files are cloned (APFS copy-on-write where available); only the regions that moved and the * distant pages built from them get new content-addressed files. The result is validated before `placements.json` appears. */ export declare function snapPlacementsBake(input: string, output: string, options: SnapPlacementsBakeOptions): Promise<{ bake: PlacementsBake; report: SnapPlacementsReport; }>; /** * Points a Scene v2 document (MUTATED, not resealed) at the placements bake in `directory`: its `placements` declaration and every * placements resource are replaced; resources the new bake does not ship are dropped. */ export declare function replaceScenePlacements(scene: HelixSceneV2, directory: string): { removed: number; added: number; }; /** Reseals `scene` the way every Scene v2 builder does (revision from the zeroed digest, then the integrity) and validates it. */ export declare function sealScene(scene: HelixSceneV2): HelixSceneV2; export declare function formatSnapReport(report: SnapPlacementsReport): string;