import type { PaceOptions, PoolRace, RaceShow, Swimmer, SwimmerStatus } from "./pool.types.ts"; /** A time in seconds from a number or from text: `26.12`, `"26.12"`, `"1:46.91"`. `undefined` when it is neither. */ export declare function parseTime(value: unknown): number | undefined; /** * A time in seconds as swimming writes it, to the hundredth: `26.12`, `1:46.91`, `14:31.02`. A time that rounds to the next minute carries into it. * @example * ```ts * import { formatTime } from "@johnmorrisdotca/kyogijo-stadiums/replay"; * console.log(formatTime(26.121), formatTime(106.9), formatTime(59.996)); * // 26.12 1:46.90 1:00.00 * ``` */ export declare function formatTime(seconds: number): string; /** One lane of a race as it is drawn. */ export interface RaceRow { swimmer: Swimmer; lane: number; name: string; abbr: string; flag: string | undefined; /** The country code of the flag, when the swimmer has one and no `flag` of its own. */ country: string | undefined; color: string | undefined; seed: string | undefined; /** The final time in seconds and as it is written (a time of text that cannot be read is written as it is). */ time: number | undefined; timeText: string | undefined; place: number | undefined; reaction: number | undefined; /** The cumulative times at each split, in seconds; `NaN` for one the data lacks. */ splits: number[]; status: SwimmerStatus | undefined; record: string | undefined; } /** A race, checked, with what is shown and the pace of the field. */ export interface RacePlan { event: string | undefined; /** The metres of the race. */ distance: number; /** The metres between two splits. */ splitEvery: number; rows: RaceRow[]; show: Required; pace: Required | null; /** The seconds per 100 m of the fastest and the slowest split of the field, for the colour of the pace bars. */ fastest: number | undefined; slowest: number | undefined; /** True when any swimmer has a time, a status or a place. */ hasResults: boolean; hasSplits: boolean; hasReaction: boolean; } /** The seconds per 100 m of the split from `from` to `to` seconds over `metres`. */ export declare const pacePer100: (from: number, to: number, metres: number) => number; /** * Read and check a race for a pool whose lanes are numbered `lanes`, `splitEvery` metres apart by default and `length` metres long. * `lanes` are the pool's lane numbers in the order they lie down the drawing, which is the order the rows are given in. A swimmer with no `time` whose splits reach the whole race has the last split for it. * @throws RangeError for a lane the pool does not have, or two swimmers in one lane. @throws TypeError when `swimmers` is not a list. */ export declare function racePlan(race: PoolRace, lanes: readonly number[], defaults: { splitEvery: number; length: number; }): RacePlan; /** The metres of the split with this index (from 0): `every`, except the last, which is whatever is left of the race. */ export declare function splitMetres(index: number, every: number, distance: number): number; /** The status written in place of a time. */ export declare const STATUS_TEXT: Readonly>;