import { Region, District, Community, Settlement } from "./types"; export declare class GeoAPI { private readonly rawItems; private readonly indexToCode; private readonly codeToIndex; private readonly regions; private readonly districts; private readonly communities; private readonly settlements; constructor(); /** * Get all regions including independent settlements * @returns array of regions */ getAllRegions(): Region[]; /** * Get region by id * @param regionId - id of the region * @returns region or undefined */ getRegionById(regionId: string): Region | undefined; /** * Get all Region's districts * @param regionId - id of the region * @returns array of districts */ getAllRegionDistricts(regionId?: string): District[]; /** * Get district by id City or Region * @param districtId - id of the district * @returns district or undefined */ getDistrictById(districtId: string): District | undefined; /** * Get all communities * @param [districtId]? - id of the district (optional) * @returns Community[] or communities by districtId */ getAllCommunities(districtId?: string): Community[]; /** * Get community by id * @param communityId - id of the community * @returns Community or community by id */ getCommunityById(communityId: string): Community | undefined; /** * Search communities by name * @param substr - substring of the community name * @returns Community[] or communities by name */ searchCommunitiesByName(substr: string): Community[]; /** * Get all settlements * @param [opts] - options for filtering * @returns Settlement[] or settlements by regionId/districtId/communityId */ getAllSettlements(opts?: { regionId?: string; districtId?: string; communityId?: string; }): Settlement[]; /** * Get settlement by id * @param settlementId - id of the settlement * @returns Settlement or settlement by id */ getSettlementById(settlementId: string): Settlement | undefined; /** * Search settlements by name * @param substr - substring of the settlement name * @returns Settlement[] or settlements by name */ searchSettlementsByName(substr: string): Settlement[]; /** * Get all city districts * @param [cityId]? - id of the city * @returns District[] or districts by cityId */ getAllCityDistricts(cityId?: string): District[]; /** * Build regions * @returns Region[] or regions by category */ private buildRegions; /** * Build regional's and city's districts * * category === "P" or "B" * parent must exist (region or city) * * if parent is city, then it is a city district * if parent is region, then it is a regional district * * @returns District[] or districts by category */ private buildDistricts; /** * Build communities * * category === "H" * parent must exist (district) * * if parent is district, then it is a community * * @returns Community[] or communities by category */ private buildCommunities; /** * Build settlements * * category === "C" or "X" or "M" or "K" * * @returns Settlement[] or settlements by category */ private buildSettlements; } //# sourceMappingURL=geo-api.d.ts.map