import { type PathBuilderLike } from "path-ts"; import { type NameSlot } from "#adapters/wof/json-rows"; import type { CanonicalRow } from "#types"; import { type WOFRecord } from "#utils"; /** * The relative path of a feature inside a WOF repo. * * `421205765` is at `data/421/205/765/421205765.geojson`. * WOF splits the decimal id into groups of three digits from the left. * `1021` is at `data/102/1/1021.geojson`. */ export declare function wofFeatureRelativePath(id: number): string; /** * The repos under `reposRoot`, as paths relative to it, per-country admin repos first, then the rest. * * A repo is a directory holding `data/`, directly under the root, where `gazetteer inspect sync` clones it. */ export declare function listWOFRepos(reposRoot?: PathBuilderLike): Promise; /** * The file holding a feature, searched across every repo, or `null` when none holds it. * * A caller looking up several features passes the {@linkcode listWOFRepos} result once. */ export declare function findWOFFeaturePath(id: number, reposRoot?: PathBuilderLike, repos?: readonly string[]): Promise; /** * One rendered row of an explored record. */ export interface ExploredRow { /** * The variant suffix of the `source_id`: `locality`, `localized-jpn-country`, … */ suffix: string; raw: string; components: CanonicalRow["components"]; source_id: string; /** * The country whose order and join rendered the row, when it isn't the record's own. */ country: string; } /** * The rows rendered from one name slot. */ export interface ExploredSlot { slot: NameSlot; rows: ExploredRow[]; } /** * Everything one record renders, with what was read to render it. */ export interface WOFExploration { record: WOFRecord; /** * The file the record was read from. */ path: string; /** * Ancestors read, nearest first. */ ancestors: WOFRecord[]; /** * Ancestor ids the record names whose file was not found or was skipped. * * This list keeps each missing ancestor visible. */ unresolvedAncestors: number[]; slots: ExploredSlot[]; } export interface ExploreOptions { /** * Directory holding the `whosonfirst-data-*` repos. * * @defaultValue `$MAILWOMAN_CACHE_ROOT/sources/wof-repos` */ reposRoot?: PathBuilderLike; } /** * Render every row the `wof-admin` adapter emits for one record. * * @throws When no repo holds the record, or its file isn't a record the adapter reads. */ export declare function exploreWOFRecord(id: number, options?: ExploreOptions): Promise; /** * One augmentation's output for an explored row. */ export interface AugmentedExploredRow { /** * The `AUGMENTATIONS` id: `drop-commas`, `case-upper`, … */ augmentation: string; raw: string; components: CanonicalRow["components"]; source_id: string; } /** * Apply every registered augmentation to a row, keeping those that produce a row different from it. * * An augmentation that doesn't apply to the row returns `null` and is left out. */ export declare function augmentExploredRow(row: ExploredRow): AugmentedExploredRow[]; //# sourceMappingURL=explore.d.ts.map