import type { Canvas2D, Context2D } from "../charts/canvas-types"; import type { PlotLayout } from "../layout/plot-layout"; /** * Destructive per-frame canvas setup: resize to CSS pixels × DPR, * clear, and return a DPR-scaled 2D context. Call this exactly once * per canvas per frame — setting `canvas.width` / `canvas.height` * always wipes the bitmap and resets the transform, so calling it in * a per-facet loop wipes every previously-drawn facet. * * Faceted renderers call this once per frame and then * {@link getScaledContext} per facet to obtain the same context * without re-wiping. */ export declare function initCanvas(canvas: Canvas2D, layout: PlotLayout, dpr: number): Context2D | null; /** * Non-destructive variant: returns the 2D context with its transform * forced to `scale(dpr, dpr)` via `setTransform` (idempotent — no * stacking). Assumes `initCanvas` was already called on this canvas * this frame; does NOT resize or clear. * * Intended for per-facet render helpers that must not wipe the shared * canvas bitmap mid-frame. */ export declare function getScaledContext(canvas: Canvas2D, dpr: number): Context2D | null;