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; |
role | CapitalRole | What it is the capital for. |
disputed (省略可) | boolean | undefined | Present and |
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出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。