import type { JudoFigures } from "../leagues/budo.ts"; import { boxD } from "./kit.ts"; import { type MBox, type MMark, type Parts } from "./parts.ts"; import { type MatSize, type Piece } from "./tatami.ts"; import type { BudoStyle } from "./types.ts"; /** The mats a `tatami` option names. */ export declare const TATAMI: Readonly, MatSize>>; /** What a judo plan is laid out from. */ export interface JudoOptions { fig: JudoFigures; /** The contest area's side, the safety area's width and the number of areas across and down. */ contest: number; safety: number; across: number; down: number; mat: MatSize; platform: boolean; officials: boolean; start: boolean; seams: boolean; /** The colours of the tape: the contestant to the referee's right, then to his left (blue and white in the IJF's rules, red and white in the AJJF's). */ tape: readonly ["blue" | "red" | "white", "white"]; } /** What a judo plan is. */ export interface JudoLayout { parts: Parts; /** The tatami (the contest and the safety areas together) and everything that lies beyond it. */ tatami: MBox; extent: MBox; /** The contest areas, left to right and top to bottom. */ contests: MBox[]; /** The distance between two areas that adjoin. */ gap: number; pieces: Piece[]; /** The mat the area is laid with. */ mat: MatSize; marks: MMark[]; /** The width of the red band of a danger zone, or 0. */ danger: number; } /** The mats of a `tatami` option, or the league's own when none. @throws Error for a name that is not a size of mat. */ export declare function matOf(asked: BudoStyle["tatami"], fig: JudoFigures): MatSize; /** * A size made a whole number of mats' widths, for mats that do not divide the rule's metres (the AJJF's 91 cm): the next whole number of mats up, so that a least the rules give is kept, or the last that * is within the greatest. 8 m of 91 cm mats is 9 mats, 8.19 m; 3 m is 4 mats, 3.64 m (two ken, as the AJJF's guidebook has it). */ export declare function snapTo(size: number, width: number, least: number, greatest: number): number; /** The areas across and down that the options ask for. @throws RangeError for a number outside 1 to 6. */ export declare function gridOf(areas: BudoStyle["areas"]): { across: number; down: number; }; /** The size of a contest area the options ask for, held to what the rules allow. */ export declare const contestOf: (asked: number | undefined, fig: JudoFigures) => number; /** The width of the safety area the options ask for. */ export declare const safetyOf: (asked: number | undefined, fig: JudoFigures) => number; /** The plan of the competition area the options ask for. */ export declare function judoParts(o: JudoOptions): JudoLayout; /** The number of mats of the competition area: a half mat counts a half. */ export declare const mats: (layout: JudoLayout, mat: MatSize) => number; export { boxD };