本文へ移動

Kuni国

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

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

目次

リファレンス · ISO 3166-1にない地域

ReservedPlace型

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

A place outside ISO 3166-1, as the lookups hand it out (frozen).

インポート

import type { ReservedPlace } from "@johnmorrisdotca/kuni/reserved";

定義

interface ReservedPlace {
    id: string;
    code?: string;
    alpha3?: string;
    kind: ReservedKind;
    name: {
        en: string;
        ja: string | null;
    };
    status: "territory" | "disputed" | "uninhabited";
    parent?: string;
    subdivisions: readonly string[];
    until?: string;
    source: {
        name: string;
        url: string;
    };
}

メンバー

名前型説明
idstring

A name for it in kebab case that does not change: "ascension-island", "somaliland".

code (省略可)string | undefined

Its two letters, "AC" or "XA"; absent for a de-facto place, which has none.

alpha3 (省略可)string | undefined

The three letters CLDR gives a reserved code, "ASC"; absent where it gives none.

kind"iso-reserved" | "user-assigned" | "de-facto"

Which kind of place it is.

name{ en: string; ja: string | null; }

CLDR's names for a reserved code, Wikidata's labels otherwise; ja is null where the source has none.

status"territory" | "disputed" | "uninhabited"

"territory" or "uninhabited" for a reserved code, which is part of a state; "disputed" for the others.

parent (省略可)string | undefined

The alpha-2 code of the member of the United Nations Wikidata names as the country it is in, or as claiming it: "GB" for Ascension Island, "ES" for the Canary Islands. For a user-assigned or de-facto place it is what Wikidata records and says nothing about who governs it. Absent where Wikidata names none.

subdivisionsreadonly string[]

The ISO 3166-2 codes kuni has for the same place: ["SH-AC"], ["ES-CE", "ES-ML"]; empty where there is none.

until (省略可)string | undefined

The year Wikidata says it was dissolved, "2023"; absent for a place that still is.

source{ name: string; url: string; }

Where the code, or the place, comes from: a name and an address.

例

import type { ReservedPlace } from "@johnmorrisdotca/kuni/reserved";
import { reservedPlace } from "@johnmorrisdotca/kuni/reserved";

const value: ReservedPlace = reservedPlace("IC")!;
console.log(typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'id', 'kind', 'name', 'status', 'subdivisions', 'source' ]

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

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

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