Restricted型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A flag whose display the law restricts. Germany's national flag of 1935 to 1945 is the one: it is shipped for history and education,
and is never returned by a default lookup, a list, a picker, a quiz, a download pack or the CDN listing. Ask for it by name with
allowRestricted: true (flag, variantOn, variantsOf) or the allow-restricted attribute of <hata-flag>, for a purpose in allowedFor.
インポート
import type { Restricted } from "@johnmorrisdotca/hata/manifest";
定義
interface Restricted {
reason: string;
reasonJa: string;
law: string[];
allowedFor: string;
allowedForJa: string;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
reason | string | Why it is restricted, in a sentence a page can show beside it, in English. |
reasonJa | string | The same in Japanese. |
law | string[] | The laws that restrict it: "DE StGB §86a" and "AT Verbotsgesetz". |
allowedFor | string | What it may be used for under those laws' exceptions (StGB §86(4) in Germany): "education and history". Not commerce. |
allowedForJa | string | The same in Japanese. |
例
import { variantOn, type Restricted } from "@johnmorrisdotca/hata/manifest";
const found = variantOn("DE", "1940");
const why: Restricted | null = found?.restricted ?? null;
console.log(found?.withheld); // true: the drawing is not given without allowRestricted
console.log(why?.law); // ["DE StGB §86a", "AT Verbotsgesetz"]true
[ 'DE StGB §86a', 'AT Verbotsgesetz' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。