本文へ移動

Kuni国

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

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

目次

リファレンス · /capitals

CountryCapital型

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

One capital city of a country that has more than one, or whose capital is not the one capital names alone, from capitalsOf in the /capitals entry.

インポート

import type { CountryCapital } from "@johnmorrisdotca/kuni/capitals";

定義

interface CountryCapital {
    name: {
        en: string;
        ja: string | null;
    };
    role: CapitalRole;
    disputed?: boolean;
    note?: string;
}

メンバー

名前型説明
name{ en: string; ja: string | null; }

The city's name: kuni's own, in English and Japanese; ja is null where kuni has no Japanese name for it.

roleCapitalRole

What it is the capital for.

disputed (省略可)boolean | undefined

Present and true where the country's capital is disputed. No entry has it yet: a disputed capital is a decision for the maintainer, so Israel and the Palestinian Territories have no entry.

note (省略可)string | undefined

Where the source's word for the role is not one of the five, the word, and what the source says of the country's other cities; absent where there is nothing to add.

例

import type { CountryCapital } from "@johnmorrisdotca/kuni/capitals";
import { capitalsOf } from "@johnmorrisdotca/kuni/capitals";

const value: CountryCapital = capitalsOf("ZA")![1];
console.log(value.name.en, value.role); // "Cape Town" "legislative"
Cape Town legislative

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

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

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