SubdivisionFactstype
The facts about one subdivision, from the /subdivision-facts entry: null where Wikidata has none, or gives two.
Import it
import type { SubdivisionFacts } from "@johnmorrisdotca/kuni/subdivision-facts";
Definition
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;
}
Members
| Name | Type | Description |
|---|---|---|
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 |
Examples
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'
]What it prints (run when this page was built)