import type { Unit } from "../units.ts"; import { type LeagueBase } from "./types.ts"; /** The ground round a court that a rulebook gives a figure for: beside the sidelines and behind the end lines. `null` when it gives none. */ export type FreeZone = { side: number; end: number; } | null; /** The two figures a rulebook can give for the ground round its court: what it asks of its own competitions, and the least it allows or recommends. */ export interface FreeZones { official: FreeZone; least: FreeZone; } /** * A tennis court, from Rule 1 of the ITF's Rules of Tennis and its Appendix X. Feet, as the ITF prints them first. */ export interface TennisFigures { /** Baseline to baseline, to the outside of the lines. */ length: number; /** The singles court's width, and the doubles court's. */ widthSingles: number; widthDoubles: number; /** The service lines: each is this far from the net, to its outside edge. */ serviceLine: number; /** The width of the lines: 1 to 2 inches (the greatest is drawn); a baseline may be up to 4 inches. */ lineWidth: number; baselineWidthMax: number; /** The centre mark: 4 inches long, 2 inches wide, drawn inside the court from the baseline. The centre service line is 2 inches wide. */ centreMark: { length: number; width: number; }; centreServiceWidth: number; net: { /** The net's height at the posts and at the centre. */ heightPosts: number; heightCentre: number; /** The centres of the posts are this far outside the doubles court; the centres of singles sticks this far outside the singles court. */ postsOutside: number; sticksOutside: number; /** The posts are at most 6 inches square, the singles sticks 3 inches. */ postSize: number; stickSize: number; }; /** The ground behind the baselines and beside the sidelines: Appendix X's international and club guides. */ free: FreeZones; } /** A volleyball or beach volleyball court, from Rules 1 and 2 of the FIVB's rules. Metres. */ export interface VolleyballFigures { length: number; width: number; /** All lines are 5 cm wide and drawn inside the dimensions of the court. */ lineWidth: number; /** Indoors: the axis of the centre line is the middle of the court; the attack line's rear edge is this far from it. Beach volleyball has neither. */ attackLine: number | null; /** The broken lines that extend each attack line outside the side lines, in the FIVB's competitions: five short lines (their number follows from the total: it is `total / (length + gap)`), their length, the gap between them (and from the side line), the total length. */ attackExtension: { length: number; gap: number; total: number; } | null; /** The service zone's limits: two short lines, each this long, this far behind the end line, in the side lines' extensions. Indoor only. */ serviceMarks: { length: number; behind: number; } | null; /** The width of the service zone: 9 m indoors, 8 m on the beach. */ serviceZone: number; net: { /** The net's length: at most (indoors 9.50 to 10 m, on the beach 8.5 m), and its width. */ length: number; width: number; /** The height of its top, over the middle of the court: men's and women's. */ heightMen: number; heightWomen: number; /** The posts stand this far outside the side lines: the FIVB's competitions' figure, and the least the rules allow. */ postsOutside: number; postsOutsideLeast: number; /** An antenna, fixed at the outer edge of each side band: its length and its diameter. */ antenna: { length: number; diameter: number; }; }; free: FreeZones; } /** A badminton court, from Law 1 of the BWF's Laws of Badminton and its Diagram A. Metres. */ export interface BadmintonFigures { /** Back boundary line to back boundary line, to the outside of the lines. */ length: number; /** The doubles court's width. The singles sidelines are inside it. */ width: number; /** The lines are 40 mm wide. */ lineWidth: number; /** A singles side line's outside edge is this far inside the doubles side line's. */ singlesInset: number; /** The doubles long service line: its outside edge is this far inside the back boundary line's. */ doublesLongServiceInset: number; /** The short service line's edge nearer the net is this far from the net. */ shortServiceLine: number; net: { postHeight: number; heightCentre: number; heightSides: number; depth: number; widthMin: number; }; free: FreeZones; } /** A pickleball court, from Section 3 of the USA Pickleball rulebook. Feet. */ export interface PickleballFigures { length: number; width: number; /** The non-volley zone: each of its lines is this far from the net, to its outside edge. */ nonVolley: number; /** All lines are 2 inches wide. */ lineWidth: number; net: { /** The net's height at the sidelines and at the centre. */ heightSides: number; heightCentre: number; /** From the inside of one post to the inside of the other (so each stands 1 foot outside a sideline), and the greatest diameter of a post. */ postsInside: number; postDiameter: number; /** The least length of the net. */ lengthMin: number; }; /** The playing surface round the court: the recommended 34 by 64 feet for tournaments, and the least, 30 by 60 feet. */ free: FreeZones; } /** A table tennis table, from Laws 2.1 and 2.2 of the ITTF's Laws of Table Tennis. Metres. */ export interface TableTennisFigures { length: number; width: number; /** The height of the playing surface above the floor. */ height: number; /** The white side lines and end lines are 2 cm wide, the centre line 3 mm. */ edgeLine: number; centreLine: number; net: { /** The top of the net above the playing surface, and the height of the posts. */ height: number; postHeight: number; /** The outside limits of a post are this far outside the side line. */ postOutside: number; }; free: FreeZones; } /** * A padel court, from "The court" in the FIP's Rules of Padel (review of application 1 January 2026). Metres. The court is measured inside its walls, so it has * no lines round it: the enclosure is its boundary. */ export interface PadelFigures { /** Interior length and width (a 0.5% tolerance). */ length: number; width: number; /** All lines are 5 cm wide. */ lineWidth: number; /** The service lines are this far from the net, on either side. */ serviceLine: number; /** The central service line runs from the net and extends at least this far beyond the service line. */ centreOverrun: number; net: { /** The net's length, its height at the centre and at the ends, and the greatest height of a post. */ length: number; heightCentre: number; heightEnds: number; postHeight: number; }; /** The enclosure: the end walls and, at each end of each side, a wall this long, with metal mesh between; the walls' heights. */ enclosure: { sideWall: number; endHeight: number; endWall: number; sideHeight: number; }; free: FreeZones; } /** * A squash court, from the World Squash Federation's Specifications for Squash Courts (28 November 2017), clauses 4 and 5 and Appendices 1 and 2. Metres. The * court is measured between the playing surfaces of its walls, so it has no lines round it; the front wall's lines are heights. */ export interface SquashFigures { length: number; width: number; /** All court markings are 50 mm wide. */ lineWidth: number; /** The nearest edge of the short line is this far from the back wall. */ shortLine: number; /** A service box is a square of this many metres inside its lines. */ serviceBox: number; /** Heights on the walls: to the top of the tin, to the lower edge of the service line and of the front wall line, and of the back wall line. */ wall: { tin: number; serviceLine: number; frontWallLine: number; backWallLine: number; }; free: FreeZones; } /** * A racquetball court, from Rule 2.1 of the International Racquetball Federation's Official Rules 2026-2028 and its Court Specifications (2025). Feet. */ export interface RacquetballFigures { length: number; width: number; /** The lines are 1 to 1 1/2 inches wide: 1 1/2 inches is the recommended width. */ lineWidth: number; /** The back edge of the short line is this far from the back wall (midway between the walls). */ shortLine: number; /** The front edge of the service line is this far in front of the short line's back edge. */ serviceLine: number; /** The edge of a service box's line nearest the centre is this far from the side wall; so is a drive serve line's, at its own figure. */ serviceBox: number; driveServe: number; /** The receiving line's back edge is this far behind the short line's back edge; the broken line's end segment, a segment and a space. */ receiving: { behind: number; end: number; dash: number; gap: number; }; /** The upper edge of the out-of-court line on the back wall, and the least height of the back wall. */ backWall: { outOfCourt: number; least: number; }; /** The height of the court (a ceiling). */ height: number; free: FreeZones; } /** A sepak takraw court, from Laws 1 to 3 of the ISTAF's Law of the Game (2013). Metres. */ export interface SepakTakrawFigures { length: number; width: number; /** The boundary lines are at most this wide, drawn inwards; the service circle's is the same. */ lineWidth: number; /** The centre line, under the net. */ centreLine: number; /** The quarter circles at the ends of the centre line: their radius. */ quarterCircle: number; /** The service circles: their radius, and their centre's distance from the back line and from the sidelines. */ serviceCircle: { radius: number; fromBack: number; fromSide: number; }; net: { /** The least length, the width, the height at the centre for men and for women, and the height at the posts for men and for women. */ length: number; width: number; heightMen: number; heightWomen: number; postMen: number; postWomen: number; /** The posts stand this far from the sidelines, in line with the centre line; at most this far across (in radius). */ postsOutside: number; postRadius: number; }; free: FreeZones; } /** A teqball court and table, from sections 1 and 2 of the FITEQ's Official Rules and Regulations of Teqball (2026). Metres. */ export interface TeqballFigures { /** The least court: the sides parallel to the net are `width` long, the other two `length`. */ length: number; width: number; table: { /** The table's length, its width without the net and with it, and its height with the net. */ length: number; width: number; widthWithNet: number; height: number; }; /** The net: its width, thickness and height above the table. */ net: { width: number; thickness: number; height: number; }; /** The halfway line and the service line are 20 to 50 mm wide: the greatest. */ lineWidth: number; /** The service line is this far from the middle of the table, parallel to the net. */ serviceLine: number; /** The court surrounds: the least and the greatest height. */ surround: { least: number; most: number; }; free: FreeZones; } /** A roundnet court, from Chapter 1 of the International Roundnet Federation's Rules (adopted 21 October 2022). Metres. */ export interface RoundnetFigures { /** The recommended least court; there are no out of bounds. */ length: number; width: number; /** The set: its diameter and its height. */ set: { diameter: number; height: number; }; /** The serving line is a circle this far from the centre of the set; the no hit zone line, another. */ servingRadius: number; noHitRadius: number; /** The distance from the edge of the set to the service line, as the rule also states it. */ edgeToService: number; /** The rules give no width for these lines: ours. */ lineWidth: number; free: FreeZones; } /** A netball court, from Rule 1 of World Netball's Rules of Netball (2024 edition). Metres. */ export interface NetballFigures { /** The side lines' length, and the goal lines'. */ length: number; width: number; /** All lines are 50 mm wide. */ lineWidth: number; /** The centre circle's diameter, and the goal circle's radius (a semicircle centred on the middle of the outside of the goal line). */ centreCircle: number; goalCircle: number; /** A goalpost's height, the greatest diameter of its pole, and its ring: the inside diameter, the rod's diameter, and the length of the bar that carries it forward from the pole. */ post: { height: number; poleDiameter: number; ring: { inside: number; rod: number; bar: number; }; }; free: FreeZones; } /** The figures of any net sport's court. */ export type NetFigures = TennisFigures | VolleyballFigures | BadmintonFigures | PickleballFigures | TableTennisFigures | PadelFigures | SquashFigures | RacquetballFigures | SepakTakrawFigures | TeqballFigures | RoundnetFigures | NetballFigures; /** The sports of these courts. */ export type NetSport = "tennis" | "volleyball" | "badminton" | "pickleball" | "tabletennis" | "padel" | "squash" | "racquetball" | "sepaktakraw" | "teqball" | "roundnet" | "netball"; export type TennisLeague = LeagueBase<"tennis", TennisFigures>; export type VolleyballLeague = LeagueBase<"volleyball", VolleyballFigures>; export type BadmintonLeague = LeagueBase<"badminton", BadmintonFigures>; export type PickleballLeague = LeagueBase<"pickleball", PickleballFigures>; export type TableTennisLeague = LeagueBase<"tabletennis", TableTennisFigures>; export type PadelLeague = LeagueBase<"padel", PadelFigures>; export type SquashLeague = LeagueBase<"squash", SquashFigures>; export type RacquetballLeague = LeagueBase<"racquetball", RacquetballFigures>; export type SepakTakrawLeague = LeagueBase<"sepaktakraw", SepakTakrawFigures>; export type TeqballLeague = LeagueBase<"teqball", TeqballFigures>; export type RoundnetLeague = LeagueBase<"roundnet", RoundnetFigures>; export type NetballLeague = LeagueBase<"netball", NetballFigures>; /** A league with a net sport's court. */ export type NetLeague = TennisLeague | VolleyballLeague | BadmintonLeague | PickleballLeague | TableTennisLeague | PadelLeague | SquashLeague | RacquetballLeague | SepakTakrawLeague | TeqballLeague | RoundnetLeague | NetballLeague; /** A net sport's figures in feet, from the unit its rulebook gives them in. */ export declare const netInFeet: (figures: F, unit: Unit) => F; /** * The ITF's court, from Rule 1 of the Rules of Tennis (2026) and its Appendix X, in feet as the ITF prints them: 78 feet long, 27 feet wide for singles and * 36 feet for doubles; the net 3 feet 6 inches at the posts and 3 feet at the centre; the centres of the net posts 3 feet outside the doubles court and the * centres of singles sticks 3 feet outside the singles court; the service lines 21 feet from the net; the centre mark 4 inches long and the centre service * line 2 inches wide; the other lines 1 to 2 inches wide and the baselines up to 4 inches; posts at most 6 inches square, singles sticks 3. Appendix X * recommends 21 feet behind the baselines and 12 feet beside the sidelines for international competitions, 18 and 10 for clubs. */ export declare const ITF_TENNIS: TennisFigures; /** * The FIVB's indoor court, from Rules 1 and 2 of the Official Volleyball Rules 2025-2028, in metres as it prints them: 18 by 9 m inside a free zone of at least 3 m * (5 m beside the side lines and 6.5 m behind the end lines in the FIVB's competitions); lines 5 cm wide inside the dimensions; the attack line's rear edge 3 m * from the axis of the centre line and, in the FIVB's competitions, extended by five 15 cm lines 20 cm apart to 1.75 m; the service zone 9 m wide, limited by * two 15 cm lines 20 cm behind the end line; the net 1 m wide and 9.50 to 10 m long, 2.43 m (men) or 2.24 m (women) high; each antenna 1.80 m long and 10 mm * across, at the outer edge of a side band; the posts 0.50 to 1.00 m outside the side lines, 1 m in the FIVB's competitions. */ export declare const FIVB_INDOOR: VolleyballFigures; /** * The FIVB's beach court, from Rules 1 and 2 of the Official Beach Volleyball Rules 2025-2028, in metres: 16 by 8 m inside a free zone of at least 3 m (at least 5 m * in the FIVB's competitions); lines 5 cm wide inside the dimensions and no centre line; the service zone 8 m wide; the net 8.5 m long and 1 m wide, at the same * heights; the posts 0.70 to 1.00 m outside the side lines, 1 m in the FIVB's competitions. */ export declare const FIVB_BEACH: VolleyballFigures; /** * The BWF's court, from Law 1 of the Laws of Badminton (as amended 26 April 2025) and its Diagram A, in metres: 13.40 by 6.10 m, lines 40 mm wide; the singles * side lines 460 mm inside the doubles side lines (so 5.18 m apart, outside to outside); the short service lines 1.98 m from the net; the doubles long service * lines 760 mm inside the back boundary lines; the net 1.524 m high at the centre and 1.55 m over the doubles side lines, 760 mm deep and at least 6.1 m * wide; the posts 1.55 m high, on the doubles side lines. */ export declare const BWF_BADMINTON: BadmintonFigures; /** * USA Pickleball's court, from Section 3 of the 2026 rulebook, in feet as it prints them: 20 by 44 feet to the outside edge of the lines (3.A.1, 3.A.2); the * non-volley zone 7 feet from the net (3.A.4.c); all lines 2 inches wide (3.A.4.e); the posts 22 feet apart, inside to inside, and at most 3 inches across * (3.B.2); the net at least 21 feet 9 inches long (3.B.3), 36 inches high at the sidelines (3.B.6) and 34 inches at the centre (3.B.7); a playing surface of at least * 30 by 60 feet, 34 by 64 feet recommended for tournaments (3.A.3). */ export declare const USAP_PICKLEBALL: PickleballFigures; /** * The ITTF's table, from Laws 2.1 and 2.2 of the Laws of Table Tennis (the 2026 statutes), in metres: 2.74 by 1.525 m and 76 cm above the floor; a white side line * and end line 2 cm wide, a white centre line 3 mm wide; the net 15.25 cm above the playing surface, hung from posts 15.25 cm high whose outside limits are 15.25 cm * outside the side lines. */ export declare const ITTF_TABLE: TableTennisFigures; /** * The World ParaVolley's sitting volleyball court, from Rules 1 and 2 of the Official Sitting Volleyball Rules 2025-2028, in metres: 10 by 6 m inside a free zone of * at least 3 m (4 m beside the side lines and 6 m behind the end lines in World ParaVolley, World and Official Competitions); lines 5 cm wide inside the dimensions; * the attack line's rear edge 2 m from the axis of the centre line and, in those competitions, extended by five 15 cm lines 20 cm apart to 1.75 m; the service zone 6 m * wide, limited by two 15 cm lines 20 cm behind the end line; the net 0.80 m wide and 6.5 to 7 m long, 1.15 m (men) or 1.05 m (women) high; each antenna 1.60 m long and * 10 mm across; the posts 0.5 to 1.0 m outside the side lines, 1 m in those competitions. */ export declare const WPV_SITTING: VolleyballFigures; /** * The FIP's padel court, from "The court" (dimensions, net, enclosures) in the Rules of Padel (review of application 1 January 2026), in metres: 10 by 20 m inside * the walls; the service lines 6.95 m from the net on either side, the central service line between the net and each, extending at least 20 cm beyond it; lines 5 cm * wide; the net 10 m long, 0.88 m high at the centre and 0.92 m at the ends, on posts at most 1.05 m high whose outer side is the side limit of the court; the court * enclosed, the end walls 4 m high (3 m of wall and 1 m of metal fence) and each side wall, at both ends, 4 m long and 3 m high with metal fence between. */ export declare const FIP_PADEL: PadelFigures; /** * World Squash's singles court, from clauses 4.01 and 5 and Appendix 1 of its Specifications for Squash Courts (28 November 2017), in metres: 9.75 by 6.40 m between the * playing surfaces; markings 50 mm wide; the nearest edge of the short line 4.26 m from the back wall; each service box a square of 1.60 m inside its lines; on the * front wall the top of the tin 480 mm up, the lower edge of the service line 1.78 m and of the front wall line 4.57 m, and on the back wall the back wall line 2.13 m. */ export declare const WSF_SQUASH: SquashFigures; /** World Squash's doubles court (Appendix 2, clause 4.02): 7.62 m wide, the rest as the singles court. */ export declare const WSF_SQUASH_DOUBLES: SquashFigures; /** World Squash's international competition width doubles court (Appendix 2 note 8, clause 4.03): 8.42 m wide, with the top of the tin 330 mm up, for WSF recognised World and Regional events and the Commonwealth Games. */ export declare const WSF_SQUASH_WIDE: SquashFigures; /** * The IRF's racquetball court, from Rule 2.1 of the Official Rules 2026-2028 and Section Three of the Court Specifications (2025), in feet as they are printed: 20 feet * wide, 40 feet long and 20 feet high; lines 1 to 1 1/2 inches wide (1 1/2 inches, bright red, recommended); the back edge of the short line 20 feet from the back wall; * the front edge of the service line 5 feet in front of the short line's back edge; a service box's line 18 inches from the side wall and a drive serve line 3 feet from * it (to the edge nearest the centre); the receiving line's back edge 5 feet behind the short line's back edge, a broken line of two 21 inch ends and sixteen 6 inch * lines between 6 inch spaces; the back wall at least 12 feet high, with the out-of-court line's upper edge at 12 feet. */ export declare const IRF_RACQUETBALL: RacquetballFigures; /** * The ISTAF's court, from Laws 1 to 3 of the Law of the Game (2013, dated 9 December 2013), in metres: 13.40 by 6.10 m; the boundary lines at most 0.04 m wide, drawn * inwards; a centre line 0.02 m wide; a quarter circle of 0.9 m radius at each end of the centre line; a service circle of 0.3 m radius on each side, its centre 2.45 m * from the back line and 3.05 m from the sidelines, its line 0.04 m wide; a free zone of 3.0 m; the posts 0.3 m outside the sidelines, in line with the centre line, * 1.55 m (men) or 1.45 m (women) high; the net 0.7 m wide and at least 6.1 m long, 1.52 m (men) or 1.42 m (women) high at the centre. */ export declare const ISTAF_SEPAK_TAKRAW: SepakTakrawFigures; /** * The FITEQ's teqball court and table, from sections 1 and 2 of the Official Rules and Regulations of Teqball (2026), in metres: a table 3,000 mm long and 1,500 mm * wide (1,700 mm with the net), 900 mm high with the net; a net 1,700 mm wide, 20 mm thick and 140 mm high; the table in the exact middle of a court of at least 12 m * (the sides parallel to the net) by 16 m, the net parallel to the shorter sides; the halfway line across the middle, and a service line on each side 3.5 m from the * middle of the table, each 20 to 50 mm wide; court surrounds 500 to 1,500 mm high. */ export declare const FITEQ_TEQBALL: TeqballFigures; /** * The International Roundnet Federation's court, from Rules 1.1.2 and 1.2.1 to 1.2.4 (adopted 21 October 2022), in metres: a set 91.4 cm across and 20.3 cm high; a court * of at least 10 by 10 m (33 by 33 feet) recommended, with no out of bounds; a serving line drawn as a circle 2.6 m (8.5 feet) from the centre of the set, 2.13 m (7 feet) * from its edge; a no hit zone line drawn as a circle 90 cm (3 feet) from the centre; a mark at each of the four service positions, 90 degrees apart. */ export declare const IRF_ROUNDNET: RoundnetFigures; /** * World Netball's court, from Rule 1 (Technical specifications, Court and related areas, items 2 to 8, 13 and 14) of the Rules of Netball (2024 edition), in metres: * 30.5 m (100 feet) by 15.25 m (50 feet); two transverse lines dividing it into three equal areas; a centre circle 0.9 m (3 feet) across; at each end a goal circle, a * semicircle of radius 4.9 m (16 feet) centred on the middle of the outside of the goal line; lines 50 mm wide; a court surround 3.05 m (10 feet) on every side; a goalpost * at the middle of each goal line, its pole 65 to 100 mm across and 3.05 m high, the back of the pole at the outer edge of the goal line, with a ring of 380 mm inside * diameter made of 15 mm rod, on a bar 150 mm long projecting from the pole. */ export declare const WN_NETBALL: NetballFigures; /** The tennis leagues: the ITF's. The ATP and the WTA play by the ITF's rules. */ export declare const TENNIS_LEAGUES: readonly TennisLeague[]; /** The volleyball leagues: the FIVB's indoor court, its beach court, and World ParaVolley's sitting volleyball court. */ export declare const VOLLEYBALL_LEAGUES: readonly VolleyballLeague[]; /** The badminton leagues: the BWF's. */ export declare const BADMINTON_LEAGUES: readonly BadmintonLeague[]; /** The pickleball leagues: USA Pickleball's. */ export declare const PICKLEBALL_LEAGUES: readonly PickleballLeague[]; /** The table tennis leagues: the ITTF's. */ export declare const TABLE_TENNIS_LEAGUES: readonly TableTennisLeague[]; /** The padel leagues: the FIP's. */ export declare const PADEL_LEAGUES: readonly PadelLeague[]; /** The squash leagues: World Squash's singles court, its doubles court and its international competition width doubles court. */ export declare const SQUASH_LEAGUES: readonly SquashLeague[]; /** The racquetball leagues: the IRF's. */ export declare const RACQUETBALL_LEAGUES: readonly RacquetballLeague[]; /** The sepak takraw leagues: the ISTAF's. */ export declare const SEPAK_TAKRAW_LEAGUES: readonly SepakTakrawLeague[]; /** The teqball leagues: the FITEQ's. */ export declare const TEQBALL_LEAGUES: readonly TeqballLeague[]; /** The roundnet leagues: the International Roundnet Federation's. */ export declare const ROUNDNET_LEAGUES: readonly RoundnetLeague[]; /** The netball leagues: World Netball's. */ export declare const NETBALL_LEAGUES: readonly NetballLeague[];