Reference · Country card element
KuniCardOptionstype
Host SVG loaders and native map appearance; attributes override drawing defaults.
Import it
import type { KuniCardOptions } from "@johnmorrisdotca/kuni/element";
Also exported from: @johnmorrisdotca/kuni/element/define
Definition
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;
}
Members
| Name | Type | Description |
|---|---|---|
flag (optional) | ((code: string) => Promise<string | null>) | undefined | Load a Hata flag or an equivalent SVG for the ISO code; null means unavailable. |
map (optional) | ((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 (optional) | Readonly<Record<string, string>> | undefined | Per-region CSS colours for the native drawing; code:hex-colour attribute pairs override this map. |
capital (optional) | boolean | undefined | Show the capital markers on the map, true by default. This does not remove the capital text field. |
Examples
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
4What it prints (run when this page was built)