Reference · Draw a bracket, a table or a road to the final
TableOptionstype
What bracketTable can be told: the language and words, the round names, a caption and a class.
Import it
import type { TableOptions } from "@johnmorrisdotca/taisen-brackets";
Definition
interface TableOptions extends Pick<DrawOptions, "locale" | "words" | "teamName" | "roundNames"> {
caption?: string;
className?: string;
}
Members
| Name | Type | Description |
|---|---|---|
caption (optional) | string | undefined | The table's caption. Default: the summary ("16 teams, 4 rounds"). |
className (optional) | string | undefined | A class for the |
roundNames (optional) | readonly string[] | { rounds: readonly { name: string; }[]; } | undefined | Names of the rounds, first round first (or just the last ones). Default: Final, Semi-finals, Quarter-finals, Round of 16… |
locale (optional) | string | Locale | undefined | The language: |
words (optional) | Partial<Words> | undefined | Replace any of the language's words. |
teamName (optional) | ((team: Team, locale: Locale) => string | undefined) | undefined | The name to draw for a team in this language: |
Examples
import { bracketTable, type TableOptions } from "@johnmorrisdotca/taisen-brackets";
const options: TableOptions = { caption: "Aurora Cup", className: "results" };
console.log(bracketTable([{ sides: ["Aurora", "Harbour"], score: [2, 1] }, { sides: ["Cascade", "Delta"], score: [0, 1] }, { sides: ["Aurora", "Delta"], score: [3, 1] }], options).includes("Aurora Cup"));trueWhat it prints (run when this page was built)