import { type RacePlan } from "./pool.race.ts"; import type { DeckLook, PoolKind, PoolLook, PoolSport, PoolStyle, VenueOptions, VenuePool } from "./pool.types.ts"; import type { SurfaceOptions } from "./types.ts"; /** The sports of the pool, in the order a menu lists them. */ export declare const POOL_SPORTS: readonly PoolSport[]; /** True for a sport whose surface is a pool. */ export declare const isPoolSport: (sport: unknown) => sport is PoolSport; /** Metres as feet, the unit a drawing is made in. */ export declare const feet: (metres: number) => number; /** The colours of the ropes of a pool, by name. */ export type RopeColour = "green" | "blue" | "yellow"; /** A lane rope: where it lies across the pool (metres from the top wall) and its colour. */ export interface Rope { y: number; colour: RopeColour; } /** A lane: its number, the middle of its marking on the floor, and its two edges, in metres from the top wall. */ export interface LanePlan { number: number; y: number; top: number; bottom: number; } /** The look and the extras every pool has. */ export interface Common { look: PoolLook; deck: DeckLook; seed: number; } /** A swimming pool to draw. */ export interface SwimPlan extends Common { sport: "swimming"; kind: PoolKind; course: "long" | "short"; /** The length between the touch panels and the width across the lanes and the spaces, in metres. */ length: number; width: number; /** The lanes from the top of the drawing down: lane 1 (or 0) is at the bottom, on the right when one faces the course from the start (Part Two 15.8.6). */ lanes: LanePlan[]; /** The metres of space outside the first and the last lane. */ space: number; ropes: Rope[]; blocks: boolean; pads: boolean; flags: boolean; falseStart: boolean; depth: number; section: { exaggerate: number; } | undefined; race: RacePlan | undefined; } /** A water polo field to draw. */ export interface PoloPlan extends Common { sport: "waterpolo"; length: number; width: number; /** The side of the official table, as the field lies wide. */ table: "top" | "bottom"; } /** One board of a diving well: a springboard or a platform, with its plummet (metres from the wall, then across from the top) and its size. */ export interface Board { kind: "springboard" | "platform"; height: number; /** The plummet: x from the pool wall the boards stand at, y across from the top wall. */ x: number; y: number; length: number; width: number; } /** A diving well to draw. */ export interface DivePlan extends Common { sport: "diving"; length: number; width: number; boards: Board[]; /** The metres behind the wall that the stands reach, for the view. */ behind: number; } /** An artistic swimming area to draw. */ export interface ArtisticPlan extends Common { sport: "artisticswimming"; area: "olympic" | "minimum"; length: number; width: number; /** For the minimum area: the deep part, in metres from the left wall and the top wall, and its size. */ deep: { x: number; y: number; length: number; width: number; } | undefined; } export type PoolPlan = SwimPlan | PoloPlan | DivePlan | ArtisticPlan; /** The size of the water of a pool in metres: `length` along the drawing and `width` across it. */ export declare const poolSize: (plan: PoolPlan) => { length: number; width: number; }; /** The look the options ask for. @throws Error for a look or a deck the pool does not have. */ export declare function commonOf(style: PoolStyle): Common; /** The colour of rope `i` of `n + 1`: green outside, yellow round the middle, blue between (Part Two 15.7.6.1 and 15.7.6.3 for eight lanes; 15.7.6.2 for ten). */ export declare function ropeColour(i: number, lanes: number): RopeColour; /** The width of a swimming pool of this length and this many lanes, the space outside the first and the last lane, and the width of those two lanes. */ export declare function laneWidths(course: "long" | "short", lanes: number, temporary: boolean): { width: number; space: number; edge: number; }; /** The lanes and the ropes of a pool of this width, from the top. */ export declare function lanesOf(width: number, lanes: number, space: number): { lanes: LanePlan[]; ropes: Rope[]; }; /** * The swimming pool the options ask for: `pool.course` (`long`, 50 m, or `short`, 25 m) and `pool.lanes` (8 by default). The width is the rules' for that many lanes: 25 m for eight in a 50 m * pool (Part Two 15.6.1), 25 m for ten with lanes 0 and 9 of 2.4 m (Part Two 15.6.2.1), or 26 m for a temporary pool (Part Two 15.6.2.2), and lanes of 2.5 m with spaces of 0.5 m for the other pools. * @throws RangeError for a lane count that is not 1 to 10, @throws Error for an unknown look. */ export declare function swimPlan(o: Pick, defaults?: Partial>): SwimPlan; /** The water polo field the options ask for: 25 by 20 m (Part Six 20.2.2). */ export declare function poloPlan(o: Pick): PoloPlan; /** * The diving well the options ask for. The springboards (1 m and 3 m, `pool.boards` of each, 2 by default so that a synchronised pair stands side by side) stand along the left wall, 3 m boards outside, each the preferred * distance (Part Four, Appendix 2, B and C) from the wall and from the next; the platforms (5, 7.5 and 10 m by default) stand towards the right wall, the tallest the distance B from it and each lower one the distance C of the * platform above it from that one. The well is 25 m across, wider if the boards need more room than that. * @throws RangeError for a platform the rules do not have or a count of boards that is not 1 to 4. */ export declare function divePlan(o: Pick): DivePlan; /** The artistic swimming area the options ask for: 30 by 20 m for the Olympic Games and the World Championships, or the least, 25 by 15 m with a 12 by 12 m deep part (Part Seven 12.2.2, 12.1.1). */ export declare function artisticPlan(o: Pick): ArtisticPlan; /** The pool the options ask for, of the sport's kind. */ export declare function poolPlan(o: Pick): PoolPlan; /** The hall of a natatorium asked for, with `natatorium` standing for the usual three pools. */ export declare function venueOf(style: PoolStyle): VenueOptions | undefined; /** What each plan reaches beyond its water, in metres on each side: the blocks and flag standards, the platforms and table, the stands behind the diving boards, the judges' platform. */ export declare function reachOf(plan: PoolPlan): { left: number; right: number; top: number; bottom: number; }; /** One pool of a hall: its plan and where its water's top left corner is, in metres from the corner of the water of the whole hall. */ export interface VenueItem { pool: VenuePool; plan: PoolPlan; x: number; y: number; } /** A hall laid out: its pools, and the size of the box round their water, in metres. */ export interface VenueLayout { items: VenueItem[]; width: number; height: number; apart: number; labels: boolean; seating: boolean; /** How far the pools' fixtures reach beyond the box, in metres. */ reach: { left: number; right: number; top: number; bottom: number; }; } /** * The pools of a hall (`pool.venue`) laid out to scale. A pool with an `x` and a `y` stands there; the others are set in rows, left to right, each `apart` metres (10, the distance the rules prefer between * a swimming pool and a diving well, Part Two 15.15.1; never less than the 8 they require) from the one before, and a new row when a row would be longer than 125 m. * @throws RangeError when two pools are nearer each other than `apart`, for the pools given places. */ export declare function venueLayout(style: PoolStyle): VenueLayout | undefined; /** The box round the water the options draw, in feet: the pool's, or the whole hall's. */ export declare function poolBox(o: Pick): { w: number; h: number; };