import { IssueSink, type ValidateOptions } from './validate'; import { type CitySource, type CitySourceDraft, type CitySourceFileLayerName, type CitySourceLayerName, type CitySourceLayerReport, type CitySourceManifest, type CitySourceValidationReport } from './types'; export interface SerialisedCitySource { manifest: CitySourceManifest; /** Bytes of city-source.json; its sha256 is the source's identity. */ manifestBytes: Buffer; manifestSha256: string; /** Every other file, by path relative to the folder, ready to write. */ files: Map; } /** The uncompressed canonical bytes of one file layer. */ export declare function canonicalLayerBytes(name: CitySourceFileLayerName, source: Pick): Buffer; /** Everything the writer would put on disk, without touching it. */ export declare function serialiseCitySource(draft: CitySourceDraft): SerialisedCitySource; /** * The in-memory twin of write-then-read: the draft with its manifest layers (hashes, counts) and DEM hash filled in, ready * for `validateCitySource` before anything touches disk. Rows are not rounded or sorted here; the writer does that. */ export declare function finaliseCitySource(draft: CitySourceDraft): CitySource; export interface CitySourceWriteResult { dir: string; manifest: CitySourceManifest; /** The source identity: sha256 of city-source.json. */ manifestSha256: string; /** Paths written, relative to `dir`. */ files: string[]; } /** * Write a city-source folder. Files this call does not produce but that carry a layer name of this format (a stale * `roads.json` beside a new `roads.json.gz`) are removed so the folder never disagrees with its manifest. Nothing else in * the folder is touched. */ export declare function writeCitySource(dir: string, draft: CitySourceDraft): Promise; export interface LoadedCitySource { /** Whatever could be read; a layer that failed to load is left undefined and an error says why. */ source: CitySource; sink: IssueSink; layerFacts: Partial>>; manifestSha256: string | null; } /** Load a folder without throwing on data problems: every problem lands in `sink`. */ export declare function loadCitySource(dir: string, options?: { maxIssuesPerCode?: number; }): Promise; /** Strict read: integrity only. Throws a CitySourceError listing every file/parse/hash problem found. */ export declare function readCitySource(dir: string): Promise; /** The source's identity: sha256 of city-source.json. */ export declare function readCitySourceIdentity(dir: string): Promise; /** Load a folder and run every check: files, hashes and content. */ export declare function validateCitySourceFolder(dir: string, options?: ValidateOptions): Promise;