SubdivisionFacts型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The facts about one subdivision, from the /subdivision-facts entry: null where Wikidata has none, or gives two.
インポート
import type { SubdivisionFacts } from "@johnmorrisdotca/kuni/subdivision-facts";
定義
interface SubdivisionFacts {
code: string;
capital: {
en: string;
ja: string | null;
reading?: string;
} | null;
capitalPoint: LatLon | null;
population: number | null;
populationYear: number | null;
areaKm2: number | null;
areaYear: number | null;
point: LatLon | null;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
code | string | ISO 3166-2, "JP-13" |
capital | { en: string; ja: string | null; reading?: string; } | null | The seat of its government; reading in hiragana |
capitalPoint | LatLon | null | The capital's coordinates |
population | number | null | People, from Wikidata |
populationYear | number | null | The year the population is for, where Wikidata says |
areaKm2 | number | null | Area in square kilometres, from Wikidata |
areaYear | number | null | The year the area is for, where Wikidata says |
point | LatLon | null | Wikidata's coordinate location for the subdivision |
例
import type { SubdivisionFacts } from "@johnmorrisdotca/kuni/subdivision-facts";
import { loadSubdivisionFacts } from "@johnmorrisdotca/kuni/subdivision-facts";
const value: SubdivisionFacts = (await loadSubdivisionFacts("JP"))![0];
console.log(typeof value === "object" ? Object.keys(value).slice(0,6) : value);[
'code',
'capital',
'capitalPoint',
'population',
'populationYear',
'areaKm2'
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。