KuniCardOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Host SVG loaders and native map appearance; attributes override drawing defaults.
インポート
import type { KuniCardOptions } from "@johnmorrisdotca/kuni/element";
ほかのエクスポート元: @johnmorrisdotca/kuni/element/define
定義
interface KuniCardOptions {
flag?: (code: string) => Promise<string | null>;
map?: (code: string, language: "en" | "ja", drawing?: Pick<KuniCardOptions, "colors" | "capital">) => Promise<string | null>;
colors?: Readonly<Record<string, string>>;
capital?: boolean;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
flag (省略可) | ((code: string) => Promise<string | null>) | undefined | Load a Hata flag or an equivalent SVG for the ISO code; null means unavailable. |
map (省略可) | ((code: string, language: "en" | "ja", drawing?: Pick<KuniCardOptions, "colors" | "capital">) => Promise<string | null>) | undefined | Load trusted SVG for the ISO code/language, honouring optional drawing settings; null means unavailable. |
colors (省略可) | Readonly<Record<string, string>> | undefined | Per-region CSS colours for the native drawing; code:hex-colour attribute pairs override this map. |
capital (省略可) | boolean | undefined | Show the capital markers on the map, true by default. This does not remove the capital text field. |
例
import { type KuniCardOptions, KUNI_CARD_OPTION_KEYS } from "@johnmorrisdotca/kuni/element";
const options: KuniCardOptions = {};
console.log(Object.keys(options).length); // 0
console.log(KUNI_CARD_OPTION_KEYS.length); // 40
4出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。