JudoBoardOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a judo board can be told: the size, the theme, the style (board or flip cards), which side is on the left, the coaches, the flags and the language.
インポート
import type { JudoBoardOptions } from "@johnmorrisdotca/taisen-brackets";
定義
interface JudoBoardOptions {
size?: JudoBoardSizeName | {
width: number;
height: number;
};
theme?: Exclude<ThemeName, "poster" | "none">;
style?: "board" | "flip";
swap?: boolean;
coaches?: boolean;
flags?: DrawOptions["flags"];
flagHref?: DrawOptions["flagHref"];
locale?: string | Locale;
words?: Partial<Words>;
title?: string;
id?: string;
className?: string;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
size (省略可) | JudoBoardSizeName | { width: number; height: number; } | undefined |
|
theme (省略可) | "auto" | "light" | "dark" | undefined |
|
style (省略可) | "board" | "flip" | undefined |
|
swap (省略可) | boolean | undefined | Draw blue first (on the left, or at the top) in place of white. Default false. |
coaches (省略可) | boolean | undefined | Write each athlete's coach under the code. Default true. |
flags (省略可) | FlagRenderer | undefined | Draws a country's flag from its code, as for |
flagHref (省略可) | ((code: string) => string | null | undefined) | undefined | The address of a flag as a picture to load, tried where |
locale (省略可) | string | Locale | undefined | The language: |
words (省略可) | Partial<Words> | undefined | |
title (省略可) | string | undefined | The |
id (省略可) | string | undefined | Prefix for the drawing's ids. Default: a hash of the state and the options. |
className (省略可) | string | undefined |
例
import { judoScoreboard, type JudoBoardOptions } from "@johnmorrisdotca/taisen-brackets";
const options: JudoBoardOptions = { size: "tablet", theme: "dark", style: "flip" };
console.log(judoScoreboard({
white: { name: "Daiki Hoshino", code: "JPN" },
blue: { name: "Mathis Roussel", code: "FRA" },
sides: [{ wazaAri: 1, shido: 1 }, { yuko: 2, shido: 2 }],
clock: "2:14",
weight: "Men -66 kg",
round: "Final",
}, options).startsWith("<svg"));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。