/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The minimap (#1393): the whole drawing in the canvas's corner, a press on * it a jump there. It shows the drawing, never only what the view is near: * each zone's floor and outline, each kind read by area as its whole * drawing's density — the area index's counts over the extent, read once a * revision (`../area.ts`' `overview`), in the theme's five heat steps as the * canvas's density draws — and each item of a kind read whole as a dot. The * viewport's box over it is the canvas's DOM, which moves with the camera; * this module only sizes the minimap and paints it, pure. * * @packageDocumentation */ import type { SchematicDensity } from "../area.js"; import { type SchematicPalette } from "./paint"; /** The minimap's widest, in CSS px: a desktop's canvas. */ export declare const MINIMAP_MAX_PX = 150; /** * The minimap's size (#1393): the drawing's extent at its own aspect, * {@link MINIMAP_MAX_PX} wide at most, and no more than a quarter of the * canvas's width or a third of its height. * * @param canvas - The canvas's size, in CSS px * @param extent - The drawing's extent, in world units * @returns The minimap's size, in CSS px */ export declare function minimapSize(canvas: { readonly w: number; readonly h: number; }, extent: { readonly width: number; readonly height: number; }): { w: number; h: number; }; /** A zone as the minimap draws it: its box, in world units. */ export interface MinimapZone { readonly x: number; readonly y: number; readonly width: number; readonly height: number; } /** Everything {@link paintMinimap} needs. */ export interface MinimapPaintInput { readonly ctx: CanvasRenderingContext2D; /** The minimap's size, in CSS px; the context is scaled by the device's pixel ratio already. */ readonly width: number; readonly height: number; /** The drawing's extent, in world units: what the minimap shows, edge to edge. */ readonly extent: { readonly width: number; readonly height: number; }; /** The zones drawn: each its floor, under everything, and its outline, over the density. */ readonly zones: readonly MinimapZone[]; /** Each kind read by area's density over the whole drawing. */ readonly densities: readonly SchematicDensity[]; /** Each item of a kind read whole, by its centre, in world units. */ readonly items: readonly { readonly x: number; readonly y: number; }[]; readonly palette: SchematicPalette; } /** * Paints the minimap (#1393): clears it, then each zone's floor in the * canvas's paper, each density's cells in their heat steps (`densityStep`), * each item's dot in the muted ink, and each zone's outline in the subtle * rule over them. * * @param input - The minimap's context and size, the extent and what it draws */ export declare function paintMinimap(input: MinimapPaintInput): void; //# sourceMappingURL=minimap.d.ts.map