import { type AddressRecord } from "@mailwoman/resolver-wof-sqlite/address/record"; import { type StreetLocale } from "@mailwoman/resolver-wof-sqlite/labels/street/normalize"; import type { PathBuilderLike } from "path-ts"; import type { UnitSplitter } from "#adapters/street/unit"; /** * One row of an OpenAddresses run's CSV, under the lower-case keys the CSV reader gives it. */ export interface OpenAddressesRunRecord { lon?: string; lat?: string; number?: string; street?: string; unit?: string; city?: string; district?: string; region?: string; postcode?: string; id?: string; hash?: string; } /** * The ISO 3166-1 alpha-2 code a run's member path opens with, such as `US` for `us/wi/statewide`. * * @throws When the path's first segment isn't two letters. */ export declare function openAddressesRunCountry(member: string): string; /** * The ISO 3166-2 code a run's member path states, such as `US-WI` for `us/wi/statewide`, or `null` * when its second segment is a city or body rather than a two-letter subdivision code (`de/berlin`). */ export declare function openAddressesRunSubdivision(member: string): string | null; /** * The address record for one run row, or `null` when the row lacks a number, a street or a position. * * `CITY` becomes a written locality with its bare form beside it, `REGION` the region, * and `DISTRICT` the subregion, since US runs fill it with a county or borough. * The publisher's `ID`, then the run's `HASH`, identifies the point, and a row with * neither takes a digest of its number, street and position. * * A row whose `UNIT` is empty and whose street ends in a unit (`VERNON ST APT 114`, `COOGINS DR #106`) * has that unit split off, so the street key matches the same building's key in other sources. * Before that, a trailing city, state and postcode that repeat the row's own * fields are removed (`CHURCH ST STERLING, CO 80751`). * The digest identifier still reads the street as written. * * @param streetLocale The locale the street and house number keys are folded under. * The address layer's reader must fold a query for this country under the same locale. * @param units Splits a trailing unit off the street. * Without it the street is kept as written. */ export declare function openAddressesAddressRecord(row: OpenAddressesRunRecord, member: string, streetLocale: StreetLocale, units?: UnitSplitter): AddressRecord | null; /** * Streams the address records of one extracted OpenAddresses run CSV, skipping rows the record refuses. * * @param member The run's member path, such as `us/wi/statewide`, which supplies the source id and country. * @param streetLocale The locale {@link openAddressesAddressRecord} folds keys under. * @param units Splits a trailing unit off each street, as {@link openAddressesAddressRecord} describes. */ export declare function readOpenAddressesRunRecords(csvPath: PathBuilderLike, member: string, streetLocale: StreetLocale, units?: UnitSplitter): AsyncGenerator; /** * The file name a run's batch job output is cached under, such as `us__mi__statewide.source.geojson.gz`. */ export declare function openAddressesSourceCacheName(member: string): string; /** * Streams the address records of one OpenAddresses batch job's `source.geojson.gz`, * as cached by `fetchOpenAddressesSources`, skipping features the record refuses. * * The reader decompresses the file as it streams, so the run is never extracted to disk. * A feature without a point geometry has no position, and the record refuses it. * * @param member The run's member path, such as `us/mi/statewide`, which supplies the source id and country. */ export declare function readOpenAddressesGeoJSONRunRecords(geojsonPath: PathBuilderLike, member: string, streetLocale: StreetLocale, units?: UnitSplitter): AsyncGenerator; //# sourceMappingURL=openaddresses.d.ts.map