Reference · Draw a bracket, a table or a road to the final
MedalAwardtype
A medal won: who won it and what kind, with whatever you filter on.
Import it
import type { MedalAward } from "@johnmorrisdotca/taisen-brackets";
Definition
interface MedalAward {
name: string;
flag?: string;
mark?: string;
code?: string;
note?: string;
medal: "gold" | "silver" | "bronze";
sport?: string;
category?: string;
games?: string | number;
}
Members
| Name | Type | Description |
|---|---|---|
name | string | |
flag (optional) | string | undefined | |
mark (optional) | string | undefined | |
code (optional) | string | undefined | |
note (optional) | string | undefined | |
medal | "bronze" | "gold" | "silver" | |
sport (optional) | string | undefined | What the medal was won in, for the filter: a sport, a weight class or category, a Games or a year. Any of them can be left out of a filter. |
category (optional) | string | undefined | |
games (optional) | string | number | undefined |
Examples
import { tallyMedals, type MedalAward } from "@johnmorrisdotca/taisen-brackets";
const award: MedalAward = { name: "France", flag: "FR", medal: "gold", sport: "judo", category: "+100 kg", games: 2024 };
console.log(tallyMedals([award]));[ { name: 'France', gold: 1, silver: 0, bronze: 0, flag: 'FR' } ]What it prints (run when this page was built)