本文へ移動

Hata旗

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

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

目次

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

Variant型

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

One of a place's flags in real use, for flag(code, { variant }) and variantsOf(code): Afghanistan's Republic tricolour and the Taliban's flag, Bavaria's lozenges and stripes, Guadeloupe's French tricolour and its local flag.

  • official: adopted by the authority that has the right to.
  • de-facto: flown by whoever holds the territory, without that recognition.
  • historical: no longer official, and still flown.
  • local: in use there, and not made the place's own flag by its authority.

インポート

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

定義

interface Variant {
    id: string;
    name: string;
    nameJa: string;
    status: "official" | "de-facto" | "historical" | "local";
    from: string | null;
    until: string | null;
    why: string;
    source: string;
    default: boolean;
    module: string;
    frames: Record<"4:3" | "1:1" | "round", "cover" | "crop" | "contain">;
    drawing: {
        source: FlagSource;
        file: string;
        page: string;
        licence: {
            kind: LicenceKind;
            name: string;
            url: string | null;
        };
        author: string | null;
        credit: string | null;
        attributionRequired: boolean;
        restrictions: string[];
        uploaded: string | null;
        width: number;
        height: number;
        bytes: number;
    };
}

メンバー

名前型説明
idstring

Kebab case, unique within the place: "de-facto", "stripes", "local".

namestring

A name for a menu, in English.

nameJastring

The same in Japanese.

status"official" | "de-facto" | "historical" | "local"

Its standing: see above.

fromstring | null

When it came into use, as precisely as is known ("2021-08-15", "1953"); null where it is not known or not dated.

untilstring | null

When it went out of official use; null where it has not.

whystring

Why it is offered, and (for the default) why it is the default, in a sentence or two.

sourcestring

Where the claim above is documented: a web page.

defaultboolean

True for the one flag(code) gives. At most one per place; none where the place has no flag of its own by default.

modulestring

The module that has its SVG: /flags/<module>, the place's own for the default and <code>--<id> for the others.

framesRecord<"4:3" | "1:1" | "round", "crop" | "cover" | "contain">

What frame() does with this variant's SVG at each shape by default: cover (a centre crop), crop (a crop at a chosen side) or contain (the whole flag).

drawing{ source: FlagSource; file: string; page: string; licence: { kind: LicenceKind; name: string; url: string | null; }; author: string | null; credit: string | null; attributionRequired: boolean; restrictions: string[]; uploaded: string | null; width: number; height: number; bytes: number; }

Where this drawing comes from: its Commons file, page, licence, author and size, as for a flag's record.

例

import { variantsOf, type Variant } from "@johnmorrisdotca/hata/manifest";

const taliban: Variant | undefined = variantsOf("AF").find((one) => one.status === "de-facto");
console.log(taliban?.id);     // "de-facto"
console.log(taliban?.from);   // "2021-08-15"
console.log(taliban?.module); // "af--de-facto": import it from "@johnmorrisdotca/hata/flags/af--de-facto"
de-facto
2021-08-15
af--de-facto

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

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

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