/** * PNG snapshot helpers shared by the engine adapters. * * `snapshot()` itself is engine-specific (it must capture inside the engine's own * render frame), but the toolbar wiring — preset→scale mapping, the camera button, * the browser download — is identical everywhere and lives here so the three * adapters stay thin. */ import type { SnapshotDelivery, SnapshotQuality, SnapshotOptions, ToolbarItem } from "./index.js"; /** * Map a snapshot quality preset to an output pixel-ratio (device px per CSS px). * - `low` → 1 (CSS-pixel resolution), * - `native` → `window.devicePixelRatio` (capture "as on screen"; 1 if undefined), * - `medium` → 2, `high` → 3 (supersampling; best-effort, see README). */ export declare function snapshotScale(quality: SnapshotQuality): number; /** Snapshot **download** icon — camera with a **filled** lens. */ export declare const SNAPSHOT_ICON_SVG: string; /** Snapshot **clipboard** icon — same camera with an **empty** (ring-only) lens. */ export declare const SNAPSHOT_CLIPBOARD_ICON: string; /** Download a Blob as a file in the browser (object-URL + a transient ``). */ export declare function downloadPng(blob: Blob, filename?: string): void; /** * Copy a PNG to the system clipboard via the async Clipboard API. Accepts the Blob or * a **Promise** of it — pass the still-pending capture promise so `clipboard.write()` * is issued **synchronously within the click**: Safari (and strict Chrome) reject a * write made after an `await` (the user gesture is gone). Needs a **secure context** * (HTTPS/localhost). Rejects when the browser/context can't write an image. */ export declare function copyPng(blob: Blob | Promise): Promise; /** Apply a {@link SnapshotOptions.target} to a captured PNG (download / clipboard / * none) and resolve to the Blob — the shared delivery used by every adapter's * `snapshot()`. Pass the (possibly still-pending) capture promise: for `clipboard` * the write is issued **synchronously** here, while we're still in the click's call * stack, so the user gesture isn't lost (see {@link copyPng}). */ export declare function deliverSnapshot(blob: Blob | Promise, opts?: SnapshotOptions): Promise; /** * Play a brief curtain shutter over `container` — two translucent blades close to the * centre and reopen (the map stays faintly visible). Visual feedback for a capture * (handy for the otherwise-silent clipboard copy). Honours `prefers-reduced-motion` * (degrades to a single quick dim). The overlay is `pointer-events:none` and * self-removes. `container` must be a positioned element (the engine map containers are). */ export declare function shutterFlash(container: HTMLElement, opts?: { durationMs?: number; }): void; /** * Build the snapshot toolbar item for an adapter, or `null` when the button is * hidden. **`undefined` ⇒ defaults** (a button); `null` / `false` / `"none"` ⇒ no * button; an object configures it. * * The button always offers **both** deliveries: the `onClick` delivery on a plain * click, the other one on a modifier-click ({@link modifierLabel}). Each click calls * the adapter's own `snapshot({ scale, target })` (which captures *and* delivers). * On an unsupported engine the button is rendered DISABLED with `reason` as tooltip. * Called by each adapter's `addToolbar` (it owns `snapshot`/`snapshotSupported`). */ export declare function snapshotToolbarItem(config: "none" | false | null | { quality?: SnapshotQuality; onClick?: SnapshotDelivery; shutter?: boolean; hideOverlays?: string[]; } | undefined, cap: { supported: boolean; reason?: string; snapshot: (opts?: SnapshotOptions) => Promise; flash?: () => void; }): ToolbarItem | null; //# sourceMappingURL=snapshot.d.ts.map