本文へ移動

Hata旗

国や地域の旗を読み込み、対応する表示の形を選び、絵ごとの資料・作者・ライセンスを保てます。

「旗(はた)」は、旗を表す日本語です。 名前について(英語)

目次

リファレンス · 旗の資料と表示の情報

VariantOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

What variantsOf, variantOn and flagOn take: allowRestricted, to include the flags the law restricts (RESTRICTED); role, which flag of the day to give.

インポート

import type { VariantOptions } from "@johnmorrisdotca/hata/manifest";

定義

interface VariantOptions {
    role?: FlagRole;
    allowRestricted?: boolean;
}

メンバー

名前型説明
role (省略可)FlagRole | undefined

Which flag of the day: the legal one (the default) or the one in-use in practice. Where they are the same flag, the answer is the same.

allowRestricted (省略可)boolean | undefined

Include a flag whose display the law restricts. Left out, it is never given: variantsOf leaves it out of the list, and variantOn says the day has one and gives its restriction and reason in place of a drawing (withheld).

例

import { variantOn, type VariantOptions } from "@johnmorrisdotca/hata/manifest";

const asked: VariantOptions = { role: "in-use" };
console.log(variantOn("CA", "1962-09-29", asked)?.id); // "red-ensign-1957"
red-ensign-1957

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/hata 1.31.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。