CountryFactstype
The facts about one country, from the /facts entry: plain numbers and codes, null where a source has none.
Import it
import type { CountryFacts } from "@johnmorrisdotca/kuni/facts";
Definition
interface CountryFacts {
alpha2: string;
population: number | null;
populationYear: number | null;
areaKm2: number | null;
areaYear: number | null;
areaOf: "whole" | "land" | null;
point: LatLon | null;
capitalPoint: LatLon | null;
borders: readonly string[];
drivingSide: DrivingSide | null;
weekStart: WeekStart;
measurement: MeasurementSystem;
paper: PaperSize;
hourCycle: HourCycle;
}
Members
| Name | Type | Description |
|---|---|---|
alpha2 | string | ISO 3166-1 alpha-2, "JP" |
population | number | null | People, from Wikidata; null where there is no permanent population (Antarctica) |
populationYear | number | null | The year the population is for; null only where the figure has none (0, uninhabited) |
areaKm2 | number | null | Area in square kilometres, from Wikidata |
areaYear | number | null | The year the area is for, where Wikidata says; most areas carry no year |
areaOf | "whole" | "land" | null | "land" where the only figure is for the land alone; null with no area |
point | LatLon | null | Wikidata's coordinate location for the country: a representative point, not a computed centroid |
capitalPoint | LatLon | null | The capital's coordinates; null where there is no capital |
borders | readonly string[] | Alpha-2 codes of the countries it shares a land border with; [] for an island |
drivingSide | DrivingSide | null | null where there are no public roads |
weekStart | WeekStart | The first day of the week on a calendar there, from CLDR: "mon" for most, "sun" for the United States and Japan. |
measurement | MeasurementSystem | The system of measurement in everyday use, from CLDR: "metric", or "US" and "UK". |
paper | PaperSize | The paper size in everyday use, from CLDR: "A4", or "US-Letter" in the Americas' Letter countries. |
hourCycle | HourCycle | The clock CLDR prefers there: "h12" (1 to 12, with AM and PM) or "h23" (0 to 23). |
Examples
import type { CountryFacts } from "@johnmorrisdotca/kuni/facts";
import { facts } from "@johnmorrisdotca/kuni/facts";
const value: CountryFacts = facts("JP")!;
console.log(typeof value === "object" ? Object.keys(value).slice(0,6) : value);[
'alpha2',
'population',
'populationYear',
'areaKm2',
'areaYear',
'areaOf'
]What it prints (run when this page was built)