import { APIClient } from "@mailwoman/core/api"; import { type PathBuilderLike } from "path-ts"; import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download"; import { type USGSStructureFeature, type USGSStructureProperties } from "#us/adapters/usgov/usgs-structures/adapter"; import { type USGSStructureLayer } from "#us/structures/usgs/layers"; /** * The structures MapServer. * * Its description states the publisher's terms and refresh date. */ export declare const USGS_STRUCTURES_SERVICE_URL = "https://carto.nationalmap.gov/arcgis/rest/services/structures/MapServer"; /** * The service's `maxRecordCount`: the most features one query returns. */ export declare const USGS_STRUCTURES_PAGE_SIZE = 2000; /** * The service fields the fetcher asks for, in the service's spelling. */ export declare const USGS_STRUCTURE_FIELDS: readonly ["OBJECTID", "PERMANENT_IDENTIFIER", "FCODE", "GNIS_ID", "NAME", "ADDRESSBUILDINGNAME", "ADDRESS", "CITY", "STATE", "ZIPCODE", "LOADDATE", "SOURCE_ORIGINATOR"]; /** * The file the service description is saved to, beside the features. */ export declare const USGS_STRUCTURES_SERVICE_FILENAME = "service.json"; /** * What one layer contributed to a run. */ export interface USGSStructuresLayerCount { layer_id: number; layer: string; name: string; feature_count: number; } /** * What one run recorded. * * `publisher_version` is the service's `copyrightText`, which states its * refresh (`USGS TNM – National Structures Dataset. Data Refreshed October, 2026.`). */ export interface USGSStructuresManifest extends SourceManifest { service_url: string; feature_count: number; layers: USGSStructuresLayerCount[]; } /** * The ZIP Code fields for one structure. * * A known state passes the value through `normalizeZIPCode`, which restores leading zeros a numeric * value lost (`725` in Puerto Rico is `00725`) and reads a value that isn't a ZIP Code as `null`. * An unknown state keeps the trimmed value. * * The published value is kept beside the result whenever the two differ. */ export declare function structureZIPCode(value: unknown, state: string | null): Pick; /** * One service feature of `layer` in the shape the adapter reads. * * @throws When the value isn't a GeoJSON feature, or has no `OBJECTID`. */ export declare function normalizeStructureFeature(value: unknown, layer: Pick): USGSStructureFeature; /** * Per-invocation options. */ export interface DownloadUSGSStructuresOptions { outputDir: PathBuilderLike; /** * The layers to pull. * * @defaultValue {@linkcode USGS_STRUCTURE_LAYERS} */ layers?: readonly USGSStructureLayer[]; signal?: AbortSignal; report?: (line: string) => void; } /** * Pages every layer into `/structures.geojsonl` and writes the manifest. * * The features are written to a staging file. * It moves into place only once every layer's pull holds the feature count the service stated. * A failed run leaves the previous file as it was. * * @throws When the service answers an error, a page that isn't a FeatureCollection, * or a layer pull whose size differs from its count. */ export declare function downloadUSGSStructures(client: Pick, options: DownloadUSGSStructuresOptions): Promise; /** * The path `#us/adapters/usgov/usgs-structures/adapter` reads, given the root a fetch wrote under. */ export declare function usgsStructuresInputPath(outRoot: BaseFetchOptions["outRoot"]): PathBuilderLike; /** * Per-invocation options for the registry entry. */ export interface FetchUSGSStructuresOptions extends BaseFetchOptions { signal?: AbortSignal; } /** * The registry entry. */ export declare function fetchUSGSStructures(options: FetchUSGSStructuresOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=structures.d.ts.map