CustomFlagRecord型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One custom flag a page gives: its id (custom: and a slug), its name, its SVG and, if it likes, a group to be listed under.
インポート
import type { CustomFlagRecord } from "@johnmorrisdotca/hata/custom";
定義
interface CustomFlagRecord {
id: string;
name: {
en: string;
ja?: string;
};
svg: string;
group?: string;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | string |
|
name | { en: string; ja?: string; } | The name for a caption or a screen reader; the Japanese one may be left out (the English is used). |
svg | string | The SVG text: allowed elements and attributes only (see |
group (省略可) | string | undefined | What it is listed under; |
例
import type { CustomFlagRecord } from "@johnmorrisdotca/hata/custom";
const club: CustomFlagRecord = {
id: "custom:harbour-fc",
name: { en: "Harbour FC", ja: "ハーバーFC" },
group: "Clubs",
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 2"><path fill="#036" d="M0 0h3v2H0z"/></svg>',
};
console.log(club.id);custom:harbour-fc出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。