Reference · Draw a bracket, a table or a road to the final
ResultsRowtype
One line of a results board. Only name is needed.
Import it
import type { ResultsRow } from "@johnmorrisdotca/taisen-brackets";
Definition
interface ResultsRow {
name: string | RankingName;
rank?: number | string;
code?: string;
flag?: string;
mark?: string;
values?: readonly (number | string | null)[];
record?: string | readonly string[];
note?: string;
}
Members
| Name | Type | Description |
|---|---|---|
name | string | RankingName | The name as it is to be written ("A. SACRAMONE", "Svetlana Khorkina"), or its two parts (set by |
rank (optional) | string | number | undefined | The rank: a number, or a text ("=3", "DQ"). Left out, the place in the list (equal results share one, see |
code (optional) | string | undefined | The country's three letters, written before the flag. |
flag (optional) | string | undefined | A code for the |
mark (optional) | string | undefined | A mark of your own (an image address or inline SVG) in place of a flag. |
values (optional) | readonly (string | number | null)[] | undefined | One value for each column: a number (written to the column's |
record (optional) | string | readonly string[] | undefined | A record badge or several beside the last value: |
note (optional) | string | undefined | Written in place of the values when there are none to show: |
Examples
import { resultsBoard, type ResultsRow } from "@johnmorrisdotca/taisen-brackets";
const row: ResultsRow = { code: "USA", flag: "US", name: "Michael Phillips", values: [50.58], record: "OR" };
console.log(resultsBoard({ title: "Final", rows: [row] }).includes("50.58"));trueWhat it prints (run when this page was built)