Reference
Register country cards
import { … } from "@johnmorrisdotca/kuni/element/define";
290.3 kB minified and gzipped, with everything it imports (measured with esbuild)
Register the country card. Safe to import without a browser.
Exports
| Name | Kind | What it is |
|---|---|---|
defineCard | function | Register <kuni-card> or a host's own tag, preserving an existing definition. |
KUNI_CARD_FIELDS | constant | The fields a card can show, in any order; facts retain their recorded year. |
KUNI_CARD_OPTION_KEYS | constant | Host option keys, kept complete by TypeScript and checked by the builder. |
KuniCard | class | <kuni-card code="JP" fields="name flag map capital population">, a country or ISO subdivision without stored state. |
KuniCardOptions | type | Host SVG loaders and native map appearance; attributes override drawing defaults. |
readCardColors | function | Read the card's bounded code:hex-colour attribute without accepting CSS or markup fragments. |