本文へ移動

Kuni国

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

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

目次

リファレンス · /subdivision-names/es

SubdivisionNames型

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

One language's subdivision names: what an entry @johnmorrisdotca/kuni/subdivision-names/<language> exports. Every function is pure.

インポート

import type { SubdivisionNames } from "@johnmorrisdotca/kuni/subdivision-names/es";

ほかのエクスポート元: @johnmorrisdotca/kuni/subdivision-names/de, @johnmorrisdotca/kuni/subdivision-names/zh-Hans, @johnmorrisdotca/kuni/subdivision-names/zh-Hant

定義

interface SubdivisionNames {
    readonly language: SubdivisionNamesLanguage;
    subdivisionName(code: string): string | null;
    subdivisionNameSource(code: string): NameSource | null;
    subdivisionsByName(text: string, options?: SubdivisionNamesSearchOptions): readonly string[];
    subdivisionByName(text: string, options?: SubdivisionNamesSearchOptions): string | null;
    subdivisionsOf(countryCode: string): readonly NamedSubdivision[];
    count(): number;
    fold(text: string): string;
}

メンバー

名前型説明
languageSubdivisionNamesLanguage

The language of this entry.

subdivisionName(code: string): string | null

A subdivision's name in this language by its ISO 3166-2 code (either case); null where no source gives one, and for a code that is not a subdivision.

subdivisionNameSource(code: string): NameSource | null

Where a subdivision's name came from; null where it has no name.

subdivisionsByName(text: string, options?: SubdivisionNamesSearchOptions): readonly string[]

Every code a typed name could be, in code order: the name as written, folded as fold folds. Empty for none.

subdivisionByName(text: string, options?: SubdivisionNamesSearchOptions): string | null

The one code a typed name means; null for none, and for a name that is more than one place (name the country).

subdivisionsOf(countryCode: string): readonly NamedSubdivision[]

A country's subdivisions that have a name in this language, in code order; empty for a country with none, and for a code that is not a country.

count(): number

How many subdivisions have a name in this language, over all countries.

fold(text: string): string

What two ways of typing a name have in common in this language, as fold(text) says; the lookups compare names folded this way.

例

import type { SubdivisionNames } from "@johnmorrisdotca/kuni/subdivision-names/es";

const read = (names: SubdivisionNames): string | null => names.subdivisionName("JP-13");
console.log(typeof read);   // "function"
function

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

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

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