export interface CityCandidate { _id: unknown; name: string; searchNames?: string[]; featureCode?: string; population?: number; location?: { coordinates: number[]; }; } export type CityMatchedVia = /** The name matched and the city is within the radius. Trustworthy. */ "name+geo" /** The name matched but no coordinates were supplied to confirm it. */ | "name" /** No name matched; nearest non-section city within the radius. Weak. */ | "geo"; export interface CityMatch { city: T; matchedVia: CityMatchedVia; /** Undefined when the caller supplied no coordinates. */ distanceKm?: number; /** More than one candidate scored equally; the caller may want to review. */ ambiguous: boolean; } export declare function haversineKm(a: number[], b: number[]): number; /** * The spellings worth trying for one source string, most specific first. * * Upstream city fields carry three recurring shapes, and each needs the whole * string dropped rather than repaired: * "São Paulo, São Paulo" -> the province is appended after a comma * "Bayrūt (Beirut)" -> the English name is parenthesised * "Villeneuve d'Ascq"-> HTML entities survived the scrape * * Every variant is normalized, so accents and punctuation are already gone by * the time these are compared against `searchNames`. */ export declare function cityNameVariants(raw: string): string[]; /** * Pick the best city for a venue from a pre-fetched candidate list. * * `candidates` should already be scoped to the venue's country — this function * does not check country, because the caller's query is the cheaper place to do * it. Pass coordinates as GeoJSON `[longitude, latitude]`, matching how they * are stored; passing them the other way round will silently produce matches on * the wrong continent. */ export declare function matchCity(cityName: string | undefined, coordinates: number[] | undefined, candidates: T[], radiusKm?: number): CityMatch | null; //# sourceMappingURL=city-matcher.d.ts.map