medievalFlagfunction
A medieval banner as an SVG string: it has a viewBox and no width or height. frame() and toDataUri() from the main entry take it like any other.
Import it
import { medievalFlag } from "@johnmorrisdotca/hata/medieval";
Definition
function medievalFlag(id: string): Promise<string | null>
Parameters
| Name | Type | Description |
|---|---|---|
id | string | A banner's id, in any case, with or without |
Returns
Promise<string | null>
The SVG string, loaded when it is asked for (the drawing is a module of its own, so a page carries only the drawings it asks for), or null when the set has no such banner.
Examples
import { toDataUri } from "@johnmorrisdotca/hata";
import { medievalFlag } from "@johnmorrisdotca/hata/medieval";
const banner = await medievalFlag("med:red-cross"); // "<svg …>"
console.log(banner === null ? null : toDataUri(banner)?.startsWith("data:image/svg+xml,"));trueWhat it prints (run when this page was built)