import { type OutsideCrowd, type OutsideLevel, type OutsideStats } from "./outside.paint.ts"; /** What a view tells its crowd layer. `crowd` makes (or fetches) the crowd and is called only when one is to be shown. */ export interface OutsideSpec { level: OutsideLevel; crowd: () => OutsideCrowd | undefined; /** The plan's view box in feet: what the canvas covers. */ viewBox: { x: number; y: number; w: number; h: number; }; } /** What a mounted crowd layer lets a page do and read. */ export interface OutsideLayer { /** The level shown. */ readonly level: OutsideLevel; setLevel(level: OutsideLevel): void; /** How much of the crowd a quality tier draws: the share of the people (0 hides the canvas) and the share of the usual width of the canvas. Painted again when it changes. */ setDetail(detail: { people: number; width: number; }): void; /** The 3D view's zoom: a near view is painted finer (its people discs, not density). The paint is redone only when the zoom crosses `NEAR`. */ zoom(zoom: number): void; /** What the last paint cost, in milliseconds, and drew: `undefined` before the first. */ readonly last: { ms: number; pixels: number; stats: OutsideStats; } | undefined; destroy(): void; } /** The zoom above which the 3D view paints the crowd finer. */ export declare const NEAR = 1.5; /** The widest a canvas is made, in pixels: a district seen whole at 1.4 times the floor's own size, near at 2.4 times, never past this. */ export declare const MAX_WIDE = 3072; /** The colour the crowd is painted in: the page's `--ky-dist-people` (as the district's drawing sets it, light and dark) read as red, green and blue. */ export declare function inkOf(from: Element): [number, number, number]; /** * The crowd on the floor of a 3D view: a canvas as the last child of the floor element (which the view's matrices already move), as wide in pixels as the floor is, 1.4 times (2.4 times when the view is near; `layer.zoom`). * `floor` is the `.ky-turn-floor` element. It is painted once now and again only when something it shows changes. */ export declare function attachOutside3d(floor: HTMLElement, spec: OutsideSpec, prefetchCrowd?: boolean): OutsideLayer; /** * The crowd over a 2D plan: a canvas in `wrap` (a positioned element the plan's SVG is the child of), laid exactly over the box the SVG draws its view in (it keeps its shape inside a box of another, as `meet` does), as many pixels * as the box has device pixels, and made again when the box changes size. */ export declare function attachOutsidePlan(wrap: HTMLElement, svg: SVGSVGElement, spec: OutsideSpec, prefetchCrowd?: boolean): OutsideLayer;