import type { Sport } from "./types.ts"; /** A unit of length: feet, inches, yards, metres, centimetres or millimetres. */ export type Unit = "ft" | "in" | "yd" | "m" | "cm" | "mm"; /** The units, from the largest used for a field to the smallest. */ export declare const UNITS: readonly Unit[]; /** How many feet are in one of each unit (the international foot is exactly 0.3048 metres). */ export declare const FEET_PER: Readonly>; /** * The unit each surface's rulebook states its dimensions in: the NFL's and the CFL's fields in yards (and the IFAF's, which * follows them), the NHL's rink, the NBA's court and the baseball field in feet, a soccer pitch in metres (the Laws'), a tennis court, a pickleball court and a racquetball court in feet (the ITF's, USA Pickleball's and the IRF's), a volleyball court, a badminton court, a table, a padel court, a squash court, a sepak takraw court, a teqball court, a roundnet court and a netball court in metres (FIVB's, BWF's, ITTF's, FIP's, World Squash's, ISTAF's, FITEQ's, the International Roundnet Federation's and World Netball's), a curling sheet in metres (World Curling's rules give metres with feet beside them; Curling Canada's give feet first, and its league `curling-canada` has feet), a rugby field, an Australian football ground, a Gaelic field, a hockey pitch and a handball court in metres (the rulebooks'), a swimming pool, a water polo field, a diving well and an artistic swimming area in metres (World Aquatics') and a cricket ground in yards (the Laws' and the ICC's; the NLL's box floor and the PLL's and the NCAA men's fields are in the leagues' own feet and yards). A Japanese park's fence is measured in * metres and converted once: see `parkUnit`. */ export declare const SURFACE_UNITS: Readonly>; /** True when `unit` is one of the six. */ export declare const isUnit: (unit: unknown) => unit is Unit; /** * A length in another unit. * @example * ```ts * import { convertLength } from "@johnmorrisdotca/kyogijo-stadiums/geometry"; * console.log(convertLength(100, "yd", "ft"), convertLength(200, "ft", "m").toFixed(2)); * // 300 60.96 * ``` */ export declare function convertLength(value: number, from: Unit, to: Unit): number; /** A point or a vector: `[x, y]`. */ export type Point = readonly [x: number, y: number]; /** A point in another unit. */ export declare function convertPoint(point: Point, from: Unit, to: Unit): [number, number]; /** A table of dimensions with every number turned into another unit, keeping its shape. */ export type Scaled = T extends number ? number : T extends string | boolean | undefined | null ? T : T extends readonly (infer U)[] ? Scaled[] : { -readonly [K in keyof T]: Scaled; }; /** * Every length in a table of dimensions (`NHL`, `MLB`, a `FootballSpec`, nested objects and lists of numbers), in another * unit. Text and flags are kept as they are. The table is not changed. * @example * ```ts * import { NHL, lengthsIn } from "@johnmorrisdotca/kyogijo-stadiums/geometry"; * const rink = lengthsIn(NHL, "m"); * console.log(rink.length.toFixed(2), rink.width.toFixed(3)); * // 60.96 25.908 * ``` */ export declare function lengthsIn(table: T, to: Unit, from?: Unit): Scaled;