Reference · Places: countries of a continent, and search (the size counts every tier)
CityNametype
A city in a country's light list (@johnmorrisdotca/kuni/cities/names-<code>): its id and names only, for a picker to show before it fetches the rest, and whether it is one of the country's major cities (its capital, or one of its first twenty, ranked by the urban area each heads).
Import it
import type { CityName } from "@johnmorrisdotca/kuni/places";
Definition
interface CityName {
id: string;
name: {
en: string;
ja?: string;
jaShort?: string;
jaReading?: string;
native?: string;
};
major: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
id | string | The city's id, as |
name | { en: string; ja?: string; jaShort?: string; jaReading?: string; native?: string; } | Its names, as |
major | boolean | True for the country's national capital and its first twenty cities. |
Examples
import type { CityName } from "@johnmorrisdotca/kuni/places";
const tokyo: CityName = { id: "Q1490", name: { en: "Tokyo", ja: "東京都", jaShort: "東京" }, major: true };
console.log(tokyo.name.jaShort);東京What it prints (run when this page was built)