import type { PathBuilderLike } from "path-ts"; import { type CanonicalRow, type CorpusAdapter } from "#types"; /** * Registry id for this adapter, stamped into every row it emits. */ export declare const LV_VARIS_ADAPTER_ID = "lv-varis"; /** * The one jurisdiction this adapter emits. */ export declare const LV_VARIS_COUNTRIES: readonly string[]; /** * The license data.gov.lv names for the dataset. */ export declare const LV_VARIS_LICENSE = "CC-BY-4.0"; /** * The credit CC BY 4.0 obliges. */ export declare const LV_VARIS_ATTRIBUTION = "Valsts zemes dienests, Valsts adre\u0161u re\u0123istra atv\u0113rtie dati, via data.gov.lv"; /** * The register tables the adapter reads, by the file name the portal serves each under. */ export declare const VARIS_TABLES: { readonly Building: "aw_eka.csv"; readonly Street: "aw_iela.csv"; readonly Village: "aw_ciems.csv"; readonly Parish: "aw_pagasts.csv"; readonly Municipality: "aw_novads.csv"; readonly City: "aw_pilseta.csv"; }; export type VarisTable = (typeof VARIS_TABLES)[keyof typeof VARIS_TABLES]; /** * The register's addressing-object type codes, `TIPS_CD` and `VKUR_TIPS`. */ export declare const VarisObjectType: { readonly Country: "101"; readonly City: "104"; readonly Parish: "105"; readonly Village: "106"; readonly Street: "107"; readonly Building: "108"; readonly Municipality: "113"; }; export type VarisObjectType = (typeof VarisObjectType)[keyof typeof VarisObjectType]; /** * Why a building record didn't become a row. */ export declare const VarisRefusal: { /** * `STATUSS` is `DEL`: the address was removed. */ readonly Removed: "row:status-removed"; /** * `STATUSS` is `ERR`: the register marks the address erroneous. */ readonly Erroneous: "row:status-erroneous"; /** * `STATUSS` holds a value the register's documentation doesn't list. */ readonly UnknownStatus: "row:status-unknown"; /** * A code in the parent chain identifies no object in the tables read. */ readonly ParentUnresolved: "row:parent-unresolved"; /** * An object in the parent chain isn't active. */ readonly AncestorInactive: "row:ancestor-inactive"; /** * The chain holds an object type in a place no address shape allows. */ readonly UnexpectedHierarchy: "row:unexpected-hierarchy"; /** * The record has no `LV-` postcode. */ readonly PostcodeAbsent: "row:postcode-absent"; /** * A building on a street has a name with no digit where its number belongs. */ readonly NamedHouseOnStreet: "row:named-house-on-street"; /** * The string composed from the chain differs from the register's `STD`. */ readonly StandardFormMismatch: "row:standard-form-mismatch"; }; export type VarisRefusal = (typeof VarisRefusal)[keyof typeof VarisRefusal]; /** * The shape of an address, read from its parent chain. */ export declare const VarisAddressType: { /** * A street address in one of the state cities. * Those cities lie under no municipality. */ readonly StateCityStreet: "state-city-street"; /** * A street address in a town of a municipality. */ readonly TownStreet: "town-street"; /** * A street address in a village. */ readonly VillageStreet: "village-street"; /** * A house with its own name in a city, on no street. */ readonly CityNamedHouse: "city-named-house"; /** * A house with its own name in a village. */ readonly VillageNamedHouse: "village-named-house"; /** * A house with its own name in a parish, in no village. */ readonly ParishNamedHouse: "parish-named-house"; }; export type VarisAddressType = (typeof VarisAddressType)[keyof typeof VarisAddressType]; /** * The columns read from every table. */ export interface VarisRecord { KODS: string; TIPS_CD: string; STATUSS: string; VKUR_CD: string; VKUR_TIPS: string; NOSAUKUMS: string; ATRIB: string; STD: string; } /** * One object a building's parent chain passes through. */ export interface VarisPlace { type: string; name: string; parentCode: string; active: boolean; } /** * The places of the five parent tables, keyed by object code. */ export type VarisPlaces = ReadonlyMap; export type VarisReading = { readonly admitted: CanonicalRow; readonly addressType: VarisAddressType; } | { readonly refused: VarisRefusal; }; /** * The object code the register gives Latvia, the parent of every municipality and state city. * No table read holds it as a row. */ export declare const VARIS_COUNTRY_CODE = "100000000"; /** * Reads one building record into a row or the reason it is refused. */ export declare function readVarisBuilding(record: VarisRecord, places: VarisPlaces): VarisReading; /** * Streams one table's records, each value as stored. * * The reader turns trimming off because `STD` keeps a stored trailing space inside a building name's quotes. * The composition check compares the two. */ export declare function readVarisTable(path: PathBuilderLike): AsyncIterable; /** * Reads the five parent tables into one map keyed by object code. */ export declare function readVarisPlaces(directory: PathBuilderLike): Promise>; export declare function createVarisAdapter(): CorpusAdapter; /** * The configured adapter instance registered with the corpus builder. */ export declare const varisAdapter: CorpusAdapter; //# sourceMappingURL=adapter.d.ts.map