import type { CanvasAnnotationTranslate } from "./types.js"; export interface DrawAnnotation { id: string; type: "path" | "text"; /** SVG path data for "path" type */ pathData?: string; /** Text content for "text" type */ text?: string; /** Annotation color (hex) */ color: string; /** Stroke width for paths, font weight reference for text */ lineWidth: number; /** Position relative to the canvas (text annotations only) */ position: { x: number; y: number; }; /** * Creation timestamp (Date.now()) — used for unified undo ordering across * strokes and text annotations. Optional so existing callers of DrawAnnotation * don't need to supply it. */ createdAt?: number; } export interface DrawOverlayProps { translate: CanvasAnnotationTranslate; /** Whether the overlay is currently visible (toggled from the toolbar) */ visible: boolean; /** When false, canvas clicks pass through to sibling tools while the toolbar stays usable. */ canvasInteractive?: boolean; /** Extra queued annotations owned by sibling tools, such as comment pins. */ queuedAnnotationCount?: number; /** * Current zoom level (percentage, e.g. 100 = 100%). Used to convert * getBoundingClientRect() visual-space coordinates to layout-space so that * strokes and text labels stay anchored to their painted position across * zoom changes. */ zoom?: number; /** Called when the user submits the queued strokes/text to the agent */ onSend: (annotations: DrawAnnotation[], instruction: string, canvasSize: { width: number; height: number; }) => void; /** Called when the user cancels / closes the draw mode */ onClose: () => void; /** * True while the caller is capturing/compositing/uploading the annotated * screenshot for a just-submitted drawing (see the design app's * design-canvas/annotation-snapshot.ts). Disables Send and swaps its icon * for a spinner so a slow capture can't be triggered twice from the same * drawing. The entire overlay becomes inert while true so edits made after * the submitted snapshot cannot be erased when that submission is later * confirmed and the caller clears the batch. */ sending?: boolean; /** * Bump this (e.g. a counter) exactly when the caller wants to discard the * current strokes/text annotations — after `onClose` or a confirmed Send. * Strokes/text are intentionally NOT cleared merely because `visible` * turns false: `visible` can toggle off for reasons that have nothing to * do with the user wanting to discard their work (switching tools, views, * or side panels), and doing so silently would destroy annotations the * user never got a chance to send. Only an in-progress (uncommitted) * gesture is reset on hide; a pending text label is committed so its typed * content survives. */ clearSignal?: number; /** * Identity of the canvas this annotation batch belongs to. When the host * reuses one DrawOverlay instance for a different screen, the old batch is * cleared with a warning instead of being silently reinterpreted against * the new screen's pixels and submitted with the wrong screenshot. */ scopeKey?: string; /** * Keep the canvas DOM/bitmap alive while hidden. Use for the one active * editor overlay whose work must survive mode/view toggles; leave false for * large preview grids so every dormant screen does not allocate a canvas * and ResizeObserver. */ retainSurfaceWhenHidden?: boolean; } /** * Draw-to-prompt overlay for the slide canvas. * * Mirrors claude.ai/design's "Draw mode": the user sketches on the canvas, * adds a one-line text instruction, hits Send, and the strokes + instruction * are forwarded to the agent. The agent receives the path geometry along with * the canvas size so it can interpret position semantically (e.g. "move the * title here"). * * This component is canvas-agnostic — it overlays absolutely-positioned over * its parent, so the parent (a slide editor or design canvas) only needs to * be `position: relative`. * * Coordinate model * ---------------- * All stroke points and text positions are stored as fractions (0..1) of the * canvas's visual rect (getBoundingClientRect). This makes them stable across * zoom and resize. When rendering: * - Canvas strokes: multiply by rect.width / rect.height (visual pixels). * - CSS text labels: multiply by rect.width/scale / rect.height/scale * (layout pixels inside the scaled wrapper). * - pathData in send(): layout pixels = fraction * rect.width / scale. */ export declare function DrawOverlay({ translate, visible, canvasInteractive, queuedAnnotationCount, zoom, onSend, onClose, sending, clearSignal, scopeKey, retainSurfaceWhenHidden, }: DrawOverlayProps): import("react").JSX.Element | null; //# sourceMappingURL=DrawOverlay.d.ts.map