import { type CrowdStands, type Pt, type StandRing } from "./crowd.ts"; import { type Plane } from "./turn.kit.ts"; import type { LedBoardOptions, LedBoardPattern } from "./types.ts"; /** The boards a venue has, with every part's value. */ export interface Boards { ribbon: boolean; scoreboard: boolean; /** Three colours of light (a ribbon's bands and chevrons take them in turn). */ colors: [string, string, string]; pattern: LedBoardPattern; score: [number, number]; /** Each lit panel has a halo under it (the venue is lit as at night). */ glow: boolean; /** What a replay adds to the scoreboard's face: the period and the game clock. Missing, the face is the score alone, as it always was. */ live?: BoardLive; } /** The period and the clock a scoreboard shows while a game is replayed on it. */ export interface BoardLive { /** The period (1, 2, 3...), or `undefined` for a game with none. */ period?: number; /** The clock as it is written, `19:20`: digits and one colon. */ clock: string; /** A power play: each side's penalty clocks (`1:42`, the soonest first, two at most are drawn) in its block of colour, and `PP` in the block of the side with more skaters. */ penalties?: { home: string[]; away: string[]; pp?: "home" | "away"; }; } /** The scoreboard hung over a surface, with what it is made from: a replay draws its faces again with the score and the clock of the time it is at. */ export interface HungBoard { id: string; box: { x: number; y: number; w: number; h: number; }; /** How high the surface stands, in feet. */ lift: number; look: Boards; } /** The package's own colours of light: amber, blue and a white with a little blue in it. */ export declare const BOARD_COLORS: readonly [string, string, string]; export declare const BOARD_PATTERNS: readonly LedBoardPattern[]; /** The sizes of the boards, in feet (ours: the usual ones, no plan of a real board). */ export declare const BOARD: { /** How tall a ribbon is, and how long one of its panels. */ readonly ribbon: 3.8; readonly panel: 9; /** The scoreboard's share of the surface's length and width, its least and most, and how far its lower edge hangs over the surface (a share of the surface's longer side, least and most). */ readonly share: { readonly w: 0.14; readonly d: 0.22; }; readonly wide: readonly [18, 52]; readonly deep: readonly [12, 30]; readonly hang: { readonly share: 0.2; readonly least: 28; readonly most: 70; }; /** The ring of display under the main board, its inset on each side, and the strut it hangs from. */ readonly ring: { readonly rise: readonly [2.5, 4.5]; readonly inset: 0.06; }; readonly strut: 9; }; export declare const safeColor: (value: unknown) => string | undefined; /** The boards a `boards` option asks for (the crowd's `home` and `away` are the colours when it names none), or `undefined` for none. */ export declare function resolveBoards(ask: boolean | LedBoardOptions | undefined | null, team?: { home?: string; away?: string; }, glow?: boolean): Boards | undefined; /** * A ribbon on a quad `[a, b, c, d]` of a plane (a and b along its lower edge, d and c along its upper): a dark housing with panels of light in it, in the pattern asked. `run` is how far along the ribbon this quad starts, in feet, * so that the panels carry on in the colour they were from one quad to the next. A quad that is not a quad is the housing alone. */ export declare function ledStrip(corners: readonly Pt[], look: Pick & { glow?: boolean; }, run?: number): string; /** The ribbon on a wall, `length` feet long and `height` feet high: the same strip, on a rectangle (its lower edge is the wall's lower edge). */ export declare const ledWall: (length: number, height: number, look: Pick, run?: number) => string; /** A walk between two tiers: the tier below it, the one above and the walk's own outlines. */ export interface TierLink { c: CrowdStands["concourses"][number]; before: StandRing; after: StandRing; } /** The walks between the tiers of a stands model, each with the tier it leaves and the tier it leads to. */ export declare function tierLinks(stands: CrowdStands): TierLink[]; /** The share of a plane of `rise` feet over a slope `g` (rise per foot across) that a ribbon of `BOARD.ribbon` feet takes at its top; 0 for a plane too flat to be a facade. */ export declare function ribbonShare(rise: number, g: number): number; /** The size of the scoreboard over a surface of `w` by `h` feet (its long side along the surface's), and how high its lower edge hangs. */ export declare function boardSize(w: number, h: number): { w: number; d: number; hang: number; }; /** Whether a sport has a scoreboard hung over its surface: a ballpark's stands behind the outfield, so it has none here. */ export declare const hangsOver: (sport: string | undefined) => boolean; /** A clock a scoreboard may write: one or two digits, a colon and two digits. Anything else is left off (the text goes into a drawing). */ export declare const safeClock: (value: unknown) => string; /** * The scoreboard hung over the middle of a surface: a four sided board with its score on every face, a ring of display under it, a cap on top and a strut up to the rafters. `box` is the surface, `lift` how high the surface stands. * Its faces look outwards, each the right way round for an eye outside it. */ export declare function centreBoard(id: string, box: { x: number; y: number; w: number; h: number; }, lift: number, look: Boards): Plane[]; /** The size of the scoreboard in the flat plan, from the surface's box. */ export declare const planBoard: (box: { x: number; y: number; w: number; h: number; }) => { x: number; y: number; w: number; d: number; }; /** The ribbon boards in the flat plan: a lit line along the front of every tier that has a walk below it (the front of the tiers there is no walk to, where the venue has one level), panels of the colours in turn. */ export declare function planRibbons(stands: CrowdStands, look: Boards): string; /** The scoreboard in the flat plan, as the board hangs over the surface seen from above: its dark cap with a line of light round it and its four edges' colours. */ export declare function planScoreboard(box: { x: number; y: number; w: number; h: number; }, look: Boards): string; /** How tall the ribbon on the front of a tier is, for a front `top` feet high: the usual ribbon, or less where the front is low. */ export declare const ribbonHigh: (top: number) => number; /** The ribbon on the top of a wall that stands over the line from `a` to `b` and is `top` feet high (the front of a tier): a wall of its own, as tall as `ribbonHigh` says. `run` is how far along the ribbon the wall starts. */ export declare const fasciaRibbon: (id: string, a: Pt, b: Pt, top: number, look: Boards, run: number) => Plane; /** A hall's boards as its stadium asks for them: the layout has scoreboards of its own, so the hall has the ribbons and no scoreboard hung over its middle. */ export declare const hallBoards: (ask: boolean | LedBoardOptions | undefined) => boolean | LedBoardOptions | undefined;