import type { Area, Shape } from "../fields.types.ts"; import { WA_SHORT_TRACK, WA_STANDARD_TRACK, type AthleticsFigures, type AthleticsLeague } from "../leagues/athletics.ts"; import { type SoccerSpec } from "../surfaces/soccer-spec.ts"; import type { SurfaceOptions } from "../types.ts"; import type { Facility } from "./facilities.ts"; import { type Digits, type StraightPlan } from "./oval.ts"; import { type RaceMarks } from "./races.ts"; import { type Oval } from "./track.ts"; import type { AthleticsFieldEvent, AthleticsInfield, AthleticsRace, AthleticsStyle, AthleticsTrackLook, RaceInfo, WaterJump } from "./types.ts"; /** A box in metres. */ export interface MBox { x0: number; y0: number; x1: number; y1: number; } /** A named part of the plan to crop to, in metres: one box, or one at each end (`left` and `right` as the stadium is drawn wide). */ export type MRange = MBox | { left: MBox; right: MBox; }; /** A part of the plan to label (`landmarks`): where it is, in metres, and the side of the drawing its label stands on. */ export interface MMark { id: string; x: number; y: number; side: "top" | "bottom"; } /** What an athletics drawing is. */ export interface AthleticsPlan { sport: "athletics"; league: string; /** True for the covered 200 m track. */ indoor: boolean; figures: AthleticsFigures; oval: Oval; lanes: number; straight: StraightPlan | undefined; track: AthleticsTrackLook; infield: AthleticsInfield; /** The playing surface: the outer edge of the oval. The data frame's own box. */ box: MBox; /** Everything drawn: the box and what lies beyond it (the jump strip, the runways' ends, the straight). */ extent: MBox; areas: Area[]; shapes: Shape[]; digits: Digits[]; /** The turf: its outline and the lighter bands, for the mown look. */ turf: { d: string; stripes: string; } | undefined; /** The soccer pitch laid inside the track, and where its corner is. */ pitch: { spec: SoccerSpec; x: number; y: number; } | undefined; facilities: Facility[]; races: RaceMarks[]; /** The steeplechase's lap, when it is drawn. */ waterJump: WaterJump | undefined; events: AthleticsFieldEvent[]; /** The width the ordinary line is painted at by the rules, and the width it is drawn at unless `exactLines` says otherwise. */ lineWidth: number; drawnLine: number; ranges: Readonly>; marks: MMark[]; /** The race a close-up of a start (`range: "start"`) shows. */ start: AthleticsRace; /** The close-up of the start of that race, when the options ask for one (`range: "start"`): where it is turned about, and the part shown, in the frame in which the athletes run to the right. */ startView: { pivot: { x: number; y: number; heading: number; }; window: MBox; } | undefined; /** True when the lane numbers are painted. */ numbers: boolean; /** The field event drawn alone at a large scale, when the options ask for one: its facility is the whole plan. */ layout?: AthleticsFieldEvent; } /** The league a set of options asks for: the outdoor standard track, or the covered one. */ export declare function athleticsLeague(o: Pick): AthleticsLeague; /** The field events the options ask for: all of them, none, or a list. @throws Error for a name that is not a field event. */ export declare function eventsOf(style: AthleticsStyle | undefined): AthleticsFieldEvent[]; /** The races the options ask to be marked. @throws Error for a name that is not a race. */ export declare function racesOf(style: AthleticsStyle | undefined, indoor?: boolean): RaceInfo[]; /** The races the covered track marks: the 60 m and its hurdles on the infield straight, and the races of 200 m to 5000 m on the oval. */ export declare const INDOOR_RACES: readonly AthleticsRace[]; /** The number of lanes of the oval the options ask for. */ export declare function athleticsLanes(o: Pick): number; /** The standard track and everything the options ask to be marked on it, as a plan. */ export declare function athleticsPlan(o: Pick & Partial>): AthleticsPlan; export { WA_SHORT_TRACK, WA_STANDARD_TRACK };