/** * Mount points for the agent overlay: one per run of neighbouring blocks an * agent holds, drawn inside the page, plus a marker in the editor's gutter for a * run at the very top of the page. */ import type { FocusHighlight } from './focusRegionMap.js'; /** The component IDs a run's key covers, in page order. */ export declare function agentRunBlocks(runKey: string): string[]; /** Must match `--agent-fade` in styles.css. */ export declare const AGENT_FADE_MS = 300; /** * The block a pointer landed in. A pointer on an overlay's banner counts as its * run's first block, so using the banner does not put it away. */ export declare function agentBlockIdAt(target: EventTarget | null): string | null; export declare function markSelectedAgentHost(hosts: Map, componentId: string | null): void; /** Presence can name a block before the canvas has drawn it. */ export declare function hasUndrawnAgentBlocks(doc: Document, focusMap: Map): boolean; /** The element in the page the overlays hang from, added on first use. */ export declare function agentHostLayer(doc: Document): HTMLElement | null; /** * Each run's blocks and everything they sit in: a block only moves when one of * these resizes. The body alone will not do, as it can be held at the height of * the viewport while the page scrolls past it. */ export declare function agentLayoutTargets(doc: Document, hosts: Map): Set; /** * Calls back when the page's markup changes, which catches blocks that move * without anything resizing, such as two swapped over. */ export declare function observeAgentPageLayout(doc: Document, onChange: () => void): () => void; /** * The editor zooms the page, overlays included. Their boxes should follow; the * marker, banner and rim should not, so the stylesheet scales them back by the * factor this leaves on the layer. */ export declare function unzoomAgentLayer(layer: HTMLElement, frame: HTMLElement | null): number; /** * Lays each overlay over its run in page coordinates, so the page carries it as * it scrolls. Returns the runs too near the top of the page for their marker to * hang above them. */ export declare function placeAgentHosts(doc: Document, layer: HTMLElement, hosts: Map, unzoom?: number): Set; /** * Lays each gutter marker over its run from outside the page, which the page * does not carry as it scrolls: shifted by where the frame sits and scaled by * the editor's zoom. */ export declare function positionAgentHosts(doc: Document, mount: HTMLElement, hosts: Map): void; /** * Gives each run the agents hold a mount point and takes away released ones. * A released run keeps its mount point for `AGENT_FADE_MS` so it can fade; one * whose blocks the canvas dropped loses it at once. Placing is the caller's job. */ export declare function syncAgentHosts(doc: Document, mount: HTMLElement, focusMap: Map, hosts: Map): Map; /** * Draws the marker of each run at the very top of the page in the gutter, where * the page's edge would cut it in half, and tells the run's overlay not to draw * its own. A marker fades, returns and goes with its overlay. */ export declare function syncAgentGutterMarkers(doc: Document, mount: HTMLElement, hosts: Map, flush: Set, markers: Map): Map;