/** * Helpers for the html-in-canvas wrapper canvas. * * Chrome has shipped two markups for it: * - `` (Chrome ≤ 156); * - `` with a `drawable` attribute on each child * to draw (Chrome 159+, where `layoutsubtree` alone no longer paints). * * We set both so the same wrapper works in either version. */ /** True if `el` is a canvas that captures its children with drawElementImage. */ export declare function isHicCanvas(el: Element): el is HTMLCanvasElement; /** Mark `canvas` as an html-in-canvas wrapper and `child` as drawable. */ export declare function markHicCanvas(canvas: HTMLCanvasElement, child?: Element | null): void; /** The parts of a DOMRect we use. */ export type RectLike = { left: number; top: number; width: number; height: number; }; /** * Where to draw a nested canvas into the capture buffer. * * `base` is the captured element's rect, `rect` the nested canvas's content * box (both in CSS px, viewport coords). `sx` / `sy` are capture buffer px * per CSS px. Returns null when the canvas is empty or outside `base`. */ export declare function nestedCanvasDest(base: RectLike, rect: RectLike, sx: number, sy: number): [number, number, number, number] | null; /** * Draw each visible canvas inside `root` over the capture at its layout * size and position. Works around Chrome drawing nested canvases at buffer * size and clipping them. It draws on * top of everything else, so an * element stacked above a canvas is hidden by it, and a canvas with * transparent pixels shows the wrongly sized copy through them. */ export declare function redrawNestedCanvases(ctx: CanvasRenderingContext2D, root: Element): void;