import { type BrowserInfo } from './browser.js'; /** Which markup dialect a render takes. */ export type RenderKind = 'html' | 'svg'; /** One render request after the caller applied no defaults. */ export interface RenderInput { kind: RenderKind; markup: string; width: number; height: number; scale?: number | undefined; background?: string | undefined; timeoutMs?: number | undefined; } /** A rasterized page. */ export interface RenderOutput { png: Uint8Array; width: number; height: number; durationMs: number; browser: BrowserInfo; } /** Bounds the renderer enforces before any process starts. */ export declare const RENDER_LIMITS: { readonly minSide: 16; readonly maxSide: 8192; readonly maxScale: 4; readonly maxPixels: 40000000; readonly maxMarkupBytes: 2000000; readonly defaultTimeoutMs: 30000; }; /** A render failure with a stable machine-readable code. */ export declare class RenderError extends Error { readonly code: string; constructor(message: string, code: string); } /** Render geometry after defaults and clamping. */ export interface RenderGeometry { width: number; height: number; scale: number; background: string; timeoutMs: number; } /** * Apply defaults and reject values the renderer will not attempt. * * @param input - caller markup and geometry. * @returns validated geometry and timeout. */ export declare function normalizeRenderInput(input: RenderInput): RenderGeometry; /** * Build the complete document Chromium will screenshot. * * @param input - validated render input. * @param background - page background. * @returns a full HTML document. */ export declare function buildRenderDocument(input: RenderInput, background: string): string; /** Where a render's artifacts live while the browser runs. */ export interface RenderRunContext { screenshotPath: string; pagePath: string; width: number; height: number; scale: number; } /** * Render markup to PNG. * * @param input - markup plus geometry. * @param options - browser override, cancellation, and a test seam for the * browser process. * @returns the PNG and its measured size. */ export declare function renderToPng(input: RenderInput, options?: { browserPath?: string | undefined; signal?: AbortSignal | undefined; /** Test seam: replaces spawning the real browser. */ run?: ((args: string[], context: RenderRunContext, timeoutMs: number, signal?: AbortSignal) => Promise) | undefined; }): Promise; /** * Read width and height from a PNG header. * * @param png - PNG bytes. * @returns dimensions, or undefined when the signature does not match. */ export declare function pngSize(png: Uint8Array): { width: number; height: number; } | undefined;