Reference · Draw a bracket, a table or a road to the final
BroadcastOptionstype
What every broadcast board takes: the width, the look, the icon, the flags, the language, a title and an id.
Import it
import type { BroadcastOptions } from "@johnmorrisdotca/taisen-brackets";
Definition
interface BroadcastOptions {
width?: number;
look?: BroadcastLook;
icon?: BroadcastIcon;
iconMark?: string;
flags?: DrawOptions["flags"];
flagHref?: DrawOptions["flagHref"];
locale?: string | Locale;
words?: Partial<Words>;
title?: string;
id?: string;
className?: string;
}
Members
| Name | Type | Description |
|---|---|---|
width (optional) | number | undefined | The width of the board; the height follows from the rows. Default 1280, from 320 to 4000. |
look (optional) | BroadcastLook | undefined |
|
icon (optional) | BroadcastIcon | undefined | The icon in the square at the left of the title: |
iconMark (optional) | string | undefined | A mark of your own for that square (inline SVG or an image address), in place of |
flags (optional) | FlagRenderer | undefined | Draws a flag from its code, as for |
flagHref (optional) | ((code: string) => string | null | undefined) | undefined | The address of a flag as a picture to load, tried where |
locale (optional) | string | Locale | undefined | |
words (optional) | Partial<Words> | undefined | |
title (optional) | string | undefined | The |
id (optional) | string | undefined | |
className (optional) | string | undefined |
Examples
import { resultsBoard, type BroadcastOptions } from "@johnmorrisdotca/taisen-brackets";
const options: BroadcastOptions = { width: 1280, look: "blue", icon: "medal", locale: "ja" };
console.log(resultsBoard({ title: "Final", rows: [{ name: "A" }] }, options).startsWith("<svg"));trueWhat it prints (run when this page was built)