Reference · Draw a bracket, a table or a road to the final
MedalRowtype
One row of a medal table: a country or a team and its medals. Only name is needed.
Import it
import type { MedalRow } from "@johnmorrisdotca/taisen-brackets";
Definition
interface MedalRow {
name: string;
flag?: string;
mark?: string;
code?: string;
gold?: number;
silver?: number;
bronze?: number;
note?: string;
}
Members
| Name | Type | Description |
|---|---|---|
name | string | The country's or team's name as it is to be written ("France", "Soviet Union", "Unified Team"). |
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. |
code (optional) | string | undefined | The country's three letters, for the badge of a row with no flag. |
gold (optional) | number | undefined | |
silver (optional) | number | undefined | |
bronze (optional) | number | undefined | |
note (optional) | string | undefined | A small line under the name: the years a former country existed ("1922–1991"), or what a team is. |
Examples
import { medalTable, type MedalRow } from "@johnmorrisdotca/taisen-brackets";
const row: MedalRow = { name: "Soviet Union", code: "URS", note: "1922–1991", gold: 1, bronze: 4 };
console.log(medalTable({ rows: [row] }).includes("1922–1991"));trueWhat it prints (run when this page was built)