import type { RangeBox, RangeName, Side, Sport, SurfaceOptions } from "./types.ts"; /** One range of a sport: its name, and the end it is at by default when it is at an end (`left` or `right`, as the surface is drawn wide). A range with no `end` is in the middle or is the whole of something. */ export interface RangeInfo { id: RangeName; end?: Side; /** The leagues the range is for, when only some of the sport's have it (rugby union's 22 and rugby league's 20-metre area; the fielding circle of the ICC's grounds). Every league when missing. */ leagues?: readonly string[]; } /** * The named ranges of each sport, in the order a menu lists them: `{ id, end }`, with `end` the end the range is at when `range` gives none (`left` or `right`, as the surface is * drawn wide; a range with no `end` is in the middle or is the whole of something and ignores one). Offensive ranges are at the right by default, as a frame's numbers are for a team * that attacks the right (see `toSurface`); defensive and own ranges at the left; the others, such as a half, at the left, as a curling sheet's house is. */ export declare const RANGES: Readonly>; /** What a drawing's `range` asks for, checked: a name (at an end, or at its default) or a box. */ /** A name carries its `end` (the one asked for, else the range's default; none for a range with no end) and `asked`, the end the options named, if they did. */ export type ParsedRange = { kind: "name"; name: RangeName; end: Side | undefined; asked: Side | undefined; } | { kind: "box"; box: RangeBox; }; /** * The range the options ask for, or `undefined` when they ask for none. * @throws RangeError for a name the sport does not have (the message lists the sport's), or an `end` that is not `left` or `right`. * @throws TypeError for a box without its four numbers. */ export declare function parseRange(o: Pick): ParsedRange | undefined;