import "./frames.providers.ts"; import type { P } from "./layers.marks.ts"; import type { LayerBase } from "./layers.types.ts"; import { type Outline } from "./outline.ts"; import { type KyogijoWords } from "./strings.ts"; import type { Box, ScoreOptions, SurfaceOptions } from "./types.ts"; import { type Unit } from "./units.ts"; export declare const isNum: (value: unknown) => value is number; export declare const clamp01: (value: number) => number; export declare const own: (table: object, key: string) => boolean; export declare const opacityOf: (value: unknown) => number | undefined; /** What a drawing's layers are drawn against. */ export interface Env { o: SurfaceOptions | ScoreOptions; id: string; turned: boolean; /** The turn, in degrees, that texts and logos are given to read upright: the quarter back (-90) when the surface is turned a quarter, else 0, or the surface's own (a close-up of an athletics start is turned to any angle). */ back: number; unit: Unit; outline: Outline; /** * The part of the surface that is shown, in feet in the drawing's frame: the outline's box, or, when the drawing is cropped to a range, the box of the range. Marks, * heat maps and the legend are sized and laid out against it. */ shown: Box; /** True when the drawing is cropped to a range, so that layers are cut to `shown` as well as to the outline. */ cropped: boolean; /** The width of a mark by default, in feet: a share of the longer side of what is shown. */ base: number; words: KyogijoWords; logos: { home?: string; away?: string; }; /** Whether the layer being drawn writes `data-mark-id`, `data-index` and `data-zone` on its marks: set for each layer by `renderLayers`. */ marks: boolean; /** The finest zone of the surface a place (feet, the drawing's wide frame) lies in, by id: what a mark carries as `data-zone`. `undefined` where the sport has none there. */ zone: (x: number, y: number) => string | undefined; } /** * The data attributes every mark carries, so that one listener on the drawing can link a mark to a table: `data-mark-id` (the id the caller gave the datum, else its index), * `data-index` (its place in the layer's data) and `data-zone` (the zone it lies in, from `zoneAt`'s rules). The place is in feet in the drawing's wide frame. */ export declare function markAttrs(env: Env, id: unknown, index: number, at?: readonly [number, number], name?: string): string; /** What a layer made. */ export interface Made { /** The elements of the layer, and its gradients as `defs`. */ marks: string; defs: string; /** The attributes of the layer's group beyond the standard ones. */ style: string; /** Attributes for the layer's group. */ attr: string; opacity: number | undefined; drawn: number; skipped: number; outcomes: Map; teams: Map; low: number; high: number; /** For a heat map, a zone chart or a contour chart: the class of the group, the title's noun and the sentences of the description. */ cls?: string; title?: string; text?: string; /** Styles of the layer that need a rule of their own (the dark set of a colour ramp). */ css?: string; /** Markup that follows the layer's group and is not cut to the surface: a heat layer's legend. */ after?: string; } export declare const toArray: (value: readonly T[] | undefined, what: string) => readonly T[]; /** The size a provider's frame is fitted to: the drawn surface's, for a soccer pitch and a league's surface; none for a sport's own fixed one. */ export declare const fittedSize: (env: Env) => { length: number; width: number; unit: "ft"; } | undefined; export declare function unitOfLayer(layer: LayerBase, env: Env): Unit; /** Places in the layer's frame and unit as places in the drawing's frame, in feet: through the layer's frame when it has one, and held to its limits. */ export declare function place(layer: LayerBase, env: Env, points: readonly P[], unit: Unit): P[]; /** The inverse of `place`: places on the surface, in feet, as the layer's own coordinates (its frame and unit). */ export declare function placeBack(layer: LayerBase, env: Env, points: readonly P[], unit: Unit): P[]; export declare function newMade(): Made; export declare function envFor(o: SurfaceOptions | ScoreOptions, turned: boolean | undefined, range?: Box, upright?: number, zone?: Env["zone"]): Env;