Reference · Where every tie sits
Matchuptype
One tie: two sides and who went through. Everything but sides is optional, so that a bracket can be drawn from
what is known (the sides of a first round, a few results) and fill in as the games are played.
Import it
import type { Matchup } from "@johnmorrisdotca/taisen-brackets/layout";
Also exported from: @johnmorrisdotca/taisen-brackets
Definition
interface Matchup {
id?: string;
sides: readonly [
SideId | Team | null,
SideId | Team | null
];
winner?: SideId | null;
round?: number;
date?: string;
no?: number;
feeds?: readonly [
Feed | null,
Feed | null
];
kind?: MatchupKind;
bestOf?: number;
games?: readonly Game[];
legs?: readonly Game[];
score?: readonly [
number,
number
];
pens?: readonly [
number,
number
];
extraTime?: boolean;
walkover?: boolean;
third?: boolean;
stage?: "play-in" | "repechage" | "bronze";
judo?: JudoResult;
home?: 0 | 1;
note?: string;
seeds?: readonly [
string | number | null,
string | number | null
];
}
Members
| Name | Type | Description |
|---|---|---|
id (optional) | string | undefined | Names the tie for |
sides | readonly [Team | SideId | null, Team | SideId | null] | The two sides: a team's |
winner (optional) | SideId | null | undefined | The side that went through, by id. Left out, it is worked out from the games when they settle it. |
round (optional) | number | undefined | The round, from 1 (the first of the tree) to the final. |
date (optional) | string | undefined | A sortable date ( |
no (optional) | number | undefined | A number that orders the ties of a round before the date does (a World Cup's match numbers). |
feeds (optional) | readonly [Feed | null, Feed | null] | undefined | Which ties feed this one: |
kind (optional) | MatchupKind | undefined | How the tie is contested. Left out: replay if a game replays, series if there is a |
bestOf (optional) | number | undefined | The length of the series (7 for a best-of-seven). |
games (optional) | readonly Game[] | undefined | The games, oldest first. |
legs (optional) | readonly Game[] | undefined | The legs of an aggregate tie: the same as |
score (optional) | readonly [number, number] | undefined | The result, without the games: the score of a game, the games won of a series ( |
pens (optional) | readonly [number, number] | undefined | The shoot-out of a game with no |
extraTime (optional) | boolean | undefined | The game with no |
walkover (optional) | boolean | undefined | The tie was settled without a game (a side withdrew): the note says so. |
third (optional) | boolean | undefined | This is the third-place match: it leads nowhere and is drawn apart. |
stage (optional) | "play-in" | "repechage" | "bronze" | undefined |
|
judo (optional) | JudoResult | undefined | A judo contest's scores: ippon, waza-ari, yuko, shido, hansoku-make, golden score and time. The first side is white, the second blue. The score, the winner and the notes come from it; see |
home (optional) | 0 | 1 | undefined | The side playing at home (0 or 1), for the |
note (optional) | string | undefined | |
seeds (optional) | readonly [string | number | null, string | number | null] | undefined | The seed tags of the two sides for this tie ( |
Examples
import { drawBracket, type Matchup } from "@johnmorrisdotca/taisen-brackets";
const final: Matchup = { id: "final", sides: ["ARG", "FRA"], score: [3, 3], extraTime: true, pens: [4, 2], date: "2022-12-18" };
console.log(drawBracket([final]).startsWith("<svg"));trueWhat it prints (run when this page was built)