import { ReactiveControllerHost } from 'lit'; import { Store } from '../store/store'; import { AnnotatorState } from '../store/store.types'; import { NormPoint, Pin, Shape, ToolType } from '../types/annotation.types'; /** A host that is both a Lit reactive host and a DOM event target. */ type ControllerHost = ReactiveControllerHost & EventTarget; /** * Owns mutating markup actions (shapes, pins, draft buffer) and the active * tool/style. Undo/redo is scoped to the current drawing session: it operates * on the pending `draftShapes` buffer only, so `Ctrl+Z` removes the last shape * you just drew (before it becomes a comment). Committing (submit) or discarding * the draft clears the buffers. Comments are never touched by undo — they are * API-backed and reversed via their own actions/events. */ export declare class DrawController { private host; private store; constructor(host: ControllerHost, store: Store); private get state(); get canUndo(): boolean; get canRedo(): boolean; /** Pull the last drawn draft shape back off the canvas. */ undo(): void; /** Re-apply the last undone draft shape. */ redo(): void; setTool(tool: ToolType): void; setColor(color: string): void; setStrokeWidth(strokeWidth: number): void; /** Set the current stroke opacity (0–1). */ setOpacity(opacity: number): void; /** Merge partial style options into the current style (e.g. fill, doubleArrow). */ setStyle(partial: Partial): void; /** Commit a finished standalone shape to the store (markup, no comment). */ addShape(shape: Shape): void; /** * Add a shape to the pending draft buffer (draw-to-comment). In "Draw more" * mode shapes accumulate on the draft; otherwise (single-shape mode) each new * drawing overwrites the current uncommitted draft — starting a fresh session * so the open composer never silently collects unrelated shapes. Drawing * always clears the redo buffer (a fresh action ends the redo timeline). */ addDraftShape(shape: Shape): void; /** Discard all pending draft shapes (and the redo buffer). */ clearDraftShapes(): void; /** Place a pin at a normalized position and return it. */ addPin(position: NormPoint, opts?: { startTime?: number; }): Pin; private notifyChanged; } export {}; //# sourceMappingURL=draw.controller.d.ts.map