import { type Env } from "./layers.env.ts"; import type { P } from "./layers.marks.ts"; import type { LayerBase, MarkDatum } from "./layers.types.ts"; import type { Unit } from "./units.ts"; /** The words of the team layers. */ export type Words = Env["words"]["team"]; /** A table of a team layer: the heads, the rows, the caption and a note for it. */ export interface TeamTable { head: string[]; rows: (string | number | null)[][]; title: string; note: string; } /** The class and the custom property that colour a mark: its own colour, else its team's, else the layer's. */ export declare function paintOf(d: MarkDatum | undefined): { cls: string; css: string; }; /** The class of a team that has one: `home` and `away` take the layer's team colours. */ export declare const teamClass: (team: string) => string; /** The team of a mark as a key: its text, or nothing. */ export declare const teamKey: (team: unknown) => string; /** The name of a team to a reader: home and away in the drawing's language, any other team as it was written, and no team as "all players". */ export declare function teamLabel(team: string, env: Env): string; /** Attributes for an element: a class, a style and an opacity, each left out when empty. */ export declare const attrs: (cls: string, css: string, opacity?: number) => string; /** An element with a tooltip, or without when there is none. */ export declare const titled: (tag: string, open: string, title: string | undefined) => string; /** The text to write for a player: his name, else his number, else his id. */ export declare function labelOf(d: { name?: unknown; number?: unknown; id?: unknown; }): string; /** A mark with a place, put on the surface (feet). */ export interface Placed { d: D; x: number; y: number; /** Its index in the layer's data. */ index: number; } /** The marks of a layer that have a place, on the surface, and how many have none. */ export declare function placeAll(layer: LayerBase, env: Env, data: readonly D[], unit: Unit): { items: Placed[]; skipped: number; }; /** A closed path through some places. */ export declare const polygonPath: (points: readonly P[]) => string; /** Round to a number of decimal places. */ export declare const round: (value: number, places?: number) => number; /** The marks grouped by team, in the order each team first appears; or all in one group (with the key "") for `by: "all"`. */ export declare function groupByTeam(items: readonly T[], by: "team" | "all" | undefined): Map; /** The dots that mark players, as a group that the stylesheet's `ky-pts` rule draws. */ export declare function dots(items: readonly Placed<{ team?: unknown; color?: unknown; title?: string; opacity?: number; }>[], radius: number, titles: (item: Placed<{ team?: unknown; }>) => string | undefined, env?: Env): string; /** The caption's note on a table's coordinates: the frame and its unit, or nothing when the numbers are the surface's own. */ export declare function frameNote(layer: LayerBase, env: Env): string; /** A unit of area as words in the drawing's language: square feet, square yards and square metres by name, any other unit as "square" and its symbol. */ export declare function squareWord(unit: string, env: Env): string; /** A unit as a word in the drawing's language: feet, yards and metres by name, any other unit as its symbol. */ export declare function unitWord(unit: string, env: Env): string;