Reference · Draw a bracket, a table or a road to the final
MedalTableSourcetype
A medal table to draw: the title, the sport or event, the date, the source and the rows.
Import it
import type { MedalTableSource } from "@johnmorrisdotca/taisen-brackets";
Definition
interface MedalTableSource {
title?: string;
subtitle?: string;
date?: string;
source?: string;
rows: readonly MedalRow[];
}
Members
| Name | Type | Description |
|---|---|---|
title (optional) | string | undefined | The heading. Default: the language's "Medal table". |
subtitle (optional) | string | undefined | The sport, event or Games as a pill under the heading ("Men's judo +100 kg"). |
date (optional) | string | undefined | The date or the edition, at the right of the heading. |
source (optional) | string | undefined | Where the numbers come from, small at the foot. |
rows | readonly MedalRow[] |
Examples
import { medalTable, type MedalTableSource } from "@johnmorrisdotca/taisen-brackets";
const source: MedalTableSource = { subtitle: "Men's judo +100 kg", rows: [
{ name: "France", flag: "FR", gold: 6, silver: 1, bronze: 3 },
{ name: "Japan", flag: "JP", gold: 5, silver: 3, bronze: 2 },
] };
console.log(medalTable(source).includes("France"));trueWhat it prints (run when this page was built)