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;
};
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | string | 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; |
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. |
subdivisions | readonly 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' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。