本文へ移動

Kuni国

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

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

目次

リファレンス

国のカードを登録する

import { … } from "@johnmorrisdotca/kuni/element/define";

最小化と gzip 圧縮をしたサイズは 290.3 kB(読み込むものをすべて含み、esbuild で計測)

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

Register the country card. Safe to import without a browser.

エクスポート

名前種類概要
defineCard関数Register <kuni-card> or a host's own tag, preserving an existing definition.
KUNI_CARD_FIELDS定数The fields a card can show, in any order; facts retain their recorded year.
KUNI_CARD_OPTION_KEYS定数Host option keys, kept complete by TypeScript and checked by the builder.
KuniCardクラス<kuni-card code="JP" fields="name flag map capital population">, a country or ISO subdivision without stored state.
KuniCardOptions型Host SVG loaders and native map appearance; attributes override drawing defaults.
readCardColors関数Read the card's bounded code:hex-colour attribute without accepting CSS or markup fragments.

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

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