/** * `@mailwoman/un-locode-lookup` — place → UN/locode (unece Code for Trade and Transport Locations). * * Two ways in: by country + place name (exact, diacritic-folded), or by nearest * coordinate (for the ~⅓ of entries that have one). * Backed by a `node:sqlite` table built from the unece code list. * An `@mailwoman/annotations` `Annotator`. */ import type { Annotator } from "@mailwoman/annotations"; import { SQLiteLookup, type SQLiteLookupOptions } from "@mailwoman/sqlite/lookup"; import type { UNLocodeDatabase } from "#schema"; /** * Fold a place name to its match key: strip diacritics, lowercase, collapse whitespace. */ export declare function foldName(name: string): string; /** * Parse a UN/locode coordinate (`"4923N 01522E"`) to decimal degrees, or null if absent/malformed. */ export declare function parseUNLocodeCoords(raw: string): { lat: number; lon: number; } | null; /** * Where a {@link UNLocodeLookup} reads from. */ export type UNLocodeLookupOptions = SQLiteLookupOptions; /** * A UN/locode lookup over a built `node:sqlite` table. */ export declare class UNLocodeLookup extends SQLiteLookup { #private; constructor(opts: UNLocodeLookupOptions); /** * The UN/locode (`"US NYC"`) for a country + place name, or null. */ byName(country: string, name: string): string | null; /** * The nearest coordinate-containing UN/locode within `maxKm`, or null. */ nearest(lat: number, lon: number, maxKm?: number): string | null; } /** * Build an `Annotator` filling `AnnotationSet.unLocode`. * * Prefers a country + place-name match (when the resolver supplies them via `countryCode` / `placeName`), * and falls back to the nearest coordinate. */ export declare function makeUNLocodeAnnotator(lookup: UNLocodeLookup, opts?: { maxKm?: number; }): Annotator; //# sourceMappingURL=index.d.ts.map