FlagShape型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How a flag is framed: round in a circle, square, or rect in its own proportions.
インポート
import type { FlagShape } from "@johnmorrisdotca/taisen-brackets/layout";
ほかのエクスポート元: @johnmorrisdotca/taisen-brackets
定義
type FlagShape = "round" | "square" | "rect";
例
import { type FlagShape, type FlagRenderer } from "@johnmorrisdotca/taisen-brackets";
const shapes: FlagShape[] = ["round", "square", "rect"];
const renderer: FlagRenderer = (code, request) => (shapes.includes(request.shape) ? `<svg viewBox="0 0 3 2"><title>${code}</title></svg>` : null);
console.log(renderer("JP", { shape: "round", size: 24, theme: "inherit" }));<svg viewBox="0 0 3 2"><title>JP</title></svg>出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。