import type { SheetSpec } from "../leagues/curling.ts"; /** A box in the sheet's wide frame, in feet. */ interface Wide { x: number; y: number; w: number; h: number; } /** One enlarged end. */ export interface FoldPanel { end: "left" | "right"; /** The part of the sheet it shows, in the sheet's own feet (the boards included across it). */ crop: Wide; /** Where it is drawn, in the wide frame of the whole drawing. */ box: Wide; /** The transform of the part of the sheet that fills it, and the id of the clip that cuts it to `crop`. */ transform: string; clip: string; /** Where along the sheet, in the wide frame of the drawing, the blank ice between the house and the hog line is centred: a label stands there. Missing when the panel holds only the house. */ free?: number; } /** The folded layout of a sheet. */ export interface FoldPlan { /** How much larger than the strip each panel is drawn. */ scale: number; /** The viewBox of the drawing as it lies wide: the strip is at y = 0 to the sheet's width, and the panels are above and below it. */ view: Wide; /** The left end's panel first and the right end's second. */ panels: [FoldPanel, FoldPanel]; } /** What the layout is worked out from. */ export interface FoldOptions { /** What each panel holds: the half from the hog line to the back line, or the house. */ panels: "half" | "house"; /** The width of the drawing as the eye sees it over its height. */ fit: number; /** The ground round the whole, in feet. */ margin: number; /** True when the drawing lies tall: its panels are then at its left and right, and the left end's is at the left. */ turned: boolean; /** A prefix for the ids of the clips. */ id: string; } /** The part of the sheet an end's panel shows, in the sheet's own feet along it (the boards included across it). */ export declare function foldCrop(spec: SheetSpec, tee: number, end: "left" | "right", panels: "half" | "house"): Wide; /** * Where everything of a folded sheet goes. The strip keeps its own place (x along the sheet from 0 to its length, y across it from 0), so that a data layer's numbers are the same * on the strip as on a sheet drawn whole; each panel is the same drawing at a larger scale, which is chosen so that the whole has the shape asked for (`fit`), and which * is never less than the strip's own nor wider than the strip. */ export declare function foldPlan(spec: SheetSpec, tees: readonly [number, number], o: FoldOptions): FoldPlan; /** The clips of the panels: each cuts the sheet to the part its panel shows. */ export declare const foldClips: (plan: FoldPlan) => string; /** The sheet's own markup laid in each panel, cut to the part the panel shows. */ export declare const foldCopies: (plan: FoldPlan, markup: string) => string; /** * What joins each panel to the part of the strip it enlarges: a faint fan from the panel's edge to that part, and a frame round the part, as an inset on a map is joined to what it shows. * The panels' own frames are drawn here too. */ export declare function foldLinks(plan: FoldPlan, sheetWidth: number): string; /** * The label of each panel, in a small plate that is upright whichever way the drawing lies. It stands in the free ground beyond the panel's far end, in line with the panel's middle (the * panels are as long as the strip allows, not as long as the frame, so there is room there); when there is none, over the blank ice of a half between the house and the hog line. * `labels` are the words for the left end's panel and the right end's. */ export declare function foldLabels(plan: FoldPlan, labels: readonly [string, string], turned: boolean): string; export {};