import type { PathBuilderLike } from "path-ts"; import { type ClassRoots } from "#tools/fetch/wikidata/vital-places/classify"; import { type VitalEntity, type VitalEntityRecord } from "#tools/fetch/wikidata/vital-places/entities"; /** * One line of the places file: a kept entity with the codes of its countries. */ export interface VitalPlace extends VitalEntity { /** * The ISO 3166-1 alpha-2 codes of the `P17` countries that state one, in claim order. */ countryCodes: string[]; } /** * Why a ranked record isn't in the places file. */ export declare const EXCLUSION_REASONS: { readonly missing: "missing"; readonly noCoordinate: "no-coordinate"; readonly excluded: "excluded"; readonly unclassified: "unclassified"; }; export type ExclusionReason = (typeof EXCLUSION_REASONS)[keyof typeof EXCLUSION_REASONS]; /** * The counts written beside the places file. */ export interface VitalPlaceCounts { records: number; places: number; excluded: Record; /** * Places per country code; `??` counts a place whose countries state no code or that has no country. */ byCountry: Record; /** * Places per `P31` class id, a place with several classes counted under each. */ byClass: Record; } /** * The code every place without one is counted under. */ export declare const UNKNOWN_COUNTRY = "??"; /** * The inventory built from the records, the class roots and the country codes. */ export interface VitalInventory { places: VitalPlace[]; counts: VitalPlaceCounts; } /** * Sort the kept places and count them. * * A record is a place when it has a coordinate on Earth and {@linkcode placeVerdict} * answers `place` for its classes. * The counts record every other record under its reason, so the file's totals reconcile with the list. */ export declare function buildInventory(records: readonly VitalEntityRecord[], roots: Readonly, countryCodes: Readonly>): VitalInventory; /** * Write the places as JSONL and the counts as JSON. */ export declare function writeInventory(inventory: VitalInventory, placesPath: PathBuilderLike, countsPath: PathBuilderLike): Promise; //# sourceMappingURL=inventory.d.ts.map