本文へ移動

Kuni国

国、コード、名前、行政区画を調べ、必要なときに国のデータを読み込み、標準の国のカードを表示できます。

「国(くに)」は、国を表す日本語です。 名前について(英語)

目次

リファレンス · 場所:大陸の国と検索(サイズはすべての段階を含みます)

CityName型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 type { CityName } from "@johnmorrisdotca/kuni/places";

定義

interface CityName {
    id: string;
    name: {
        en: string;
        ja?: string;
        jaShort?: string;
        jaReading?: string;
        native?: string;
    };
    major: boolean;
}

メンバー

名前型説明
idstring

The city's id, as City.id.

name{ en: string; ja?: string; jaShort?: string; jaReading?: string; native?: string; }

Its names, as City.name.

majorboolean

True for the country's national capital and its first twenty cities.

例

import type { CityName } from "@johnmorrisdotca/kuni/places";

const tokyo: CityName = { id: "Q1490", name: { en: "Tokyo", ja: "東京都", jaShort: "東京" }, major: true };
console.log(tokyo.name.jaShort);
東京

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kuni 1.19.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。