import { type FootballSpec } from "./geometry.ts"; /** The sports whose markings have a history here. The IFAF's surface is 2021's and has none. */ export type EraSport = "nfl" | "cfl" | "nhl" | "nba" | "mlb"; /** The sports with a history, in the order a menu lists them. */ export declare const ERA_SPORTS: readonly EraSport[]; /** * The season whose rules are "today's", and the one a drawing without a `year` shows: the data were last checked in 2026. A * change scheduled for a later season is `planned` and is drawn only when that season is asked for. */ export declare const ERA_CURRENT = 2026; /** Where a change was read. */ export interface EraSource { id: string; /** The page: the article's title for Wikipedia, else the page's own. */ title: string; /** Who publishes it. */ by: string; /** For Wikipedia (CC BY-SA 4.0): the revision of the article, so that the figure can be checked. */ revision?: number; url: string; /** What was taken from it. */ note?: string; } /** Every page a change was read from, by id. Wikipedia is cited by revision, for facts only. */ export declare const ERA_SOURCES: Readonly>; /** One state of a marking, from a season on. */ export interface EraSpan { /** The first season it was in force, or `null` for "from the start" (the state the earliest season of the sport had). */ from: number | null; value: T; /** What it was, in a sentence. */ what: string; /** The same in Japanese. */ ja: string; /** Keys of `ERA_SOURCES`; at least one. */ sources: string[]; /** A rule announced for a season that has not been played yet. It is drawn only when that season is asked for. */ planned?: boolean; /** The source gives this state but not its measure (the box's size): drawn as the nearest figure that is cited. */ approx?: boolean; } /** The NHL rink's markings in a season. Lengths are feet. */ export interface NhlRules { /** The centre red line across the middle of the ice. */ centreLine: boolean; /** The goal line's distance from the end boards. */ goalLine: number; /** The blue line's distance from the end boards. */ blueLine: number; /** The goaltender's trapezoid behind the net, or none. */ trapezoid: { atGoalLine: number; atBoards: number; } | null; /** The gap between the two hash marks beside an end-zone face-off circle (Rule 1.9). */ hashApart: number; /** The centre red line judges the offside pass: a pass from inside a team's own defensive zone across both its blue line and the centre line, to a team-mate who has not touched it, stops play. Data only: the lines are drawn the same. */ twoLinePass: boolean; } /** The NBA court's markings in a season. Lengths are feet. */ export interface NbaRules { /** The width of the free-throw lane. */ keyWidth: number; /** The three-point arc's radius from the basket (the corners stay at 22 feet), or none. */ threePoint: { radius: number; } | null; /** The restricted area (the no-charge arc) under each basket. */ restrictedArea: boolean; } /** A football field's markings in a season: the NFL's or the CFL's. Lengths are feet. */ export interface FootballRules { /** Goal line to goal line. */ length: number; /** The depth of each end zone. */ endZone: number; /** The hash marks' distance from each sideline, or `null` before there were hash marks. */ hash: number | null; /** Where the goal posts stand. */ posts: "goal-line" | "end-line"; /** Two poles joined by a crossbar (`h`), or one curved support behind the crossbar (`slingshot`). */ postShape: "h" | "slingshot"; } /** The baseball field's markings in a season. Lengths are feet, the mound's height inches. */ export interface MlbRules { /** The side of first, second and third base, in feet (home plate is not a base of this size). */ baseSize: number; /** * Where the pitcher throws from: a chalked box whose front edge is `distance` from the back point of home plate, with its * `width` and `depth`, or (from 1893) the rubber, whose front edge is `distance` from it. */ pitcher: { kind: "box" | "plate"; distance: number; width: number; depth: number; }; /** The batter's boxes, or none (there were none before 1874). */ battersBox: { width: number; length: number; gap: number; } | null; /** The shape of home plate. */ plateShape: "circle" | "square" | "diamond" | "pentagon"; /** Where it lies: `centred` on the foul lines' meeting, `behind` it, or (since 1877) `front`, its back point on it, in fair ground. */ platePlacement: "centred" | "behind" | "front"; /** The mound's greatest height above home plate, in inches, or `null` when the sources give none. */ moundHeight: number | null; } /** The rules of a sport in a season. */ export interface EraRulesOf { nhl: NhlRules; nba: NbaRules; nfl: FootballRules; cfl: FootballRules; mlb: MlbRules; } /** A change in the markings: one span of one marking that started in some season. */ export interface EraChange { /** `nhl.trapezoid.2005`. */ id: string; sport: EraSport; /** The marking's name: a key of the sport's rules. */ feature: string; /** The first season, or `null` for the state the sport started with. */ from: number | null; value: unknown; what: string; ja: string; sources: string[]; planned: boolean; approx: boolean; } /** * Every change of a sport's markings, in season order: what moved, from which season, in a sentence in English and in Japanese, * and the sources that say so. The state a sport started with is not a change and is left out (see `eraStates`). * @example * ```ts * import { eraChanges } from "@johnmorrisdotca/kyogijo-stadiums/eras"; * const nhl = eraChanges("nhl"); * console.log(nhl.length, nhl[0].id, nhl[0].from); * // 12 nhl.centreLine.1943 1943 * ``` */ export declare function eraChanges(sport: EraSport): EraChange[]; /** The state each marking of a sport started with: the spans that begin "from the start". */ export declare function eraStates(sport: EraSport): EraChange[]; /** The seasons a sport's history is drawn for: from the league's first to today's, or to a planned season when one is announced. */ export declare function eraRange(sport: EraSport): { from: number; to: number; }; /** * The name of a season as the sport writes it: `1979–80` for the NHL and the NBA, which play across the new year, and `1974` for * the NFL, the CFL and baseball. The year is the one the season starts in. * @example * ```ts * import { seasonLabel } from "@johnmorrisdotca/kyogijo-stadiums/eras"; * console.log(seasonLabel("nba", 1979), seasonLabel("nhl", 1999), seasonLabel("nfl", 1974)); * // 1979–80 1999–00 1974 * ``` */ export declare function seasonLabel(sport: EraSport, year: number): string; /** The markings in force in a season, with what differs from today's and what is not known. */ export interface EraRules { sport: S; /** The season asked for (the year it starts in); today's when none was. */ year: number; /** Its name: `1979–80`. */ season: string; /** The markings. Every one is in feet, except the mound's height in inches. */ rules: EraRulesOf[S]; /** The states in force that are not today's, each as the change that began it (a marking in `gaps` is not listed). */ differences: EraChange[]; /** Markings that no source covers for this season: they keep the nearest cited state. */ gaps: string[]; /** Markings whose state is cited but whose measure is not: drawn at the nearest cited figure. */ approx: string[]; /** True when a marking is one that is announced for this season and has not been played yet. */ planned: boolean; } /** * The markings of a sport's surface in a season: what the rule books and the leagues had painted on it then. Without a year it is * today's (`ERA_CURRENT`). A season is named by the year it starts in (`1979` is the 1979–80 season). `differences` lists what is * not as it is today, `gaps` the markings that no source covers for the season, and `approx` those whose measure is not cited. * @example * ```ts * import { rulesFor } from "@johnmorrisdotca/kyogijo-stadiums/eras"; * const nba = rulesFor("nba", 1995); * console.log(nba.season, nba.rules.threePoint, nba.rules.restrictedArea, nba.differences.length); * // 1995–96 { radius: 22 } false 2 * ``` */ export declare function rulesFor(sport: S, year?: number): EraRules; /** * A football field's spec in a season: the NFL's or the CFL's as `FOOTBALL` has it today, with the length, the end zones, the * hash marks and the goal posts of that season. The IFAF's has no history and is returned as it is. * @example * ```ts * import { footballIn } from "@johnmorrisdotca/kyogijo-stadiums/eras"; * console.log(footballIn("cfl", 1985).endZone / 3, footballIn("cfl", 1986).endZone / 3, footballIn("nfl", 1960).hash / 3); * // 25 20 20 * ``` */ export declare function footballIn(sport: "nfl" | "cfl" | "ifaf", year?: number): FootballSpec;