LoadedFlagOn型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What flagOn() gives: FlagOnDay from /manifest (the flag of the day with other, withheld and none), and its drawing.
インポート
import type { LoadedFlagOn } from "@johnmorrisdotca/hata/load";
定義
interface LoadedFlagOn extends FlagOnDay {
svg: string | null;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
svg | string | null | The drawing, framed as asked; null where there is none to give: no flag known, or a restricted one withheld ( |
date | string | The day asked, |
role | FlagRole | The role asked. |
variant | DatedVariant | null | The flag, or null. |
none | NoFlag | null | Why there is no drawing to give; null where there is one. |
例
import { flagOn, type LoadedFlagOn } from "@johnmorrisdotca/hata/load";
const day: LoadedFlagOn = await flagOn("CA", "1962-09-29", { shape: "4:3" });
console.log(day.variant?.id, day.variant?.other?.id); // "union-flag" "red-ensign-1957"
console.log(day.svg?.startsWith("<svg")); // trueunion-flag red-ensign-1957
true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。