リファレンス
都市の検索と読み込み(段階は必要なときに読み込まれ、サイズはすべての段階を含みます)
import { … } from "@johnmorrisdotca/kuni/cities";
最小化と gzip 圧縮をしたサイズは 1493.8 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
citiesOf | 関数 | One country's cities, every tier together, the most populous first: the same list as |
City | 型 | One city, as every tier hands it out (frozen): plain numbers and codes, null where no source has the fact. |
CITY_TIERS | 定数 | The names of the four tiers, in the order of their size. |
CityAt | 型 | A city and how far it is from the point asked about. |
cityById | 関数 | One city, by its id: a Wikidata item ("Q90") or "ne:<number>", in either case; an id that was merged into another city answers with the city it became. |
citySet | 関数 | Joins lists of cities (a tier's list, or several) into one set with the lookups built once. |
CitySet | 型 | Cities joined for lookups: by id, by country, by subdivision and by nearness. |
CitySource | 型 | Which input a fact in a city's record came from. |
CityTier | 型 | The four tiers, smallest first: capitals (every capital, of a country or a subdivision, of any size), 1m (the other cities of a million people or more), 100k (the others of 100,000 or more) and 15k (the others of 15,000 or more). |
loadCities | 関数 | The cities of the tiers asked for, fetched with a dynamic import (a bundler makes a chunk of each tier) and joined into one set. |
NearestOptions | 型 | What nearest and within may be asked. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。