import { type PlaceAlias } from "./names.ts"; import type { Language } from "./types.ts"; /** Where an arena's facts were read: an article of Wikipedia at a revision. */ export interface ArenaSource { title: string; revision: number; } /** A name an arena had for some years, first to last. */ export interface ArenaName { name: string; from: number; to: number; } /** A published size of an ice rink or a basketball court, in the unit it was published in, with where it was read and, if the source dates it, the years it had that size. */ export interface ArenaSize { length: number; width: number; unit: "ft" | "m"; /** The first and the last year it had this size, where the source gives them. */ from?: number; to?: number; /** Where it was read: the article and its revision, and in a few words what it says (not a copied passage). */ source: string; } /** * The seats an arena holds for each sport, as the infobox of its article gives them. For hockey it is the figure of the article's * current configuration: the latest dated ice-hockey figure, or the only one (Wikidata's P1083 carries no sport qualifier, so it is not * used). An earlier figure is kept in the arena's `note`. Basketball is still the first figure the infobox gives. */ export interface ArenaCapacity { hockey?: number; basketball?: number; } /** An arena as the data gives it: the rink and the court are the sizes published where they differ from the league's. */ export interface ArenaData { /** The key: `boston-garden`. */ id: string; /** The Wikidata item of the arena (`Q894567`), the key to join an arena to other data. */ wikidata: string; /** The everyday name in English (`Boston Garden`, `TD Garden`); the title of the English article is one of the `aliases`. */ name: string; /** Names the arena had for some years, in order of time: where two share a year the later one is the name at the end of it. */ names?: ArenaName[]; /** The everyday name in Japanese, as Japanese media say it. */ nameJa: string; /** The reading of `nameJa` in kana, given wherever `nameJa` has kanji. */ readingJa?: string; /** The everyday name in the language of the place, where it is not English (`Colisée de Québec`). */ localName?: string; localLanguage?: string; /** Every other name, each with where it was read. */ aliases?: PlaceAlias[]; city: string; /** ISO 3166-1 alpha-2: `US`, `CA`. */ country: string; /** Wikidata's coordinates of the arena (P625), in degrees. */ lat: number; lon: number; /** `current` stands and is in use for a team of the leagues, `past` has been left, closed or pulled down. */ status: "current" | "past"; /** The year it opened, and for a past arena the year it closed or was pulled down. */ from?: number; to?: number; /** The years the article gives for the building itself: when it closed and when it was pulled down. */ closed?: number; demolished?: number; capacity?: ArenaCapacity; /** The ice, end boards to end boards and side boards to side boards, where the sources give a size other than the NHL's 200 by 85 feet: one for each time it was a different size. */ rink?: ArenaSize[]; /** The court, where the sources give a size other than the NBA's 94 by 50 feet. */ court?: ArenaSize[]; /** True where the article says the rink was shorter than the NHL's and gives no size: the drawing says so. */ rinkUnknown?: true; /** Why a size is not given, or what the sources say instead. */ note?: string; /** The English article the facts were read from. */ en: ArenaSource; /** The Japanese article the name in Japanese was read from. */ ja?: ArenaSource; } /** An arena as the package holds it: the data, with the sizes in the unit they were published in (see `arenaRinkIn` and `arenaCourtIn` for them in feet). */ export type Arena = ArenaData; /** * The size of an arena's rink in feet, in a year or today (the latest), when the sources publish one that differs from the NHL's; else `undefined` and the NHL's 200 by 85 feet * is the rink. * @example * ```ts * import { arenaById, arenaRinkIn } from "@johnmorrisdotca/kyogijo-stadiums/arenas"; * console.log(arenaRinkIn(arenaById("boston-garden")!), arenaRinkIn(arenaById("matthews-arena")!, 1926), arenaRinkIn(arenaById("td-garden")!)); * // { length: 190.9, width: 83 } { length: 220, width: 90 } undefined * ``` */ export declare const arenaRinkIn: (arena: Arena | undefined, year?: number) => { length: number; width: number; } | undefined; /** The size of an arena's court in feet, in a year or today, when the sources publish one that differs from the NBA's 94 by 50 feet; else `undefined`. */ export declare const arenaCourtIn: (arena: Arena | undefined, year?: number) => { length: number; width: number; } | undefined; /** Hold arenas for the drawing, under their keys: a later one with a key replaces the earlier. Returns the arenas as held. */ export declare function registerArenas(list: readonly ArenaData[]): Arena[]; /** The arena held under a key, or `undefined`: what the drawing reads when it is given an arena. */ export declare const heldArena: (id: string | undefined) => Arena | undefined; /** The name an arena had in a year (the name of the time in English; in Japanese there is one name for every year). */ export declare function arenaNameIn(arena: Arena, year?: number, language?: Language): string; /** The name an arena officially has in a language, when it is not the everyday name; else `undefined`. */ export declare function arenaOfficialName(arena: Arena, language?: Language, year?: number): string | undefined; /** The address of the revision of an article that an arena's facts were read from. */ export declare function arenaSourceUrl(source: ArenaSource, language?: "en" | "ja"): string;